SlideShare a Scribd company logo
1 of 27
Digital Logic and Design
Lecture No 20 : Look Ahead Carry Generator, Binary Subtractors,
BCD Adder
Binary Adder
• A binary adder is a digital circuit that produces the
arithmetic sum of two binary numbers.
• A binary adder can be implemented using multiple full
adders (FA) connected in cascade with the output carry
from each full adder to the input carry of the next full adder
in the chain
2
Carry Propagation
• The number of gate levels for the carry propagation can be
found from the circuit of the full adder
• The input and output variables use the subscript i to denote
a typical stage in the adder
• The signals at Pi and Gi settle to their steady state values
after they propagate through their respective gates
3
Carry Propagation
• These two signals are common to all full adders and
depend only on the augend and addend bits
• The signal from the input carry Ci to the output carry Ci+1
propagates through an AND gate and an OR gate, which
constitutes two gate levels
• If there are four full adders in the adder, the output carry
C4 would have 2 x 4 = 8 gate levels from C0 to C4.
• For an n-bit adder, there are 2n gate levels for the carry
to propagate from input to output
• The outputs of a combinational circuit will not be correct
unless the signals are given enough time to propagate
through the gates connected from inputs to outputs
• All other arithematic operations are implemented by
successive additions, the time consumed during the
addition process is very critical.
4
Carry Propagation
• One choice to reduce the carry propagation delay is
to employ faster gates but the most widely used
technique for reducing the carry propagation time in
parallel adder is principle of carry lookahead
• Consider the circuit of full adder shown in fig 4-10
• If we define two binary variables
– carry propagate: Pi = AiBi (Term associated with the propagation of carry from Ci to Ci+1)
– carry generate: Gi = AiBi (Produces 1 when both Ai and Bi are 1)
• Output sum and carry can be expressed as
– sum: Si = PiCi
– carry: Ci+1 = Gi+PiCi
5
Carry Propagation
• We now write the Boolean functions for the carry
outputs of each stage and substitute for each Ci,
its value from the previous equation
– Co= input carry
– C1 = G0+P0C0
– C2 = G1+P1C1
– = G1+P1(G0+P0C0)
– = G1+P1G0+P1P0C0
– C3 = G2+P2C2
– = G2+P2G1+P2P1G0+ P2P1P0C0
– C4 = G3+P3C3
– =G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0
• Since the Boolean function for each output carry
is expressed in sum of products, each function
can be implemented with one level of AND gates
followed by an OR gate (or by two-level NAND )
6
Carry Lookahead Generator
• The three Boolean functions for C1, C2 and
C3 are implemented in the carry lookahead
generator shown in figure 4-11
• Here C3 doesn’t have to wait for C2 and C1
to propagate and C3 is propagated at the
same time as C1 and C2
7
Carry Lookahead Generator
8
Four Bit Adder with Look Ahead Carry Generator
9
4-Bit Adder with Carry Lookahead
• The construction of 4-bit adder with a carry
lookahead generator is shown in fig 4-12
• Each sum output requires two exclusive-OR gates.
• The output of first exclusive-OR gate generates the Pi
variable and the AND gate generates the Gi variable
• The carries are propagated through the carry
lookahead generator and applied as inputs to the
second exclusive-OR gate
• All outputs carries are generated after a delay
through two levels of gates
• Outputs S1 through S3 have equal propagation delay
times
10
–Binary Subtractor
–BCD Adder
Binary subtractor
• The subtraction of unsigned binary numbers can
be easily done by means of complements.(section
1-5)
• A-B = A+(2’s complement of B)
• The 2’s complement can be obtained by taking the
1’s complement and adding 1 to least significant
pair of bits
• To obtain 2’s complement, the 1’s complement can
be implemented with inverters and one can be
added to the sum through the input carry
Binary Subtractor
• The circuit for subtracting A – B consists of an adder
with inverters placed between each data input B and
the corresponding input of full adder
• The input carry C0 must be equal to 1 when performing
subtraction
• The operation thus performed becomes A, plus the 1’s
complement of B, plus 1 (A+1’s complement of B+1).
This is equal to A plus 2’s complement of B (A+2’s
complement of B)
• For unsigned numbers this gives A – B if A B or the
2’s complement of (B – A) if A<B
Binary subtractor
• The addition and subtraction operation can be
combined into one circuit with one common binary
adder
• This is done by including an exclusive-OR gate with
each full adder
• The mode input M controls the operation. When M=0,
we have B0= B. The full adder receives the value of B,
the input carry is 0 and the circuit performs A+B
• When M=1, we have B1= B’. The full adder receives
the value of B’, the input carry C0 is 1 and the circuit
performs A plus the 2’s complement of B. (A+1’s
complement of B+1).
• The exclusive-OR with output V is for detecting an
overflow (detail later, in overflow)
Binary subtractor
Overflow
• When two numbers of n digits are added and sum
occupies n+1 digits we say that an overflow occurred
• Overflow is problem in digital computers because the
number of bits that hold the number (limited storage) is
finite and a result that contains n+1 can’t be
accommodated.
• The detection of an overflow after the addition of two
binary numbers depends on whether the numbers are
considered to be signed or unsigned
• When two unsigned numbers are added an overflow is
detected from the end carry out of the most significant
position
• In the case of signed numbers, the leftmost bit always
represent the sign and negative numbers are in 2’s
complement form
Overflow
• When two signed numbers are added, the sign bit is
treated as part of the number and end carry doesn’t
indicate an overflow
• An overflow can’t occur after an addition if one number
is positive and the other is negative, since adding a
positive number to a negative number produces a
result which is smaller than the larger of the two
original numbers.
• An overflow may occur if the two numbers added are
both positive or both negative
• For n-bit registers, the range of numbers (signed
numbers) that each register can accommodate is from
binary 2n-1-1 to binary –2n-1.
Overflow
• For 8-bit registers, the range of numbers that each
register can accommodate is from binary +127 to binary –
128
• Consider two signed numbers +70 and +80 stored in two
8-bit registers. The sum of two numbers is +150 which
exceeds the capacity of eight bit register
Note: Negative
numbers are in
2’s complement
form
Overflow
• If we just consider the 8-bit result from the last
example, we go wrong as we
–Add two positive numbers and obtain a negative number
–Add two negative numbers and obtain a positive number
• The carry out of sign bit position is taken as the sign bit
of the result, then the 9-bit answer so obtained will be
correct. This answer can’t be accommodated within 8-
bits we say that an overflow has occurred
• An overflow has occurred if carry into the sign bit
position and carry out of the sign bit position are not
equal. This can be found by applying the two carries to
an exclusive-OR gate. 1 at the output of the gate
indicates overflow
–V=0, no overflow; V=1, overflow
Decimal Adder
• Computers or calculators that perform arithmetic
operation directly in the decimal number system
represents decimal number in binary coded form
• An adder for such a computer must employ
arithmetic circuits that accepts coded decimal
number and present results in the same code
• To add two BCD's, we require
–9 inputs: eight inputs for two BCDs and one carry-in. Since four bits are
required to code each decimal digit
–5 outputs: four outputs for one BCD and one carry-out
Decimal Adder
• Design Strategy?
To design a BCD adder we require a truth table with 2^9
entries (since 9 inputs). This may become too difficult to
work with so we device some easy alternative to design a
BCD adder. This is shown in table 4-5
Each digit doesn’t exceed 9 and so the output sum can’t
exceed, 9+9+1 = 19 (two BCD digits and input carry)
Suppose we apply two BCD digits to a 4-bit binary adder
The adder will form the sum in binary and produces a result
that ranges from 0 through 19
These binary numbers are listed in table 4-5 and are labeled
by symbols K, Z8, Z4, Z2 and Z1. (K is the output carry). But
the output sum must be represented in BCD (not binary)
and should appear in the form listed in the columns C, S8,
S4, S2 and S1 under BCD sum
The problem is to find a rule by which binary sum is
converted to corresponding BCD sum
Decimal Adder
The truth table
Correction for BCD Adder
From the table it is apparent that when binary sum is
equal to or less than 1001 (decimal 9), the
corresponding BCD number is identical and therefore
no correction is needed.
Modifications are needed if the sum is greater than
1001 as we get non-valid BCD representation. The
addition of binary 6 (0110) to binary sum converts it
to the correct BCD representation and also produces
an output carry as required (refer to section 1-7)
The logic circuit that detects the necessary
correction can be derived from the table entries.
Correction (adding decimal 6 or binary 0110) is
needed when the binary sum has an output

