DLD CH#1B
DLD CH#1B
DLD CH#1B
A B A+B
0 0 0
0 1 1
1 0 1
1 1 10
“two”
Binary Addition (2 of 2)
• Two n-bit values
• Add individual bits
• Propagate carries
• E.g.,
1 1
10101 21
+ 11001 + 25
101110 46
Binary Subtraction
• Two 1-bit values
A B A-B
0 0 0
1 0 1
0 1 1 with a borrow
1 1 0 of 1 is equivalent
to 10 – 1 = 1
Ex. Binary Subtraction
Ex. 111 110.01
010 100.10
101 001.11
Eg.
8 - 1000 -----------------> 1000 +
10 1010 1’s complement 0101
2 1101 1’s complement -0010 result
2’s Complement
➔ 2’s complement results when we add ‘1’ to 1’s complement of the given
number i.e. 2’s complement =1’s complement + 1
A B AB
0 0 0
0 1 0
1 0 0
1 1 1
Multiplication
• Binary, two n-bit values
• As with decimal values
• E.g.,
1110
x 1011
1110
1110
0000
1110
10011010
Binary Division
Hexa-
Decimal Binary Octal decimal
29.8 11101.110011… 35.63… 1D.CC…
5.8125 101.1101 5.64 5.D
3.109375 11.000111 3.07 3.1C
12.5078125 1100.10000010 14.404 C.82
1.3 Binary Codes
Binary Coded Decimal(BCD)
Binary Coded Decimal(BCD) is a way to express each of the decimal
digits with a binary code.
In BCD each decimal digit , 0 through 9 is represented by a binary code
of four bits.
The designation of 8421 indicates the binary weights of the four bits
(23,22,21,20). The largest 4-bit code is 1001.
The numbers 1010, 1011, 1100, 1101,1110, and 1111 are called
forbidden(Invalid) numbers. The following table represents the
decimal and 8421 equivalent numbers.
Invalid Codes of BCD
In 8421(BCD) code only six code combinations that are not
used (Invalid codes) which are
1010,1011,1100,1101,1110,1111
But we can use the rest ten combinations.