Skip to main content

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 27=1282^7 = 128 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

CharacterDecimalHex7-bit ASCII
A6541100 0001
C6743100 0011
a9761110 0001
04830011 0000
Space3220010 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)

All Digital Logic chapter 1 questions →