- 2078 Kartik · 1.5+1.5 marks
ASCII and EBCDIC codes
Short answer
ASCII is a 7-bit code (128 characters) where 'A'=41H, '0'=30H. EBCDIC is an 8-bit IBM code (256 characters) where 'A'=C1H, '0'=F0H.
Explain ASCII and EBCDIC codes with example.
Both are alphanumeric codes: binary codes that represent letters, digits, punctuation marks and control characters so that text can be stored and sent by digital systems.
ASCII
- American Standard Code for Information Interchange.
- A 7-bit code, so it has characters (0–127); often stored in 8 bits with the MSB as 0 or as a parity bit.
- Codes 0–31 and 127 are control characters (e.g. LF = 0AH, CR = 0DH); 32–126 are printable.
- Letters and digits are in order, which makes sorting easy.
- Examples: 'A' = 100 0001 (41H), 'a' = 110 0001 (61H), '0' = 011 0000 (30H), space = 20H.
- Used in PCs, keyboards, the internet and most modern systems.
EBCDIC
- Extended Binary Coded Decimal Interchange Code, developed by IBM.
- An 8-bit code, so up to characters.
- Based on BCD: the lower 4 bits of a digit are its BCD value and the upper 4 bits (zone) are 1111.
- Letters are not in one continuous block (gaps between I/J and R/S).
- Examples: 'A' = 1100 0001 (C1H), 'a' = 1000 0001 (81H), '0' = 1111 0000 (F0H), '9' = F9H.
- Used mainly in IBM mainframes.
| Character | ASCII (hex) | EBCDIC (hex) |
|---|---|---|
| A | 41 | C1 |
| a | 61 | 81 |
| 0 | 30 | F0 |
✓ Answer checked by Claude Opus 5.5 (high effort)