0% found this document useful (0 votes)
44 views8 pages

09 DLD Lec 09 Binary Codes Dated 13 Apr 2022 Lecture Slides

Digital Logic Design Lecture No 09 discusses binary codes. It begins with assigning homework on arithmetic using two's complement addition. It then explains that [1] all computer symbols must be represented by a binary code, and [2] a binary code uses n bits to represent up to 2n combinations of 1s and 0s to symbolize each character. Finally, it introduces binary coded decimal (BCD) which represents each decimal digit with 4 bits, though multiple digits require more bits than the equivalent binary value. It also describes how to perform BCD addition.

Uploaded by

Abdullah Tahir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views8 pages

09 DLD Lec 09 Binary Codes Dated 13 Apr 2022 Lecture Slides

Digital Logic Design Lecture No 09 discusses binary codes. It begins with assigning homework on arithmetic using two's complement addition. It then explains that [1] all computer symbols must be represented by a binary code, and [2] a binary code uses n bits to represent up to 2n combinations of 1s and 0s to symbolize each character. Finally, it introduces binary coded decimal (BCD) which represents each decimal digit with 4 bits, though multiple digits require more bits than the equivalent binary value. It also describes how to perform BCD addition.

Uploaded by

Abdullah Tahir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Digital Logic Design

Lecture No 09 : Binary Codes


BESE-12AB
Spring 2022
Dated 13 April 2022

By Nasir Mahmood
[email protected]
[email protected]

Home Work ; Arithmetic (Signed 2’s Complement)

Add -100 and -56

2
Binary Codes
● All symbols in a computer must be represented by a
binary code (binary representation).

● An n-bit binary code is a group of n bits that can represent


up to 2n distinct combinations of 1’s and 0’s.
● Each distinct combination represents a single symbol in the computer.

BCD Code (8 4 2 1)

● The most common representation for


binary digits is the binary coded
decimal (BCD) form which is a binary
assignment of the decimal numbers.
● This code is the simplest, most intuitive
binary code for decimal digits and uses the
same weights as a binary number, but only
encodes the first ten values from 0 to 9 (6 out
of 16 possible combinations remains
unassigned ).
● A number with k distinct decimal digits will
require 4k bits in BCD.
● Each digit of a decimal value is converted to
its respective binary representation.
● BCD number needs more bits than its
equivalent binary value?

Multi-Digit BCD

5
BCD Addition
● BCD only represents each of the decimal digitals 0 through
9 as a single 4-bit binary value.
● When adding two BCD values, if the sum is equal to or less
than 1001 (9), the corresponding BCD value is correct.
● However, when the binary sum is greater or equal to 1010
(10), the result is an invalid BCD value.
● To overcome the invalid BCD value add 0110 (6) to the result to obtain the
BCD representation and also produces a carry as required.
● The use of 0110 (6) works because the difference between a carry in the
most significant bit position of the binary sum and a decimal carry differ
by 16-10 = 6.

BCD Addition Examples

7
The End

You might also like