5
1 ECE 274 - Digital Logic Lecture 9 Lecture 9 - Adders Half-adders Full-adders Carry-ripple Adder 2 Digital Design Datapath Components: Adders: 2-bit adder Functional Requirements: Design a circuit that will add two 2-bit binary numbers Input: A1A0, B1B0 Output: S1S0: sum of inputs C: carry bit 3 Digital Design Datapath Components: Adders: 2-bit Adder: Truth Table 4 Digital Design Datapath Components: Adders: 16-bit Adder: Truth Table …. …. 0000000000000000 000000000000000000000000000000 s15s14s13s12s11s10s9s8s7s6s5s4s3s2s1s0 c a15a14a13a12a11a10a9a8a7a6a5a4a3a2a1a0b15b14b13b12b11b10b9b8b7b6b5b4b3b2b1b0 16-bit Adder: 16-bits * 2-operands = 32 inputs Over 4,000,000,000 rows 5 Digital Design Datapath Components: Adders: Exponential Growth Exponential Growth for Two-Level Adder Implementation 6 Digital Design Datapath Components: Adders: Carry-Ripple Functional Requirements: Design a circuit that will add two bits Input: A, B Output: S: sum of inputs C: carry bit

Lecture 9

Embed Size (px)

DESCRIPTION

hvhjv mxnz

Citation preview

  • 1ECE 274 - Digital LogicLecture 9

    Lecture 9 - Adders Half-adders Full-adders Carry-ripple Adder

    2

    Digital DesignDatapath Components: Adders: 2-bit adder

    Functional Requirements: Design a circuit that will add two 2-bit binary numbers

    Input: A1A0, B1B0 Output: S1S0: sum of inputs

    C: carry bit

    3

    Digital DesignDatapath Components: Adders: 2-bit Adder: Truth Table

    4

    Digital DesignDatapath Components: Adders: 16-bit Adder: Truth Table

    ..

    0000000000000000000000000000000000000000000000

    s15s14s13s12s11s10s9s8s7s6s5s4s3s2s1s0 c a15a14a13a12a11a10a9a8a7a6a5a4a3a2a1a0b15b14b13b12b11b10b9b8b7b6b5b4b3b2b1b0

    16-bit Adder: 16-bits * 2-operands = 32 inputs

    Over 4,000,000,000 rows

    5

    Digital DesignDatapath Components: Adders: Exponential Growth

    Exponential Growth for Two-Level Adder Implementation

    6

    Digital DesignDatapath Components: Adders: Carry-Ripple

    Functional Requirements: Design a circuit that will add two bits

    Input: A, B Output: S: sum of inputs

    C: carry bit

  • 7Digital DesignDatapath Components: Adders: Carry-Ripple

    Functional Requirements: Design a circuit that will add two bits

    Input: A, B Output: S: sum of inputs

    C: carry bit

    8

    Digital DesignDatapath Components: Adders: Carry-Ripple

    Input: A, BOutput: S: sum of inputs

    C: carry bit

    C2

    A3

    B3

    S3

    C1

    A2

    B2

    S2

    C0

    A1

    B1

    S1

    A0

    B0

    S0

    9

    Digital DesignDatapath Components: Adders: Carry-Ripple: Half-Adder

    1) Capture the Function

    10

    Digital DesignDatapath Components: Adders: Carry-Ripple: Adder

    2) Convert to Equations

    co = abs = ab + ab = a xor b

    11

    Digital DesignDatapath Components: Adders: Carry-Ripple: Adder

    3) Create the Circuit

    co = abs = ab + ab = a xor b

    12

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    Functional Requirements: Design a circuit that will add three bits

    Input: A, B, Cin Output: S: sum of inputs

    C: carry bit

  • 13

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    1) Capture the FunctionInput: A, B, CinOutput: S: sum of inputs

    C: carry bit

    14

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    2) Convert to Equations

    co = bc + ac + abs = a xor b xor c

    15

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    co = bc + ac + abs = a xor b xor c

    3) Create the Circuit

    .3ns .3ns .3ns

    .6ns

    .8ns

    For a 4-bit adder composed of full adders, what would be the soonest time you could expect a result? A) .9 ns B) 2.3 ns C) 3.6 ns

    16

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    4-bit Adder:Inputs (8-bits): a3a2a1a0, b3b2b1b0Outputs (5-bits): c0, s3s2s1s0

    17

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    4-bit Adder:Inputs (9-bits): a3a2a1a0, b3b2b1b0, cinOutputs (5-bits): c0, s3s2s1s0

    18

    Digital DesignDatapath Components: Adders: Carry-Ripple: Full Adder

    NOTE: Adder will exhibit temporarily incorrect (spurious) results until the carry bit from the rightmost bit has had a chance to propagate (ripple) all the way through to the leftmost bit.

  • 19

    Digital DesignDatapath Components: Adders: Carry-Ripple

    20

    Digital DesignDatapath Components: Adders: Compensating Scale

    21

    Digital DesignDatapath Components: Adders: Compensating Scale

    Functional Requirements: Design a circuit that will weigh an object, and add an

    adjustment from a user Input: 8-bit Weight Reported by Sensor

    3-bit User Adjustment Output: S7..0: sum of inputs

    22

    Digital DesignDatapath Components: Adders: Compensating Scale

    AdjustmentKnob

    23

    Digital DesignDatapath Components: Adders: Carry-Ripple

    8-bit Carry-Ripple Adder:Inputs (16-bits): a7a6a5a4a3a2a1a0, b7b6b5b4b3b2b1b0Outputs (5-bits): c0, s3s2s1s0

    24

    Digital DesignDatapath Components: Adders

    8-bit Calculator Functional Requirements: Design a circuit that will add two eight-bit inputs controlled

    by DIP switches and output the result using eight LEDs Input: A (8-bits), B (8-bits) Output: S (8-bits): sum of inputs

  • 25

    Digital DesignDatapath Components: Adders

    8-bit DIP switch based adding calculator. The addition 2+3=5 is shown.

    26

    Digital DesignDatapath Components: Adders

    8-bit Calculator Functional Requirements: Design a circuit that will add two eight-bit inputs controlled

    by DIP switches and output the result using eight LEDs. The output should only be updated with the user presses a calculate button Input: A (8-bits), B (8-bits),

    e: input from calculate button Output: S (8-bits): sum of inputs

    27

    Digital DesignDatapath Components: Adders

    8-bit DIP switch-based adding calculator, using a register to block spurious LED outputs. The LEDs only get updated after the button is pressed, which loads the output register.