K = 1

Z8Z4 = 1

Z8Z2 = 1
Correction for BCD Adder
• This condition for correction and an output carry
can be expressed as
– C = K + Z8Z4 + Z8Z2
• In figure 4-14, the output carry generated from the
bottom adder can be ignored since this is already
available at the output carry terminal
• A decimal parallel adder that adds n decimal digits
(in BCD form) needs n BCD adder stages with
output carry from one stage connected to the
input carry of next higher-order stage
Block Diagram
Numbers that need correction (add 6) are:
K Z8 Z4 Z2 Z1
0 1 0 1 0 (10)
0 1 0 1 1 (11)
0 1 1 0 0 (12)
0 1 1 0 1 (13)
0 1 1 1 0 (14)
0 1 1 1 1 (15)
1 0 0 0 0 (16)
1 0 0 0 1 (17)
1 0 0 1 0 (18)
1 0 0 1 1 (19)
C = K + Z8Z4 +Z8Z2
End of Lecture

More Related Content

Similar to DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Adder.pptx

combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...RishabhSingh308993
 
Arithmetic Micro Operations.pptx
Arithmetic Micro Operations.pptxArithmetic Micro Operations.pptx
Arithmetic Micro Operations.pptxAshokRachapalli1
 
Arithmetic Microoperation.pdf
Arithmetic Microoperation.pdfArithmetic Microoperation.pdf
Arithmetic Microoperation.pdfHarshitJ4
 
combinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptcombinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptFilibertoMoralesGarc
 
combinational-circuit.ppt
combinational-circuit.pptcombinational-circuit.ppt
combinational-circuit.pptShivamRathod34
 
combinational circuits dispositivos .ppt
combinational circuits dispositivos .pptcombinational circuits dispositivos .ppt
combinational circuits dispositivos .pptFilibertoMoralesGarc
 
Unit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptx
Unit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptxUnit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptx
Unit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptxtusharkumarsinha1985
 
DPCO-Unit 2-Combinational Circuit.pdf
DPCO-Unit 2-Combinational Circuit.pdfDPCO-Unit 2-Combinational Circuit.pdf
DPCO-Unit 2-Combinational Circuit.pdfssuser08e250
 
Digital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptxDigital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptxThapar Institute
 
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsFYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsArti Parab Academics
 
Parallel Adder and Subtractor
Parallel Adder and SubtractorParallel Adder and Subtractor
Parallel Adder and SubtractorSmit Shah
 
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdfLecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdfUmerKhan147799
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
 
1d-HALF ADDER & FULL ADDER-PPT.pdf
1d-HALF ADDER & FULL ADDER-PPT.pdf1d-HALF ADDER & FULL ADDER-PPT.pdf
1d-HALF ADDER & FULL ADDER-PPT.pdfssusera0b94b
 

Similar to DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Adder.pptx (20)

Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
 
combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...
 
Arithmetic Micro Operations.pptx
Arithmetic Micro Operations.pptxArithmetic Micro Operations.pptx
Arithmetic Micro Operations.pptx
 
CSO PPT.pptx
CSO PPT.pptxCSO PPT.pptx
CSO PPT.pptx
 
Arithmetic Microoperation.pdf
Arithmetic Microoperation.pdfArithmetic Microoperation.pdf
Arithmetic Microoperation.pdf
 
combinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptcombinational-circuit presenmtation .ppt
combinational-circuit presenmtation .ppt
 
combinational-circuit.ppt
combinational-circuit.pptcombinational-circuit.ppt
combinational-circuit.ppt
 
combinational circuits dispositivos .ppt
combinational circuits dispositivos .pptcombinational circuits dispositivos .ppt
combinational circuits dispositivos .ppt
 
Unit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptx
Unit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptxUnit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptx
Unit 2 DLDUnit 2 DLDUnit 2 DLDUnit 2 DLD.pptx
 
