Top Banner
Combinational Circuits by Dr. Amin Danial Asham
22

Combinational Circuits by Dr. Amin Danial Asham. References Digital Design 5 th Edition, Morris Mano.

Jan 14, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

Combinational Circuits

byDr. Amin Danial Asham

Page 2: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

References

Digital Design 5th Edition, Morris Mano

Page 3: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)II. Adder (continue)

b) Binary adder • The binary adder is a digital combinational circuit that perform arithmetic summation

for two binary numbers.

• A binary adder can be implemented using cascaded full adders with the output carry of a full adder is connected to the input carry of the next full adder.

• A four bit binary ripple adder can be constructed from 4 full adders as shown.

• The bits of binary number A and binary number B are designated by subscript numbers starting from right to left with the subscript 0 for the least significant bit.

• Carries are connected in a chain through the adders. The input C0 propagate through the adders to the output carry C4

Page 4: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)II. Adder (continue)

b) Binary adder (continue)

• As in any combinational circuit the signal must propagate through the gates before the correct output is available in the output terminals.

• The total propagation time is equal to the propagation delay of a typical gate, times the number of gate levels in the circuit.

• The longest propagation delay time in an adder is the time it takes the carry to propagate through the full adders. For example:

• Inputs A3 and B3 are available as soon as input signals are applied to the adder.

• However, input carry C3 does not settle to its find value until C2 is available from the previous stage. Similarly, C2 has to wait for C1 and so on down to C0.

• Thus, only after the carry propagates and ripples through all stages will the last output S3 and carry C4 settle to their final correct value.

Page 5: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)II. Adder (continue)

b) Binary adder (continue)• Form the following full adder circuit diagram we find:

• The signals and settle to their steady state values after their propagation through their respective gates. These two signals depend only on the input signals and which may be applied to all stages simultaneously.

• The signal from the input to the output signal propagate through an AND and an OR gates, which constitute two gate levels.

• Therefore, if there is 4 full adder stages the output carry would have gate levels from to .

• Similarly, for n-bit adder the carry signal propagates through 2n gate levels. • The carry propagation delay is very important since it limits the speed of an adder.

Page 6: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)II. Adder (continue)

b) Binary adder (continue)

Therefore,

• In the same way can be driven. • As shown, the Boolean functions of the carries are sum of products which can be implemented by only two level gates in parallel for all carries and hence does not have to wait for the previous carries. This circuit is called Carry Lookahead Generator.

𝐺𝑖=𝐴𝑖𝐵𝑖𝐶𝑖+1=𝑃 𝑖𝐶𝑖+𝐺𝑖

Page 7: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)II. Adder (continue)

b) Binary adder (continue)

Page 8: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)II. Adder (continue)

b) Binary adder (continue)

•From The construction of a four-bit adder with a carry lookahead generator we find that :

•Each sum output requires two exclusive-OR gates. •The output of the first exclusive-OR gate generates the variable, and the AND gate generates the variable. The carries are propagated through the carry lookahead generator and applied as inputs to the second exclusive-OR gate. •All output carries are generated after a delay through two levels of gates. Thus, outputs ’s have equal propagation delay times.

Page 9: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)III. Binary Adder -Subtractor To calculate the subtraction A-B, the 2’s complement of B is added to A. The 2’s complement of B can be obtained from the 1’s complement of B adding 1. Noting that the 1’s complement of binary digit . Therefore the subtractor can be built using binary adder as shown in the following figure,

where to get the 1’s complement of B and convert it to 2’s complement by adding input carry .

In case of , the circuit acts as normal binary adder.

4-bit Adder-Subtractor

Page 10: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)III. Binary Adder –Subtractor (continue)•Overflow occurs in two n-bits numbers are added and the result needs n+1 bits.•This case occurs if two positive or two negative numbers are added. Whereas no overflow occur if positive number is added to negative number since the result is smaller in magnitude than the larger of the original numbers.

•In the next example adding two positive or negative 8-bits numbers where the 8th bit is the sign, the sum is 9-bits number where the 9th bit is the correct sign bit.

•From the former example an overflow is detected by checking the carry into the sign bit and carry out from the sign bit, if they are not equal then there is an overflow.

•This method of detection is valid in case of 2’complement.

Page 11: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)III. Binary Adder –Subtractor (continue)

• Therefore, in case of unsigned in the adder-subtractor circuit, if the added numbers are considered unsigned C is the carry out after addition operation or the borrow after subtraction.

• In case of signed numbers the V detects the overflow, If V=0 no overflow occurred and the n-bit result is correct. If V=1, an overflow has occurred and the operations needs n+1 bit and only the right

