The number of unique characters a set can represent is mathematically determined by its bit depth, following the formula , where is the number of bits. A higher bit depth allows for a larger repertoire of symbols but requires more storage space per character.
For example, a 7-bit system can represent unique characters, which is sufficient for basic English text but lacks the capacity for mathematical symbols or other languages. Increasing this to 16 bits expands the capacity to unique codes.
This relationship creates a trade-off between representational power (the variety of symbols available) and storage efficiency (the amount of memory required to save a text file).
| Feature | ASCII | Unicode |
|---|---|---|
| Bit Depth | 7-bit (often stored as 8) | 16-bit (minimum) |
| Capacity | 128 characters | 65,536+ characters |
| Language Support | English only | Global (All languages) |
| Storage Size | Low (1 byte per char) | High (2+ bytes per char) |
| Special Symbols | None | Emojis, Math, Ancient scripts |
The primary trade-off between these two is efficiency versus universality. ASCII is highly efficient for English-only text files, whereas Unicode is necessary for any application that requires internationalization or diverse symbolic representation.
Calculate Capacity: Always use the formula to determine the maximum number of characters. If an exam asks for the capacity of a 10-bit set, the answer is .
Identify the Case Bit: Remember that in ASCII, the difference between 'A' and 'a' is found in a single bit. If you see two binary strings that are identical except for one bit in the middle, they are likely the same letter in different cases.
Storage Calculations: When calculating file sizes, remember that Unicode characters typically take up twice as much space (or more) as ASCII characters. If a string has 10 characters, ASCII uses 10 bytes, while 16-bit Unicode uses 20 bytes.
Compatibility Check: Always mention that Unicode is backward compatible with ASCII for the first 128 characters, as this is a frequent point of assessment.