C ODES
It is the symbolic representation of discrete information which
may be represented in the form of numeric, alphabets & special
characters.
• In Digital Electronics, the binary digits 0 & 1 are used to
represent these symbols & are arranged according to the rules
of specific code.
1. Computer and other digital circuits process data in
binary format.
2. Various binary codes are used to represent data.
3. The interpretation of data is only possible if the code in which
the information is available is known.
Binary Coded Decimal (BCD):
In this code each decimal digit is represented by a 4-bit binary
number. BCD is a way to express each of the decimal digits with
a binary code. In the BCD, with four bits we can represent
sixteen numbers (0000 to 1111). But in BCD code only first ten
of these are used (0000 to 1001). The remaining six code
combinations i.e. 1010 to 1111 are invalid in BCD.
Each digit (0-9) is represented by its 4-bit binary
equivalent.
For example, the decimal number 25 is represented as:
o 2 = 0010
o 5 = 0101
o So, 25 in BCD = 0010 0101.
Alphanumeric codes:
The alphanumeric codes are the codes that represent numbers
and alphabetic characters. Mostly such codes also represent
other characters such as symbol and various instructions
necessary for conveying information. An alphanumeric code
should at least represent 26 alphabets with capital and small
letters, numbers from 0 to 9, punctuation marks and other
symbols. The following three alphanumeric codes are very
commonly used for the data representation.
ASCII- American Standard Code for Information Interchange.
Unicode- Universal Code
ASCII (American Standard Code for Information Interchange)
ASCII is a character encoding standard used for representing
text in computers, telecommunications, and other electronic
devices.
Types:
o 7-bit ASCII: Uses 128 characters (0-127).
o 8-bit ASCII (Extended ASCII): Uses 256 characters
(0-255) to support additional symbols and special
characters.
Character Representation:
o A → 65 (01000001 in binary)
o a → 97 (01100001 in binary)
o 0 → 48 (00110000 in binary)
o Space → 32 (00100000 in binary)
Categories:
o Control characters (0-31, 127) → e.g., \n (newline), \t
(tab)
o Printable characters (32-126) → Letters, numbers,
punctuation
Unicode
Unicode is a universal character encoding standard designed to
support text in all languages and scripts. It can represent more
than 65,000 unique characters. Unicode includes:
UTF-8: A variable-width encoding that uses 1 to 4 bytes
per character. It is backward-compatible with ASCII.
UTF-16: Uses 2 or 4 bytes per character.
UTF-32: Uses 4 bytes per character, providing a fixed-
width encoding.
Unicode includes:
Alphabets (Latin, Cyrillic, Greek, etc.)
Symbols (mathematical, currency, etc.)
Emoji’s
Scripts for languages like Chinese, Arabic, and Hindi.
[Link]
[Link]