Professional Documents
Culture Documents
DLD - Lec 4
DLD - Lec 4
DLD - Lec 4
• Specific functions
– Adders, subtractors, comparators, decoders, encoders, and multiplexers
– MSI circuits or standard cells
= (AB+AC+BC)'(A+B+C)+ABC
= (A'+B')(A'+C')(B'+C')(A+B+C)+ABC
= (A'+B'C')(AB'+AC'+BC'+B'C)+ABC
= A'BC'+A'B'C+AB'C'+ABC
• S = x'y+xy'=xy=(x+y)(x'+y')
• C = xy= (x'+y')'
• S' = xy+x'y'
• S = (C+x'y')'
• Thus, it is possible to have five 4-bit carry lookahead generator circuit to speed up 16-bit addition
(see next slide).
G0-15 P0-15
April 24, 2017 Department of Computer Science, UET Taxila 37
4-Bit Adder/Subtractor
• A-B = A+(2’s complement of B)
• 4-bit adder-subtractor
– M=0, A+B; M=1, A+B’+1
• When two signed numbers are added, the sign bit is treated as part of the
number and the end carry does not indicate an overflow.
• An overflow can't occur after an addition if one number is positive and the other is
negative.
• An overflow may occur if the two numbers added are both positive or both
negative.
• modification: +6
April 24, 2017 Department of Computer Science, UET Taxila 42
Truth Table of BCD Adder
• K=4 and J=3, we need 12 AND gates and two 4-bit adders.
xi=AiBi+Ai’Bi’ for i = 0, 1, 2, 3
(A = B) = x3x2x1x0
• We inspect the relative magnitudes of pairs of MSB. If equal, we compare the next lower significant pair
of digits until a pair of unequal digits is reached.
x=D4+D5+D6+D7
y=D2+D3+D6+D7
z=D1+D3+D5+D7
• x = D2 + D 3
• y = D3 + D1D’2
• V = D 0 + D1 + D2 + D3
• The target output of procedural assignment statements must be of the reg data type.
Contrary to the wire data type, where the target output of an assignment may be
continuously updated, a reg data type retains its value until a new value is assigned.