DPCO-Unit 2-Combinational Circuit.pdf
DPCO-Unit 2-Combinational Circuit.pdfDPCO-Unit 2-Combinational Circuit.pdf
DPCO-Unit 2-Combinational Circuit.pdf
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Lect 1 unit 2.pdf
Lect 1 unit 2.pdfLect 1 unit 2.pdf
Lect 1 unit 2.pdf
 
Digital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptxDigital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptx
 
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsFYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
 
Parallel Adder and Subtractor
Parallel Adder and SubtractorParallel Adder and Subtractor
Parallel Adder and Subtractor
 
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdfLecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
Binary parallel adder
Binary parallel adderBinary parallel adder
Binary parallel adder
 
DLD Chapter-4.pdf
DLD Chapter-4.pdfDLD Chapter-4.pdf
DLD Chapter-4.pdf
 
1d-HALF ADDER & FULL ADDER-PPT.pdf
1d-HALF ADDER & FULL ADDER-PPT.pdf1d-HALF ADDER & FULL ADDER-PPT.pdf
1d-HALF ADDER & FULL ADDER-PPT.pdf
 

More from SaveraAyub2

DLD Lecture No 22 Decoder Circuit and Types of Decoder.pptx
DLD Lecture No 22 Decoder Circuit and Types of Decoder.pptxDLD Lecture No 22 Decoder Circuit and Types of Decoder.pptx
DLD Lecture No 22 Decoder Circuit and Types of Decoder.pptxSaveraAyub2
 
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptxDLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptxSaveraAyub2
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxSaveraAyub2
 
DLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptx
DLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptxDLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptx
DLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptxSaveraAyub2
 
DLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptx
DLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptxDLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptx
DLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptxSaveraAyub2
 

More from SaveraAyub2 (6)

DLD Lecture No 22 Decoder Circuit and Types of Decoder.pptx
DLD Lecture No 22 Decoder Circuit and Types of Decoder.pptxDLD Lecture No 22 Decoder Circuit and Types of Decoder.pptx
DLD Lecture No 22 Decoder Circuit and Types of Decoder.pptx
 
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptxDLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptx
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
 
DLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptx
DLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptxDLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptx
DLD Lecture No 16 Don't `Care Conditions, Nand gate Implementation.pptx
 
DLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptx
DLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptxDLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptx
DLD Lecture No 15 Prime and Essential Implicants, Five Variable Map.pptx
 
presentation
presentationpresentation
presentation
 

Recently uploaded

PRESENTATION.on wooden comb idea innovation project
PRESENTATION.on wooden comb idea innovation projectPRESENTATION.on wooden comb idea innovation project
PRESENTATION.on wooden comb idea innovation projectjain99591
 
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...Sareena Khatun
 
Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Erotic Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...
Erotic  Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...Erotic  Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...
Erotic Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...vershagrag
 
Call Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and NumberCall Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and NumberSareena Khatun
 
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...Sareena Khatun
 
原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量
原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量
原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量funaxa
 
PRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTERPRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTERPRESTAIR SYSTEMS LLP
 
一比一原版查尔斯特大学毕业证如何办理
一比一原版查尔斯特大学毕业证如何办理一比一原版查尔斯特大学毕业证如何办理
一比一原版查尔斯特大学毕业证如何办理hwoudye
 
The Role of Hotel Prasanth in Thiruvananthapuram Tourism Development
The Role of Hotel Prasanth in Thiruvananthapuram Tourism DevelopmentThe Role of Hotel Prasanth in Thiruvananthapuram Tourism Development
The Role of Hotel Prasanth in Thiruvananthapuram Tourism Developmentassistantmarketing28
 
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...Sareena Khatun
 
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...HyderabadDolls
 
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...Sareena Khatun
 
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...kumargunjan9515
 
Balanced Diet, Modified Diet, RDA and Menu Planning.pptx
Balanced Diet, Modified Diet, RDA and Menu Planning.pptxBalanced Diet, Modified Diet, RDA and Menu Planning.pptx
Balanced Diet, Modified Diet, RDA and Menu Planning.pptxDr. Trisha Manna
 
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...gragfaguni
 
Call Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budgetSareena Khatun
 
Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...
Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...
Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...HyderabadDolls
 
