ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin.

Slides:



Advertisements
Similar presentations
L23 – Adder Architectures. Adders  Carry Lookahead adder  Carry select adder (staged)  Carry Multiplexed Adder  Ref: text Unit 15 9/2/2012 – ECE 3561.
Advertisements

Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Modular Combinational Logic
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
CPE 626 CPU Resources: Adders & Multipliers Aleksandar Milenkovic Web:
Comparator.
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
Lecture Adders Half adder.
Fast Adders See: P&H Chapter 3.1-3, C Goals: serial to parallel conversion time vs. space tradeoffs design choices.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Henry Hexmoor1 Chapter 5 Arithmetic Functions Arithmetic functions –Operate on binary vectors –Use the same subfunction in each bit position Can design.
ECE 331 – Digital System Design
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Lecture 8 Arithmetic Logic Circuits
Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
ENGIN112 L14: Binary Adder Subtractor October 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 14 Binary Adders and Subtractors.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Adders, subtractors, ALUs
 Arithmetic circuit  Addition  Subtraction  Division  Multiplication.
CS 105 Digital Logic Design
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
Digital Arithmetic and Arithmetic Circuits
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Chapter 6-1 ALU, Adder and Subtractor
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
Computing Systems Designing a basic ALU.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
CHAPTER 4 Combinational Logic Design- Arithmetic Operation (Section 4.6&4.9)
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices X-OR gates and Parity circuits Comparators Adders, subtractors,
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
1 Lecture 12 Time/space trade offs Adders. 2 Time vs. speed: Linear chain 8-input OR function with 2-input gates Gates: 7 Max delay: 7.
Binary Adder DesignSpring Binary Adders. Binary Adder DesignSpring n-bit Addition –Ripple Carry Adder –Conditional Sum Adder –(Carry Lookahead.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
Lecture 4. Adder & Subtractor Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
COMP541 Arithmetic Circuits
N, Z, C, V in CPSR with Adder & Subtractor Prof. Taeweon Suh Computer Science Education Korea University.
Combinational Circuits
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Building a Faster Adder
Computer Architecture Lecture 16 Fasih ur Rehman.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 5: Arithmetic Circuits Chapter 5 (minus 5.3.4)
1 Carry Lookahead Logic Carry Generate Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate Pi = Ai xor Bi carry in will equal carry out here.
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
Addition, Subtraction, Logic Operations and ALU Design
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Prof. Hsien-Hsin Sean Lee
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
Lecture 7. Subtractor Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Logic Design.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Combinational Circuits
Lecture Adders Half adder.
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 14 Logistics Last lecture Today
Lecture 14 Logistics Last lecture Today
Combinational Circuits
Presentation transcript:

ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech

Half Adder (1-bit) ABS(um)C(arry) Half Adder AB S C

Half Adder (1-bit) ABS(um)C(arry) A B Sum Carry

Full Adder CinABS(um)Cout Full Adder AB S Cout Carry In (Cin)

Full Adder CinABS(um)Cout Cin AB Cin AB Cin AB Or

Full Adder A B Cin Cout S H.A.

Full Adder Cout S Half Adder S C A B Half Adder S C A B B A Cin

4-bit Ripple Adder using Full Adder Full Adder AB Cin Cout S S0 A0B0 Full Adder AB Cin Cout S S1 A1B1 Full Adder AB Cin Cout S S2 A2B2 Full Adder AB Cin Cout S S3 A3B3 Carry A B S C Half Adder A B Cin Cout S H.A. Full Adder

Full Adder Propagation Delay S0 A0B0 Carry Cin 1 st Stage Critical Path = 3 gate delays = D XOR +D AND +D OR

Full Adder Propagation Delay S0 A0B0 Cin S1 A1B1 2 nd Stage Critical Path = 2 gate delays = D AND +D OR (Since 1 st Critical path > D XOR ) 1 st Stage Critical Path = 3 gate delays = D XOR +D AND +D OR

Issue of 4-bit Ripple Adder Critical Path = D XOR +4*(D AND +D OR ) for 4-bit ripple adder (9 gate levels) For an N-bit ripple adder Critical Path Delay  ~ 2(N-1)+3 = (2N+1) Gate delays S0 A0B0 Cin S1 A1B1 S2 A2B2 S3 A3B3 Carry

Issue of Ripple Adder Carry propagationCarry propagation is the main issue in an N- bit ripple adder A faster adder needs to address the serial propagation of the carry bit Let’s re-examine the equation for full adders

GeneratePropagate Carry Generate & Propagate Note that all the carry’s are only dependent on input A and B and C

4-bit Carry-Lookahead Adder (CLA) Carry Lookahead Logic g1p1 A1B1 S1C1g2p2 A2B2 S2C2g3p3 A3B3 S3C3 g0p0 A0B0 S0C0C4

Inefficient Inefficient Implementation of Carry Lookahead Logic A0B0S0A1B1S1 C0 A2B2S2A3B3 S3 Reuse some gate output results  Little Improvement Carry Delay is 4*D AND + 2*D OR for Carry C 4

Implementation of Carry Lookahead Logic C4 A0B0S0A1B1S1 C0 A2B2S2A3B3 S3 Carry Lookahead Logic Only 3 Gate Delay for each Carry C i = D AND + 2*D OR 4 Gate Delay for each Sum S i = D AND + 2*D OR + D XOR

Cascading CLA Similar to ripple adder, but different latency CLA AB Cin Cout S S[3:0] A[3:0]B[3:0] CLA AB Cin Cout S S[7:4] A[7:4]B[7:4] CLA AB Cin Cout S S[11:8] A[11:8]B[11:8] 4 44 CLA AB Cin Cout S S[15:12] A[15:12]B[15:12] 4 44 Delay of each stage is 3 gate levels instead of 9 of ripple adders

Subtractor Design A – B = A + (-B) –Take 2’s complement of B –Perform addition of A and 2’s complement of B Full Adder AB Cin Cout S S0 A0 Full Adder AB Cin Cout S S1 A1 Full Adder AB Cin Cout S S2 A2 Full Adder AB Cin Cout S S3 A3 B0B1B2B3 C Subtract

Overflow/Underflow for Signed Arithmetic (+72) (+57) (+129) What is largest positive number represented by 8-bit? 8-bit Signed number addition (-127) ( -6) (-133) 8-bit Signed number addition What is smallest negative number represented by 8-bit?

Overflow/Underflow Detection C n-1 A n-1 B n-1 S n-1 CnCn OF Examine the MSB bit Bottom line: –P: positive; N: negative –N + N = N –P + P = P –P+N or N+P always fall into the range E.g P cannot be smaller than -128 or bigger than 127 Problem lies in –N+N = P –P+P = N Discarded

Overflow/Underflow Detection C n-1 A n-1 B n-1 S n-1 CnCn OF Discarded

Overflow/Underflow Detection Full Adder AB Cin Cout S S0 A0B0 Full Adder AB Cin Cout S S1 A1B1 Full Adder AB Cin Cout S S2 A2B2 Full Adder AB Cin Cout S S3 A3B3 Carry Overflow/ Underflow n-bit Adder/Subtractor Overflow/ Underflow Cn Cn-1

Overflow/Underflow Example (+72) (+57) (+129) 8-bit Signed number addition (-127) ( -6) (-133) 8-bit Signed number addition Cn-1 = Cn = Cn-1 = Cn =

Parity Circuits To detect single bit error during transmission Parity bit –Even parity: even number for data+parity –Odd parity: odd number for data+parity Single parity bit –Cannot detect 2 bit error –Cannot correct the single bit error SenderReceiver N-bit data Parity bit

Even Parity Generation D0 D1 D2 D3 P_GEN P_GEN = D0  D1  D2  D3 P=1 if odd number of inputs is 1 P=0 if even number of inputs is 1 Sender Receiver 4-bit data Parity bit (P_GEN)

Even Parity Detection Sender Receiver 4-bit data Parity bit (P_GEN) D0 D1 D2 D3 Detection P_GEN P_RECV P_RECV = D0  D1  D2  D3 DETECTION = P_GEN  P_RECV DETECTION=1 if P_GEN  P_RECV

Parity Detection Example D3=0 D2=1 D1=1 D0=1 P_GEN=1 Sender Receiver 4-bit data Parity bit (P_GEN)

Parity Detection Example Sender Receiver 4-bit data Parity bit (P_GEN) D3=0 D2=1 D1=0 D0=1 Detection=1 P_GEN=1 P_RECV= Error occur during transmission