Lecture4 Chapter1 - Binary - Gray, and ASCII Codes
Lecture4 Chapter1 - Binary - Gray, and ASCII Codes
Lecture4 Chapter1 - Binary - Gray, and ASCII Codes
Numbers
Lecture4- Study Binary Codes and Binary Logic
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
EE-223 Digital Logic Design Spring 2024 SEECS 1
Objectives
• Study Binary , Gray Code, and ASCII Codes
• Perform Arithmetic operations in BCD using 10’s
Complement method
• Parity generation and checking
• Binary Logic
• 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-223 Digital Logic Design Spring 2024 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
0 0 1 0 1 0 1 1
Binary Cell
EE-223 Digital Logic Design Spring 2024 23
Register Transfer
• A register transfer operation involves the transfer of binary
information from one set of binary registers into other set of binary
registers.
• The capture and storage of information requires:
➢ An input register to store the key inputs from the keyboard
➢ A processor register to store the data when processed by the CPU
➢ A memory register in the memory unit to store the values