1.4 - Coding Techniques
1.4 - Coding Techniques
1.4 - Coding Techniques
E L C 111 . 1
Binary Coded Decimal
• Binary coded decimal
(BCD) represents each
decimal digit with four
bits
– Ex. 0011 0010 1001 =
32910
• This is NOT the same as
0011001010012
• Why do this? Because
people think in decimal.
Putting It All Together
• BCD not very efficient
• Used in early
computers (40s, 50s)
• Used to encode
numbers for seven-
segment displays.
• Easier to read?
Four Different Binary Codes
ASCII Code
• American Standard Code for Information Interchange
• ASCII is a 7-bit code, frequently used with an 8th bit for
error detection (more about that in a bit).
Character ASCII (bin) ASCII (hex) Decimal Octal
A 1000001 41 65 101
B 1000010 42 66 102
C 1000011 43 67 103
…
Z
a 1100001 61 97 141
…
1
‘
Gray Code
Digit Binary Gray Code
0 0000 0000
• Gray code is not a
1 0001 0001 number system.
2 0010 0011 – It is an alternate way to
3 0011 0010 represent four bit data
4
5
0100
0101
0110
0111
• Only one bit changes
6 0110 0101 from one decimal digit
7 0111 0100 to the next
8 1000 1100
9 1001 1101 • Useful for reducing
10 1010 1111 errors in
11 1011 1110
12 1100 1010
communication.
13 1101 1011 • Can be scaled to
14 1110 1001
15 1111 1000
larger numbers.
Control Character
Question
• What bit must be complemented to change
an ASCII letter from capital to lowercase and
vice versa?
Question
ASCII Codes and Data Transmission
° ASCII Codes
° A – Z (26 codes), a – z (26 codes)
° 0-9 (10 codes), others (@#$%^&*….)
° Transmission susceptible to noise
° Typical transmission rates (1500 Kbps, 56.6 Kbps)
° How to keep data transmission accurate?
Error Correcting Codes
• Parity (or check) codes are formed by concatenating a
parity bit, P to each code word of C.
• In an odd-parity code, the parity bit is specified so that the
total number of ones is odd.
• In an even-parity code, the parity bit is specified so that the
total number of ones is even.
P Information Bits
1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1
Added even parity bit Added odd parity bit
Parity Code Example
• Concatenate a parity bit to the ASCII code for
the characters 0, X, and = to produce both
even-parity and odd-parity codes.
Reference
• Mano, Morris. Digital Design, 4th Edition.
Englewood Cliffs, N.J.: Prentice-Hall: 2006.
• Ergovac M., Lang T. & Moreno J.,
Introduction to Digital Systems, John Willey
& Sons: 1999.
• Orig ppt courtesy of Engr. Math Dumlao
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: