---
title: "ASCII code with examples"
subject: "Digital Logic"
chapter: 1
key: "semester_3/digital_logic:ascii-code-explain"
source: https://www.bctengineer.com/q/semester_3/digital_logic/ascii-code-explain
site: BCT Engineering
---

# ASCII code with examples

Digital Logic · Chapter 1: Introduction

- Asked in: 2081 Baisakh, 2 marks; 2078 Bhadra, 1.5 marks (asked 2 times)
- Video: [ASCII code Explained: Basics, Table, Conversion, and Examples](https://www.youtube.com/watch?v=gNA4GeIjJmM) — Engineering Funda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/digital_logic/ascii-code-explain
- Whole chapter: https://www.bctengineer.com/md/semester_3/digital_logic/chapter-1

## Question

Explain 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.

## Answer

**ASCII (American Standard Code for Information Interchange)** is a **7-bit alphanumeric code** that represents $2^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**

| 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).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How many characters can 7-bit ASCII represent?
   A. 64
   B. 256
   C. 127
   D. 128
   Answer: D. 2^7 = 128. (Key point: ASCII size)

2. What is the ASCII code of 'A'?
   A. 65 (100 0001)
   B. 97 (110 0001)
   C. 48 (011 0000)
   D. 32 (010 0000)
   Answer: A. Capital letters start at 65; 97 is 'a' and 48 is '0'. (Key point: Character codes)

3. How do lower-case letters differ from capitals in ASCII?
   A. They are 16 higher
   B. They are 32 higher (bit 5 set)
   C. They are 32 lower
   D. They are 64 higher
   Answer: B. 'a' = 97 and 'A' = 65, a difference of 32. (Key point: Case difference)

## Related in Digital Logic

- [ASCII code and binary-to-Excess-3 converter](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aascii-binary-excess3-converter) — Digital Logic, chapter 1, asked 2×
- [Importance of coding and ASCII code](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Acoding-importance-ascii) — Digital Logic, chapter 1
