Unable to open this exercise
A character set assigns a numeric code to each supported character. The computer stores those codes in binary. A character might be a letter, digit, punctuation mark or control character such as a line break.
ASCII and Unicode
ASCII uses 7-bit codes, giving 128 possible values. For example, uppercase A has code 65, represented as 1000001. A stored byte may include a leading zero: 01000001. Lowercase and uppercase letters have different codes.
An 8-bit code provides 256 possible values. Different extended-ASCII code pages use the extra values for different scripts or symbols. One may support Cyrillic, another Arabic; one 256-character set cannot represent all languages together. Sender and receiver need to agree on the character encoding or the text may display incorrectly.
Unicode assigns codes for a much larger range of languages and symbols. It enables multilingual documents to use a common character standard. It is not a promise that every character occupies the same number of bytes.
Worked example
If a simplified encoding uses one byte for every character in a 240-character message, its text takes 240 bytes, excluding headers. If each of those particular characters takes two bytes, the same message takes 480 bytes. Use the encoding assumption given in the question, rather than assuming all Unicode text doubles in size.
Optional detail: encodings
UTF-8 uses one to four bytes per Unicode code point and preserves ASCII values in its one-byte range. UTF-16 uses one or two 16-bit code units per code point. For 500 English ASCII-range characters encoded as UTF-16 without a byte-order mark or header, the calculation is 500 × 2 = 1000 bytes.
Explain it yourself
A museum needs labels in several different writing systems. Explain why Unicode is more suitable than a single 8-bit code page. Connect its larger repertoire to the museum's need; do not claim every Unicode character occupies two bytes.
Written practice and self-review
An international e-commerce company updates its database text encoding from ASCII to Unicode UTF-8. State one major benefit of this change for global customers. Explain one technical trade-off regarding data storage capacity and network transmission bandwidth.
Write an explanation before checking the theory. Check that each claim answers the question, uses the correct concept and explains why it applies. Discuss uncertain points with a teacher. The structured exercise below checks specific facts; it does not automatically mark this explanation.
AI Socratic Tutor
Need guidance? Ask a question or use the hint below.
AI Socratic Tutor is an All-Access Benefit
Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.
You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.
Concept Check: Apply the distinction
Concept Check: Apply the distinction
- Number of possible seven-bit codes: [Space 1]
- Does one eight-bit code page represent all writing systems together: yes or no? [Space 2]
- Bytes for 120 characters if each uses two bytes: [Space 3]
Sign in or create a free account to test your solution and track XP.