most n bits are available. And the (n+1)th bit is the actual sign and shifted out of position.

Page 12: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)IV. BCD Adder

•A decimal adder performs the arithmetic summation on decimal numbers in the Binary Coded Decimal (BCD) form. •A decimal adder for BCD receives the two numbers in BCD and calculate the sum in the BCD form. This adder is called BCD Adder•For adding two decimal digits the adder receives 9 bits; 4 bits for each input BCD and 1 bit for carry in, and produces 5 bits where 4 bits for the output BCD and 1 bit for carry out. •Since each BCD digit ranges from 0 to 9, therefore the maximum output is 9+9+1=19, where 1 is for carry in. •To design the decimal adder, the truth table must first be listed and then the relations between inputs and outputs can be deduced .

Page 13: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)IV. BCD Adder (continue)

•The summation will be first performed as normal binary operation and after that converted in to BCD form.

•The binary sum is listed in the left part of the table and the output bits are labeled ,, , and . K is the carry out. The subscript is indicating the weights of the bits.

Page 14: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)IV. BCD Adder (continue)

•The BCD sum is listed in the right part of the table and the output bits are labeled ,, , and . C is the carry out. The subscript is indicating the weights of the bits.

•From the table the binary sum is identical to the BCD sum where the sum is less then or equal to 10012.

Page 15: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3.DESIGN PROCEDURE (continue)IV.BCD Adder (continue)

• For the values grater than 10012 the addition of 6(01102) converts to BCD and produces the carry as required.

Page 16: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)

IV. BCD Adder (continue)

•It is clear from the table the correction is needed if , and , or and . As shown in the right part of the table all the values that need corrections have a carry out .

•Therefore, . This carry out signal is used to convert the binary sum to BCD sum by adding 6(01102) to the binary sum.

Page 17: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)

IV. BCD Adder(continue)

•The upper binary adder produces the binary sum.

•The lower binary adder receives the binary sum and adds 01102 if the output carry C=1 to produce BCD sum.

•The carry of the lower adder can be ignored since the output carry is already calculated C .

•A decimal parallel adder that adds n BCD digits needs n BCD adder stages.

0110

C

Page 18: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)V. Binary Multiplier

Multiplication of two binary numbers is performed in a similar way as decimal multiplications.

For two 2-bits numbers A () and B (). A has two b and B has two bits The product is C, which has four bits , , , and The arithmetic multiplication is performed as follows:

Therefore the logic circuit that can perform this function is: As shown it is needed 4 AND gates to perform this

function and two HA.

Page 19: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)V. Binary Multiplier (Continue) Therefore, to build a multiplier that multiplies 4-bits number by 3-bits number , we need

12-AND gates as shown:

To construct a multiplier that multiplies

J -bits multiplier by K -bits multiplicand we

need AND gates and () k-bits

adders to produce a product () bits.

𝐵3𝐵2𝐵1𝐵0𝐴2𝐴1 𝐴0

𝐴0𝐵3𝐴0𝐵2 𝐴0𝐵1 𝐴0𝐵0

𝐴1𝐵3 𝐴1𝐵2 𝐴1𝐵1 𝐴1𝐵0

𝐴2𝐵3𝐴2𝐵2𝐴2𝐵1𝐴2𝐵0

𝐶0𝐶1𝐶2𝐶3𝐶4𝐶5𝐶6

0

𝐶𝑜𝑢𝑡𝑆3𝑆2𝑆1𝑆0

𝑆0𝑆1𝑆2𝑆3𝐶𝑜𝑢𝑡

Multiplier

Multiplicand

Page 20: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)V. Magnitude Comparator

Magnitude comparator is used to compare between to numbers to decide of they are equal or not and if not which one is greater.

To build a truth table for comparing two n-bits numbers we need to get entries which is a huge quantity of entries.

Therefore, a direct application of the procedure a person uses to compare the relative magnitude of two numbers is adopted here.

For comparing two 4-bits numbers and , we first check if the corresponding bits in each numbers are equal, which leads to . In other words to check if , , … so on

Therefore to check if in A is equal to in B X-NOR function can be used to produce 1 in case of equality for . Hence , which gives 1 in case of equality.

Then to check if we start by checking the most significant pair of bits if they are not equal and is 1 then . If this pair of bits are equal then we check the next lower pair . The comparison continues until a pair of unequal digits is reached.

Therefore: In the same way:

Page 21: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

3. DESIGN PROCEDURE (continue)V. Magnitude Comparator (continue)

Page 22: Combinational Circuits by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano.

Thanks