Lecture5 Chapter1 - Binary Codes
Lecture5 Chapter1 - Binary Codes
Numbers
Lecture5- Study Binary Codes
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
EE-221 Digital Logic Design Fall 2023 SEECS 1
Objectives
• Study Binary Codes
• Perform Arithmetic operations in BCD using 10’s
Complement method
• Note: To obtain 10’s complement of a BCD number, we first take the 9’s
complement (by subtraction of each digit from 9) and then add one to
least significant digit
Perform subtraction (-257) - (+160) both signed and unsigned?
EE-221 Digital Logic Design Fall 2023 8
Other Decimal Codes
• There are various other decimal codes that can be used:
➢ BCD (8, 4, 2, 1)
➢ 2, 4, 2, 1
➢ Excess-3 code. (adds binary 0011 to the BCD code)
➢ 8, 4, -2, -1
➢ Gray Code
➢ ASCII Character Code
➢ Error-Detecting Code
• Each bit has a "weight" associated with it and you can compute the
decimal value by adding the weights where a 1 exists in the code-
word.
➢ For example, the conversion of binary number 10110 to Gray Code is as follows
➢ For example, the conversion of Gray number 11011 to Binary code is as follows
Excess-3
0111
0101
0100
1100
1101