CLD-Lec6-Adders
KOREA UNIVERSITY JF Core System
Components:
Agent & Processor
Memory Controller
Graphics including Display
DML and miscellaneous I/O
Course Information:
COSE221 Logic Design Lecture 6
Instructor: Dr. Ngoc-Son Pham, Computer Science & Engineering, Korea University
Topics Covered:
Basic skills in designing combinational and sequential logic using schematic and Verilog-HDL
Upcoming Focus Areas:
Arithmetic circuits: Adders and Subtractors
Counters
Shift Registers
Representation of floating-point numbers in C: float
and double
Memory and Logic Arrays
Functions of Computers: Perform arithmetic operations
Addition, subtraction, comparison, shift, multiplication, division
Core focus:
Study of hardware implementations for these operations
Emphasis on Addition:
Most common operation in computers
Implementation of a 1-bit adder:
Components:
2 inputs: A and B
2 outputs: S (Sum) and Cout (Carry)
Truth Table:
A | B | S (Sum) | C (Carry) |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
Logical Operations:
S = A XOR B
Cout = A AND B
Enhancement of Half Adder:
Full adder has an additional input: Cin
Components:
3 inputs: A, B, Cin
2 outputs: S, Cout
Truth Table:
Cin | A | B | S (Sum) | Cout |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 1 | 1 |
Logical Operations:
S = A XOR B XOR Cin
Cout = A AND B + Cin(A XOR B)
Diagram Representation:
Inputs: A, B, Cin
Outputs: Sum (S), Carry out (Cout)
Relations:
S = A XOR B XOR Cin
Cout = AB + (Cin(A XOR B))
Block diagram implementation:
Involves two half adders and an OR gate
Connectivity:
Cout is derived from the Carry of Half Adders' outputs
Concept of extending 1-bit adders to N-bit adders
Definitions:
N-bit adder sums two N-bit inputs along with carry-in (Cin)
Types of implementations for Carry Propagate Adders (CPAs):
Ripple-carry adders (Slow)
Carry-lookahead adders (Fast)
Prefix adders (Faster)
Method of chaining 1-bit adders
Carry ripples through the entire chain
Example:
32-bit Ripple Carry Adder diagram
Configuration:
Series of full adders designed to sum 4 bits each
Carry from previous adder to next
Relationships:
S0: Sum[0], S1: Sum[1], etc.
Cout derived as described earlier
Critical Path Analysis:
1st Stage critical path = 3 gate delays
Considerations:
Types of gates: XOR, AND, OR
2nd Stage Critical Path = 2 gate delays
Implications for performance:
Ripple carry causes delays in large bit-size adders
Critical path for 4-bit adder = 9 gate delays
General formula for N-bit adder:
2(N-1)+3 = (2N+1) gate delay
Discussed performance issues:
Slow operation for large N (triples delay)
Need for alternative faster designs
Purpose: Overcome slow propagation in ripple carry adders
Mechanism:
Divides the adder into functional blocks
Generates carry-outs quickly using additional circuitry
For N-bit block, the carry-out (Cout) is computed based on generating and propagating signals
Relationships:
Gi = Ai AND Bi
Pi = Ai OR Bi
Carry Generation: Ci = Gi + Pi Ci-1
Description of the propagation of carries through different bits
Computation of final carry-out from chained generate/propagate signals
Understanding the operation of a 4-bit block in CLA
Building up carry-out from the generate/propagate calculations
Overview of CLA components:
Integrating carry lookahead logic with other operations
Description of a CLA circuit with logic gates
Time complexity reduced due to fewer gate delays compared to ripple carry
Diagrammatic representation of a CLA design
Structure exemplifies block-wise addition leading to speed enhancement
Formula for estimating delay in CLA circuits based on various gates' properties
Comparative delay analysis for ripple-carry vs. CLA
Example delays based on assumed gate timing
Example code defining an adder in Verilog-HDL:
module adder #(parameter N = 8) (input [N-1:0] a, b, input cin, output [N-1:0] s, output cout);
assign {cout, s} = a + b + cin;
endmodule
Overview of different types of adders:
Ripple-carry adder
Carry-lookahead adder
Prefix adder
Trade-offs:
Speed vs. Hardware complexity and cost
Additional, detail-oriented slides
Detailed example of CLA
Explanation of carry delay calculations based on gate propagation
Mechanism of calculating generate and propagate signals
Descriptive walkthrough of how the prefix structure operates
Further detailing of carry calculations for prefix adder
Generation and propagation signals for addition
Design example showcasing add operation using prefix logic
Breakdown of prefix adder with detailed connections and relationships between signals
Final calculations for prefix adder delay based on architectural layout and gate delays
KOREA UNIVERSITY JF Core System
Components:
Agent & Processor
Memory Controller
Graphics including Display
DML and miscellaneous I/O
Course Information:
COSE221 Logic Design Lecture 6
Instructor: Dr. Ngoc-Son Pham, Computer Science & Engineering, Korea University
Topics Covered:
Basic skills in designing combinational and sequential logic using schematic and Verilog-HDL
Upcoming Focus Areas:
Arithmetic circuits: Adders and Subtractors
Counters
Shift Registers
Representation of floating-point numbers in C: float
and double
Memory and Logic Arrays
Functions of Computers: Perform arithmetic operations
Addition, subtraction, comparison, shift, multiplication, division
Core focus:
Study of hardware implementations for these operations
Emphasis on Addition:
Most common operation in computers
Implementation of a 1-bit adder:
Components:
2 inputs: A and B
2 outputs: S (Sum) and Cout (Carry)
Truth Table:
A | B | S (Sum) | C (Carry) |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
Logical Operations:
S = A XOR B
Cout = A AND B
Enhancement of Half Adder:
Full adder has an additional input: Cin
Components:
3 inputs: A, B, Cin
2 outputs: S, Cout
Truth Table:
Cin | A | B | S (Sum) | Cout |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 1 | 1 |
Logical Operations:
S = A XOR B XOR Cin
Cout = A AND B + Cin(A XOR B)
Diagram Representation:
Inputs: A, B, Cin
Outputs: Sum (S), Carry out (Cout)
Relations:
S = A XOR B XOR Cin
Cout = AB + (Cin(A XOR B))
Block diagram implementation:
Involves two half adders and an OR gate
Connectivity:
Cout is derived from the Carry of Half Adders' outputs
Concept of extending 1-bit adders to N-bit adders
Definitions:
N-bit adder sums two N-bit inputs along with carry-in (Cin)
Types of implementations for Carry Propagate Adders (CPAs):
Ripple-carry adders (Slow)
Carry-lookahead adders (Fast)
Prefix adders (Faster)
Method of chaining 1-bit adders
Carry ripples through the entire chain
Example:
32-bit Ripple Carry Adder diagram
Configuration:
Series of full adders designed to sum 4 bits each
Carry from previous adder to next
Relationships:
S0: Sum[0], S1: Sum[1], etc.
Cout derived as described earlier
Critical Path Analysis:
1st Stage critical path = 3 gate delays
Considerations:
Types of gates: XOR, AND, OR
2nd Stage Critical Path = 2 gate delays
Implications for performance:
Ripple carry causes delays in large bit-size adders
Critical path for 4-bit adder = 9 gate delays
General formula for N-bit adder:
2(N-1)+3 = (2N+1) gate delay
Discussed performance issues:
Slow operation for large N (triples delay)
Need for alternative faster designs
Purpose: Overcome slow propagation in ripple carry adders
Mechanism:
Divides the adder into functional blocks
Generates carry-outs quickly using additional circuitry
For N-bit block, the carry-out (Cout) is computed based on generating and propagating signals
Relationships:
Gi = Ai AND Bi
Pi = Ai OR Bi
Carry Generation: Ci = Gi + Pi Ci-1
Description of the propagation of carries through different bits
Computation of final carry-out from chained generate/propagate signals
Understanding the operation of a 4-bit block in CLA
Building up carry-out from the generate/propagate calculations
Overview of CLA components:
Integrating carry lookahead logic with other operations
Description of a CLA circuit with logic gates
Time complexity reduced due to fewer gate delays compared to ripple carry
Diagrammatic representation of a CLA design
Structure exemplifies block-wise addition leading to speed enhancement
Formula for estimating delay in CLA circuits based on various gates' properties
Comparative delay analysis for ripple-carry vs. CLA
Example delays based on assumed gate timing
Example code defining an adder in Verilog-HDL:
module adder #(parameter N = 8) (input [N-1:0] a, b, input cin, output [N-1:0] s, output cout);
assign {cout, s} = a + b + cin;
endmodule
Overview of different types of adders:
Ripple-carry adder
Carry-lookahead adder
Prefix adder
Trade-offs:
Speed vs. Hardware complexity and cost
Additional, detail-oriented slides
Detailed example of CLA
Explanation of carry delay calculations based on gate propagation
Mechanism of calculating generate and propagate signals
Descriptive walkthrough of how the prefix structure operates
Further detailing of carry calculations for prefix adder
Generation and propagation signals for addition
Design example showcasing add operation using prefix logic
Breakdown of prefix adder with detailed connections and relationships between signals
Final calculations for prefix adder delay based on architectural layout and gate delays