Draw a diagram showing how the text "Hi!" is stored using ASCII and Unicode encoding. Include the character, its binary code in ASCII (7-bit), and its binary code in Unicode (UTF-16).
10 minutes
Hint 1
Hint 2
Hint 3
Grading Criteria
Diagram includes all characters: H, i, !
ASCII binary codes are correct 7-bit representations
Unicode binary codes are correct 16-bit UTF-16 representations
Characters and their codes are clearly labeled and aligned
Diagram shows side-by-side comparison of ASCII and Unicode
Solution
Text: "Hi!"
ASCII Encoding (7-bit):
Character: H i !
Binary: 1001000 1101001 0100001
Unicode Encoding (UTF-16, 16-bit):
Character: H i !
Binary: 00000000 01001000 00000000 01101001 00000000 00100001
Diagram:
+-----------+------------+---------------------+
| Character | ASCII (7b) | Unicode (UTF-16) |
+-----------+------------+---------------------+
| H | 1001000 | 00000000 01001000 |
| i | 1101001 | 00000000 01101001 |
| ! | 0100001 | 00000000 00100001 |
+-----------+------------+---------------------+
This diagram shows how each character in the text "Hi!" is stored in two common text encoding systems.
ASCII: Each character is stored using 7 bits. For example, 'H' is 1001000 in binary.
Unicode (UTF-16): Each character is stored using 16 bits (2 bytes). The first 8 bits are zeros for these characters, and the last 8 bits represent the ASCII code extended to 16 bits. For example, 'H' is 00000000 01001000.
This shows that Unicode can represent many more characters than ASCII by using more bits per character.
Variations - 2 Challenges
[beginner] Draw a diagram showing how the text "Cat" is stored using ASCII and Unicode (UTF-16). Include characters and their binary codes.