Degital Logic Design Lec 3
Degital Logic Design Lec 3
Design
Igbafe Orikumhi Ph.D.,
oigbafe2@hanyang.ac.kr
Excess-3 Code
Gray Code
ASCII Code
Codes
0101010001 0101010001
Transmitter Receiver
• Excess-3 Codes
• Grey Codes,
• Hamming Codes
• There are only ten code groups in the BCD system making very
easy to convert to decimal and vice-versa
• Digital readouts
• Answer in BCD
0111
(0111 is 7) sum < 9
1100
(1100 is 12) sum > 9 with final carry =0
hence the answer is incorrect, we must
add 6 (0110 to correct the result)
1100
(1100 is 12) sum > 9 with final carry =0
+¿ 0110
hence the answer is incorrect, we must
add 6 (0110 to correct the result)
10010 (10010 is the BCD representation of 12)
1001
10001
0110
• We can construct the 2421 BCD code using the self complementing properties as
follows Weight
2 4 2 1
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 1 0 1 1
6 1 1 0 0
7 1 1 0 1
8 1 1 1 0
9 1 1 1 1
• Practice Questions:
1. Convert the decimal number 89 to BCD using the 2421 code and the 8421
code
2. A transmitted signal is encoded with a BCD 2421 encoder, if the code at the
receiver
ECN1001-Digital Logic Design is 01001100101, what is thePh.D.
© Igbafe Orikumhi, decimal equivalent? What will be the
21
Excess-3 Codes
• Rule: When the final carry of any group is 1, add 0011 (3) to the group. If the
final carry is 0, subtract 0011 (3) from the group
0100 1100 1 9
+¿ 0100 1010 +¿ 1 7
1001 0110 3 6
− 0011 0011 +¿ +¿ 3 3
0110 1001 6 9
Binary numbers are converted into Gray code to reduce switching operation
Useful to reduce
switching operation
B 0
B 1
G 2
G 1
111 G 0
010 011
101
(a) Binary Code for Positions 0 through 7 (b) Gray Code for Positions 0 through 7
B 0
B 1
G 2
G 1
111 G 0
010 011
101
(a) Binary Code for Positions 0 through 7 (b) Gray Code for Positions 0 through 7
B 0
B 1
G 2
G 1
111 G 0
010 011
101
(a) Binary Code for Positions 0 through 7 (b) Gray Code for Positions 0 through 7
• These requires then six bits in each code combination because five bits
are insufficient
• ASCII has 128 characters and symbols represented by 7 bit binary code.
• The first 32 ASCII characters are non-graphics used only for control
purposes
• The other characters been decimal, alphabets punctuation signs and other
commonly used symbols
• In Addition to the 128 standard ASCII characters, there are additional 128
characters that were adopted by IBM in their PCS
• Example: Determine the binary ASCII codes that are entered from the
computer’s Keyboard when the following BASIC program statement is
typed in, also express each code in Hexadecimal.
20 PRINT “A=”;X
• Solution: Practice Question:
Determine the binary
ASCII codes that is
required for the
following program
statement and express
them in hexadecimal