Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 3: BCD, ASCII & EBCDIC Codes

Lesson 29 of 34 in the free Fundamentals of IT & Computers notes on Siksha Sarovar, written by Rohit Jangra.

Unit III — BCD, ASCII & EBCDIC Codes

Computers store and process text, numbers, and symbols using standardised binary encoding schemes. The three most important codes in this context are BCD, ASCII, and EBCDIC.

---

BCD — Binary Coded Decimal

BCD represents each decimal digit separately using its 4-bit binary equivalent.

BCD Encoding Table:

Decimal DigitBCD (4 bits)
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
10–15Invalid (unused)

Example: Encode (395)₁₀ in BCD:

  • 3 → 0011
  • 9 → 1001
  • 5 → 0101
  • BCD: (0011 1001 0101)

Note: BCD is NOT the same as binary! (395)₁₀ in pure binary = (110001011)₂ (9 bits), but in BCD it takes 12 bits.

Use cases: Calculators, financial systems, digital clocks — anywhere decimal precision is needed without floating-point errors.

---

ASCII — American Standard Code for Information Interchange

ASCII encodes 128 characters (letters, digits, punctuation, control codes) using 7 bits (or 8 bits with a leading 0).

Key ASCII Values (Decimal):

Character RangeASCII Range
Control characters (NUL, TAB, LF, CR…)0–31
Space32
Digits '0'–'9'48–57
Uppercase A–Z65–90
Lowercase a–z97–122
Common punctuation33–47, 58–64, 91–96

Examples:

  • 'A' = 65 = (1000001)₂
  • 'Z' = 90 = (1011010)₂
  • 'a' = 97 = (1100001)₂
  • '0' = 48 = (0110000)₂

Relationship between uppercase and lowercase: a − A = 32. Add 32 to convert upper→lower; subtract 32 for lower→upper.

Extended ASCII: Uses 8 bits (256 characters) to include additional symbols and accented characters.

Unicode/UTF-8 extends ASCII to cover all world scripts — backward compatible with ASCII for the first 128 characters.

---

EBCDIC — Extended Binary Coded Decimal Interchange Code

  • EBCDIC is an 8-bit character encoding developed by IBM for its mainframe computers.
  • Uses 256 character codes (8 bits per character).
  • Unlike ASCII, EBCDIC digits '0'–'9' start at code 240 (F0₁₆), not 48.
  • Uppercase letters are not contiguous in EBCDIC (unlike ASCII).

EBCDIC vs ASCII:

FeatureASCIIEBCDIC
DeveloperANSIIBM
Bits per character7 (or 8)8
Characters128 (256 extended)256
Used inPCs, Internet, UnixIBM mainframes
'0' code48240

---

Summary of Code Systems

CodePurposeBitsCharacters
BCDDecimal digit representation4 per digitDigits 0–9 only
ASCIIGeneral text encoding7 (or 8)128 (or 256)
EBCDICIBM mainframe encoding8256
UnicodeGlobal text encoding8–32 (UTF-8/16/32)1,000,000+
Key Takeaway: BCD encodes each decimal digit in 4 bits (used in calculators and financial apps). ASCII is the universal 7-bit character encoding for PCs and the internet. EBCDIC is IBM's 8-bit alternative used on mainframes. For exams, know ASCII codes for 'A' (65), 'a' (97), '0' (48), and the BCD representation of decimal digits.