Nalasopara Call Girls , 07506202331, Vasai Vip Housewife Call Girls
Nalasopara Call Girls , 07506202331, Vasai Vip Housewife Call GirlsNalasopara Call Girls , 07506202331, Vasai Vip Housewife Call Girls
Nalasopara Call Girls , 07506202331, Vasai Vip Housewife Call GirlsPriya Reddy
 

Recently uploaded (20)

PRESENTATION.on wooden comb idea innovation project
PRESENTATION.on wooden comb idea innovation projectPRESENTATION.on wooden comb idea innovation project
PRESENTATION.on wooden comb idea innovation project
 
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...Foreigner Call Girls in junagadh  8250092165 Call Girls Advance Cash On Deliv...
Foreigner Call Girls in junagadh 8250092165 Call Girls Advance Cash On Deliv...
 
Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Kharagpur [ 7014168258 ] Call Me For Genuine Models...
 
Erotic Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...
Erotic  Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...Erotic  Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...
Erotic Vadodara Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call Gir...
 
Call Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and NumberCall Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and Number
Call Girls in Rajkot / 8250092165 Genuine Call girls with real Photos and Number
 
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
Call Girls in Anand - 8250092165 Our call girls are sure to provide you with ...
 
原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量
原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量
原版1:1定制(IC大学毕业证)帝国理工学院大学毕业证国外文凭复刻成绩单#电子版制作#留信入库#多年经营绝对保证质量
 
PRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTERPRESTAIR MANUFACTURER OF DISPLAY COUNTER
PRESTAIR MANUFACTURER OF DISPLAY COUNTER
 
一比一原版查尔斯特大学毕业证如何办理
一比一原版查尔斯特大学毕业证如何办理一比一原版查尔斯特大学毕业证如何办理
一比一原版查尔斯特大学毕业证如何办理
 
The Role of Hotel Prasanth in Thiruvananthapuram Tourism Development
The Role of Hotel Prasanth in Thiruvananthapuram Tourism DevelopmentThe Role of Hotel Prasanth in Thiruvananthapuram Tourism Development
The Role of Hotel Prasanth in Thiruvananthapuram Tourism Development
 
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...High Profile Call Girls Service in Sangli  9332606886 HOT & SEXY Models beaut...
High Profile Call Girls Service in Sangli 9332606886 HOT & SEXY Models beaut...
 
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
Charbagh \ Book Call Girls in Lucknow Finest Escorts Service 9548273370 Avail...
 
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
Call Girls Bhavnagar - 8250092165 Our call girls are sure to provide you with...
 
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
Call girls Service Nacharam - 8250092165 Our call girls are sure to provide y...
 
Balanced Diet, Modified Diet, RDA and Menu Planning.pptx
Balanced Diet, Modified Diet, RDA and Menu Planning.pptxBalanced Diet, Modified Diet, RDA and Menu Planning.pptx
Balanced Diet, Modified Diet, RDA and Menu Planning.pptx
 
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
Only Cash On Delivery Call Girls Service In Visakhapatnam Call Girls (Adult O...
 
Call Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Pune ( 8250092165 ) Cheap rates call girls | Get low budget
 
Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Chhapra [ 7014168258 ] Call Me For Genuine Models W...
 
Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...
Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...
Rajpur ) Virgin Call Girls Kolkata Neha 8005736733 | 100% Gennuine High Class...
 
Nalasopara Call Girls , 07506202331, Vasai Vip Housewife Call Girls
Nalasopara Call Girls , 07506202331, Vasai Vip Housewife Call GirlsNalasopara Call Girls , 07506202331, Vasai Vip Housewife Call Girls
Nalasopara Call Girls , 07506202331, Vasai Vip Housewife Call Girls
 

DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Adder.pptx

  • 1. Digital Logic and Design Lecture No 20 : Look Ahead Carry Generator, Binary Subtractors, BCD Adder
  • 2. Binary Adder • A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers. • A binary adder can be implemented using multiple full adders (FA) connected in cascade with the output carry from each full adder to the input carry of the next full adder in the chain 2
  • 3. Carry Propagation • The number of gate levels for the carry propagation can be found from the circuit of the full adder • The input and output variables use the subscript i to denote a typical stage in the adder • The signals at Pi and Gi settle to their steady state values after they propagate through their respective gates 3
  • 4. Carry Propagation • These two signals are common to all full adders and depend only on the augend and addend bits • The signal from the input carry Ci to the output carry Ci+1 propagates through an AND gate and an OR gate, which constitutes two gate levels • If there are four full adders in the adder, the output carry C4 would have 2 x 4 = 8 gate levels from C0 to C4. • For an n-bit adder, there are 2n gate levels for the carry to propagate from input to output • The outputs of a combinational circuit will not be correct unless the signals are given enough time to propagate through the gates connected from inputs to outputs • All other arithematic operations are implemented by successive additions, the time consumed during the addition process is very critical. 4
  • 5. Carry Propagation • One choice to reduce the carry propagation delay is to employ faster gates but the most widely used technique for reducing the carry propagation time in parallel adder is principle of carry lookahead • Consider the circuit of full adder shown in fig 4-10 • If we define two binary variables – carry propagate: Pi = AiBi (Term associated with the propagation of carry from Ci to Ci+1) – carry generate: Gi = AiBi (Produces 1 when both Ai and Bi are 1) • Output sum and carry can be expressed as – sum: Si = PiCi – carry: Ci+1 = Gi+PiCi 5
  • 6. Carry Propagation • We now write the Boolean functions for the carry outputs of each stage and substitute for each Ci, its value from the previous equation – Co= input carry – C1 = G0+P0C0 – C2 = G1+P1C1 – = G1+P1(G0+P0C0) – = G1+P1G0+P1P0C0 – C3 = G2+P2C2 – = G2+P2G1+P2P1G0+ P2P1P0C0 – C4 = G3+P3C3 – =G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0 • Since the Boolean function for each output carry is expressed in sum of products, each function can be implemented with one level of AND gates followed by an OR gate (or by two-level NAND ) 6
  • 7. Carry Lookahead Generator • The three Boolean functions for C1, C2 and C3 are implemented in the carry lookahead generator shown in figure 4-11 • Here C3 doesn’t have to wait for C2 and C1 to propagate and C3 is propagated at the same time as C1 and C2 7
  • 9. Four Bit Adder with Look Ahead Carry Generator 9
  • 10. 4-Bit Adder with Carry Lookahead • The construction of 4-bit adder with a carry lookahead generator is shown in fig 4-12 • Each sum output requires two exclusive-OR gates. • The output of first exclusive-OR gate generates the Pi variable and the AND gate generates the Gi variable • The carries are propagated through the carry lookahead generator and applied as inputs to the second exclusive-OR gate • All outputs carries are generated after a delay through two levels of gates • Outputs S1 through S3 have equal propagation delay times 10
  • 12. Binary subtractor • The subtraction of unsigned binary numbers can be easily done by means of complements.(section 1-5) • A-B = A+(2’s complement of B) • The 2’s complement can be obtained by taking the 1’s complement and adding 1 to least significant pair of bits • To obtain 2’s complement, the 1’s complement can be implemented with inverters and one can be added to the sum through the input carry
  • 13. Binary Subtractor • The circuit for subtracting A – B consists of an adder with inverters placed between each data input B and the corresponding input of full adder • The input carry C0 must be equal to 1 when performing subtraction • The operation thus performed becomes A, plus the 1’s complement of B, plus 1 (A+1’s complement of B+1). This is equal to A plus 2’s complement of B (A+2’s complement of B) • For unsigned numbers this gives A – B if A B or the 2’s complement of (B – A) if A<B
  • 14. Binary subtractor • The addition and subtraction operation can be combined into one circuit with one common binary adder • This is done by including an exclusive-OR gate with each full adder • The mode input M controls the operation. When M=0, we have B0= B. The full adder receives the value of B, the input carry is 0 and the circuit performs A+B • When M=1, we have B1= B’. The full adder receives the value of B’, the input carry C0 is 1 and the circuit performs A plus the 2’s complement of B. (A+1’s complement of B+1). • The exclusive-OR with output V is for detecting an overflow (detail later, in overflow)
  • 16. Overflow • When two numbers of n digits are added and sum occupies n+1 digits we say that an overflow occurred • Overflow is problem in digital computers because the number of bits that hold the number (limited storage) is finite and a result that contains n+1 can’t be accommodated. • The detection of an overflow after the addition of two binary numbers depends on whether the numbers are considered to be signed or unsigned • When two unsigned numbers are added an overflow is detected from the end carry out of the most significant position • In the case of signed numbers, the leftmost bit always represent the sign and negative numbers are in 2’s complement form
  • 17. Overflow • When two signed numbers are added, the sign bit is treated as part of the number and end carry doesn’t indicate an overflow • An overflow can’t occur after an addition if one number is positive and the other is negative, since adding a positive number to a negative number produces a result which is smaller than the larger of the two original numbers. • An overflow may occur if the two numbers added are both positive or both negative • For n-bit registers, the range of numbers (signed numbers) that each register can accommodate is from binary 2n-1-1 to binary –2n-1.
  • 18. Overflow • For 8-bit registers, the range of numbers that each register can accommodate is from binary +127 to binary – 128 • Consider two signed numbers +70 and +80 stored in two 8-bit registers. The sum of two numbers is +150 which exceeds the capacity of eight bit register Note: Negative numbers are in 2’s complement form
  • 19. Overflow • If we just consider the 8-bit result from the last example, we go wrong as we –Add two positive numbers and obtain a negative number –Add two negative numbers and obtain a positive number • The carry out of sign bit position is taken as the sign bit of the result, then the 9-bit answer so obtained will be correct. This answer can’t be accommodated within 8- bits we say that an overflow has occurred • An overflow has occurred if carry into the sign bit position and carry out of the sign bit position are not equal. This can be found by applying the two carries to an exclusive-OR gate. 1 at the output of the gate indicates overflow –V=0, no overflow; V=1, overflow
  • 20. Decimal Adder • Computers or calculators that perform arithmetic operation directly in the decimal number system represents decimal number in binary coded form • An adder for such a computer must employ arithmetic circuits that accepts coded decimal number and present results in the same code • To add two BCD's, we require –9 inputs: eight inputs for two BCDs and one carry-in. Since four bits are required to code each decimal digit –5 outputs: four outputs for one BCD and one carry-out
  • 22. To design a BCD adder we require a truth table with 2^9 entries (since 9 inputs). This may become too difficult to work with so we device some easy alternative to design a BCD adder. This is shown in table 4-5 Each digit doesn’t exceed 9 and so the output sum can’t exceed, 9+9+1 = 19 (two BCD digits and input carry) Suppose we apply two BCD digits to a 4-bit binary adder The adder will form the sum in binary and produces a result that ranges from 0 through 19 These binary numbers are listed in table 4-5 and are labeled by symbols K, Z8, Z4, Z2 and Z1. (K is the output carry). But the output sum must be represented in BCD (not binary) and should appear in the form listed in the columns C, S8, S4, S2 and S1 under BCD sum The problem is to find a rule by which binary sum is converted to corresponding BCD sum Decimal Adder
  • 24. Correction for BCD Adder From the table it is apparent that when binary sum is equal to or less than 1001 (decimal 9), the corresponding BCD number is identical and therefore no correction is needed. Modifications are needed if the sum is greater than 1001 as we get non-valid BCD representation. The addition of binary 6 (0110) to binary sum converts it to the correct BCD representation and also produces an output carry as required (refer to section 1-7) The logic circuit that detects the necessary correction can be derived from the table entries. Correction (adding decimal 6 or binary 0110) is needed when the binary sum has an output  K = 1  Z8Z4 = 1  Z8Z2 = 1
  • 25. Correction for BCD Adder • This condition for correction and an output carry can be expressed as – C = K + Z8Z4 + Z8Z2 • In figure 4-14, the output carry generated from the bottom adder can be ignored since this is already available at the output carry terminal • A decimal parallel adder that adds n decimal digits (in BCD form) needs n BCD adder stages with output carry from one stage connected to the input carry of next higher-order stage
  • 26. Block Diagram Numbers that need correction (add 6) are: K Z8 Z4 Z2 Z1 0 1 0 1 0 (10) 0 1 0 1 1 (11) 0 1 1 0 0 (12) 0 1 1 0 1 (13) 0 1 1 1 0 (14) 0 1 1 1 1 (15) 1 0 0 0 0 (16) 1 0 0 0 1 (17) 1 0 0 1 0 (18) 1 0 0 1 1 (19) C = K + Z8Z4 +Z8Z2