- Asked 2/22
- 2081 Baisakh · 2 marks
- 2078 Bhadra · 1.5 marks
ASCII code with examples
Short answer
ASCII is a 7-bit code for 128 characters, covering letters, digits, punctuation, and control codes. Example: 'A' = 65 decimal (100 0001), '0' = 48 (011 0000). It is the standard text representation in computers.
Explain ASCII code with examples.
ASCII (American Standard Code for Information Interchange) is a 7-bit alphanumeric code that represents characters: letters, digits, punctuation and control codes. It is the standard code for text in computers and for data exchange between devices.
Groups of characters
- 0–31 and 127: control characters (e.g. LF = 10, CR = 13, ESC = 27, DEL = 127).
- 32: space; 33–47, 58–64, 91–96 and 123–126: punctuation and symbols.
- 48–57: digits '0'–'9' (011 0000 to 011 1001).
- 65–90: capital letters 'A'–'Z'; 97–122: small letters 'a'–'z'.
Examples
| Character | Decimal | Hex | 7-bit ASCII |
|---|---|---|---|
| A | 65 | 41 | 100 0001 |
| C | 67 | 43 | 100 0011 |
| a | 97 | 61 | 110 0001 |
| 0 | 48 | 30 | 011 0000 |
| Space | 32 | 20 | 010 0000 |
So "CAT" is stored as 43H 41H 54H. Lower-case letters are 32 (bit 5) higher than capitals. An 8th bit is often added as a parity bit or for the extended ASCII set (256 characters).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- ASCII code and binary-to-Excess-3 converter · Digital Logic, chapter 1 · asked 2×
- Importance of coding and ASCII code · Digital Logic, chapter 1