Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits 4-1,2: Iterative Combinational Circuits and Binary Adders.

Similar presentations


Presentation on theme: "1 CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits 4-1,2: Iterative Combinational Circuits and Binary Adders."— Presentation transcript:

1 1 CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits 4-1,2: Iterative Combinational Circuits and Binary Adders

2 CS 151 2 Overview Iterative combinational circuits Binary adders  Half and full adders  Ripple carry adder Binary subtraction Binary adder-subtractors  Signed binary numbers  Signed binary addition and subtraction  Overflow Binary multiplication Other arithmetic functions  Design by contraction

3 CS 151 3 Arithmetic Circuits Arithmetic Circuits: Arithmetic Circuits: Combinational circuits that perform arithmetic operations such as  Addition  Multiplication  Subtraction  Division Using binary numbers or decimal numbers in binary code. Develop using hierarchical design; design a circuit that processes 2 bits (e.g. 2-bit addition), and use it as a building block for a circuit that processes n bits.

4 CS 151 4 Functional Blocks: Addition Binary addition used frequently Addition Development:  Half-Adder (HA), a 2-input bit-wise addition functional block,  Full-Adder (FA), a 3-input bit-wise addition functional block,  Ripple Carry Adder, parallel binary adder to perform n-bit binary addition.

5 CS 151 5 Functional Block: Half-Adder A 2-input, 1-bit width binary adder that performs the following computations: I. Specifications:  2 Inputs: Augend X and Addend Y.  2 Outputs: Sum bit S and Carry bit C. II. Truth Table:  X 0 0 1 1 + Y + 0 + 1 + 0 + 1 C S 0 0 1 1 0 X Y C S 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 III. Equations:  S = X Y’ + X’ Y = X  Y  C = X Y

6 CS 151 6 Implementations: Half-Adder IV. Logic Diagram: YXC YXS   X Y C S

7 CS 151 7 Functional Block: Full-Adder A full adder is similar to a half adder, but includes a carry-in bit from lower stages. Like the half-adder, it computes a sum bit, S and a carry bit, C.  For a carry-in (Z) of 0, it is the same as the half-adder:  For a carry- in (Z) of 1: Z0000 X0011 + Y+ 0+ 1+ 0+ 1 C S000 1 1 0 Z1111 X0011 + Y+ 0+ 1+ 0+ 1 C S0 11 0 11

8 CS 151 8 Logic Optimization: Full-Adder I. Specifications:  3 Inputs: X, Y and Z (carry in)  2 Outputs: Sum S and Carry C II. Full-Adder Truth Table: XYZCS 00000 00101 01001 01110 10001 10110 11010 11111 X Y Z 0132 4576 1 1 1 1 S X Y Z 0132 4576 111 1 C III. Optimization: Full-Adder K-Map: S = ∑(1,2,4,7) C = ∑(3,5,6,7)

9 CS 151 9 Equations: Full-Adder From the K-Map, we get: The S function is the three-bit XOR function (Odd Function): The Carry bit C is 1 if both X and Y are 1 (the sum is 2), or if the sum is 1 and a carry-in (Z) occurs. Thus C can be re-written as: The term X·Y is carry generate. The term X  Y is carry propagate. ZYZXYXC ZYXZYXZYXZYXS   ZYXS  Z)YX(YXC 

10 CS 151 10 Implementation: Full Adder ZYXS  Z)YX(YXC 

11 CS 151 11 Iterative Combinational Circuits Arithmetic functions  Operate on binary vectors  Use the same subfunction in each bit position Can design functional block for subfunction and repeat to obtain functional block for overall function Cell - subfunction block Iterative array - a array of interconnected cells An iterative array can be in a single dimension (1D) or multiple dimensions

12 CS 151 12 Block Diagram of a 1D Iterative Array Example: n = 32  Number of inputs = ?  Truth table rows = ?  Equations with up to ? input variables  Equations with huge number of terms  Design impractical! Iterative array takes advantage of the regularity to make design feasible

13 CS 151 13 Binary Adders To add multiple-bit operands, we “bundle” logical signals together into vectors and use functional blocks that operate on the vectors Example: 4-bit ripple carry adder: Adds input vectors A(3:0) and B(3:0) to get a sum vector S(3:0) Note: carry out of cell i becomes carry in of cell i + 1

14 CS 151 14 4-bit Ripple-Carry Binary Adder A four-bit Ripple Carry Adder made from four 1-bit Full Adders (FA) connected in cascade. Ripple Carry…A carry 1 may propagate through many FAs to the most significant bit just as a wave ripples outward…


Download ppt "1 CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits 4-1,2: Iterative Combinational Circuits and Binary Adders."

Similar presentations


Ads by Google