parallel adders
TRANSCRIPT
![Page 1: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/1.jpg)
Digital Logic Design (DLD)
Lecture # 4
Prepared By
Tayyaba Altaf
![Page 2: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/2.jpg)
Binary Addition
![Page 3: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/3.jpg)
Rules
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 (10, carry of one to the next bit)
![Page 4: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/4.jpg)
Addition
• Take 4-bit values by adding 6 and 7.
• 1 1 carry
0110 6
0111 7 8 4 2 1
1101 13 1 1 0 1
![Page 5: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/5.jpg)
One Bit Adder
a b Cin Cout S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
![Page 6: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/6.jpg)
4-bit Full Adder
![Page 7: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/7.jpg)
Signed Number
• Every Number can have both positive +5 andnegative -5 number. In binary number systempositive number can easily expressed.
• Take 4-bit, Normally 0 as a last bit representpositive number (i.e. +5 = 0101)
• Make last bit 1 for negative number (i.e. -5=1101)
![Page 8: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/8.jpg)
Problem with Signed Number
With 3-bit magnitude, the range of numbersavailable would be from +7 to -7.
Most computers use a larger number of bits tostore numbers.
The major problem with signed magnitude iscomplexity of arithmetic.
![Page 9: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/9.jpg)
Examples
Consider following problems with signed numbers.
+5 -5
+3 -3
+8 - 8
-8 can not be represented in 4 bit signed number.
![Page 10: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/10.jpg)
2’s Complement
Signed binary numbers are nearly always storedin two’s complement format.
Leading bit is still the sign bit (0 for positive)
The largest number that can be stored is 2n-1 -1
(7 for n=4)
The negative number –a is stored as the binaryequivalent of 2n – a in an n-bit system. E.g. -3 isstored as the binary for 16-3 = 13, that is 1101.
![Page 11: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/11.jpg)
2’s Complement• Convert 4-bit positive number into negative by
using two’s complement method is follow
+5 0101
For negative number, convert all 1’s into 0’s and all 0’s into 1’s and add 1. above binary number will become.
1010
+ 1
1011 -5
![Page 12: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/12.jpg)
2’s Complement• Note that there is no negative zero; the process of
complementing +0 produces an answer 0000. Intwo’s complement addition, the carry out of themost significant bit is ignored.
• For Example: -0
0: 0000
1111
+ 1
0000
![Page 13: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/13.jpg)
2’s Complement
• For 4-bit numbers, that range is -8<=sum<=+7
• The reason that two’s complement is sopopular in the simplicity of addition.
![Page 14: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/14.jpg)
Singed and unsigned 4-bit numbers.
Binary Positive Signed (2’s comp)0000 0 0
0001 1 +1
0010 2 +2
0011 3 +3
0100 4 +4
0101 5 +5
0110 6 +6
0111 7 +7
1000 8 -8
1001 9 -7
1010 10 -6
1011 11 -5
1100 12 -4
1101 13 -3
1110 14 -2
1111 15 -1
![Page 15: Parallel adders](https://reader031.vdocuments.site/reader031/viewer/2022021922/5a65c8247f8b9aa4758b6d3b/html5/thumbnails/15.jpg)
Class Task
• Solve following operation.
i) 5-7
ii) 7- (-5)
iii) -5 +3