Basic Adders and Counters

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Advertisements

Comparator.
Datorteknik ArithmeticCircuits bild 1 Computer arithmetic Somet things you should know about digital arithmetic: Principles Architecture Design.
Lecture Adders Half adder.
Henry Hexmoor1 Chapter 5 Arithmetic Functions Arithmetic functions –Operate on binary vectors –Use the same subfunction in each bit position Can design.
CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers.
ECE 301 – Digital Electronics
CSE 246: Computer Arithmetic Algorithms and Hardware Design Prof Chung-Kuan Cheng Lecture 3.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Basic Adders and Counters Implementation of Adders in FPGAs ECE 645: Lecture 3.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
CSE115: Digital Design Lecture 20: Comparators, Adders and Subtractors Faculty of Engineering.
Basic Addition Review Basic Adders and the Carry Problem
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
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.
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Application of Addition Algorithms Joe Cavallaro.
Carry-Lookahead, Carry-Select, & Hybrid Adders ECE 645: Lecture 2.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Tree and Array Multipliers Lecture 8. Required Reading Chapter 11, Tree and Array Multipliers Chapter 12.5, The special case of squaring Note errata at:
1 Arithmetic Building Blocks Today: Signed ArithmeticFirst Hour: Signed Arithmetic –Section 5.1 of Katz’s Textbook –In-class Activity #1 Second Hour: Adder.
CDA3101 Recitation Section 5
Carry-Lookahead & Carry-Select Adders
Computer Arthmetic Chapter Four P&H.
Combinational Circuits
Somet things you should know about digital arithmetic:
Lecture Adders Half adder.
Conditional-Sum Adders Parallel Prefix Network Adders
Sequential Multipliers
Lecture 2 Supplement Verilog-01
Exercise: Add these two single precision IEEE 754 numbers: … …0 Left number: 1.101x24 Right number: 1.011x 22= x24.
CSE 575 Computer Arithmetic Spring 2005 Mary Jane Irwin (www. cse. psu
Radix 2 Sequential Multipliers
ECE 331 – Digital System Design
Tree and Array Multipliers
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 14 Logistics Last lecture Today
Arithmetic Circuits (Part I) Randy H
Instructor: Prof. Chung-Kuan Cheng
Instructor: Alexander Stoytchev
CS 140 Lecture 14 Standard Combinational Modules
Chapter 5 – Number Representation and Arithmetic Circuits
Basic Adders and Counters Implementation of Adders
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Part III The Arithmetic/Logic Unit
Multioperand Addition
CSE 140 Lecture 14 Standard Combinational Modules
Instructor: Alexander Stoytchev
Lecture 14 Logistics Last lecture Today
Tree and Array Multipliers
ECE 352 Digital System Fundamentals
Supplement on Verilog adder examples
Instructor: Alexander Stoytchev
UNIVERSITY OF MASSACHUSETTS Dept
Lecture 9 Digital VLSI System Design Laboratory
Sequential Multipliers
Carry-Lookahead, Carry-Select, & Hybrid Adders
Carry-Lookahead, Carry-Select, & Hybrid Adders
Arithmetic Circuits.
Carry-Lookahead & Carry-Select Adders
Instruction execution and ALU
Conditional-Sum Adders Parallel Prefix Network Adders
Lecture 2 Adders Half adder.
Presentation transcript:

Basic Adders and Counters ECE 645: Lecture 3 Basic Adders and Counters

Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 5, Basic Addition and Counting, Sections 5.1-5.5, pp. 75-85.

Half-adder c x HA s y x y c s 1 1 1 1 2 1 x + y = ( c s )2

Alternative implementations (1) Half-adder Alternative implementations (1) a) c = xy s = x  y b) s = xy + xy c = x + y

Alternative implementations (2) Half-adder Alternative implementations (2) c) c = xy s = xc + yc = xc  yc

Full-adder x cout FA y s cin x + y + cin = ( cout s )2 x y cin cout s 1 1 1 1 1 2 1 x + y + cin = ( cout s )2

Alternative implementations (1) Full-adder Alternative implementations (1) a) s = (x  y)  cin cout = xy + cin (x  y) s c

Alternative implementations (2) Full-adder Alternative implementations (2) b) s = x  y  cin = xycin + xycin + xycin + xycin cout = xy + xcin + ycin

Alternative implementations (3) Full-adder Alternative implementations (3) c) x y cout s 1 1 1 cin cin cin cin cin cin

Alternative implementations (4) Full-adder Alternative implementations (4) Implementation used to generate fast carry logic in Xilinx FPGAs x y A2 A1 XOR D 1 Cin Cout S p g x y cout 1 cin p = x  y g = y s= p  cin = x  y  cin

Latency of a k-bit ripple-carry adder Tripple-add = TFA(x,ycout) + + (k-2)  TFA(cincout) + + TFA(cin s) Latency  k  TFA Latency  k

Overflow for signed numbers (1) Indication of overflow Positive + Positive = Negative Negative + Negative = Positive Formulas Overflow2’s complement = xk-1 yk-1 sk-1 + xk-1 yk-1 sk-1 = = ck  ck-1

Overflow for signed numbers (2) xk-1 yk-1 ck-1 ck sk-1 overflow ckck-1 1 1 1 1 1 1 1

xi yi Bit-serial adder c0 ci+1 start clk si

xi yi d d Digit-serial adder c0 ci+1 start clk d si

Addition of a constant (1) xk-1 xk-2 . . . x1 x0 yk-1 yk-2 . . . y1 y0 variable + constant sk-1 sk-2 . . . s1 s0 xk-1 xk-2 . . . xh+1 xh xh-1 . . . x0 yk-1 yk-2 . . . yh+1 1 0 . . . 0 variable + constant sk-1 sk-2 . . . sh+1 xh xh-1 . . . x0

Addition of a constant (2) . . . xk-1 xk-2 xh+2 xh+1 xh xh-1 x0 . . . ck . . . . . HA/ MHA HA/ MHA HA/ MHA HA/ MHA sk-1 sk-2 . . . sh+2 sh+1 xh xh-1 . . . x0 If yi = 0 Half-adder (HA) yi = 1 Modified half-adder (MHA)

Modified half-adder c x MHA s y x y c s 1 1 1 1 x + y + 1 = ( c s )2 1 1 1 1 2 1 x + y + 1 = ( c s )2

Incrementer xk-1 xk-2 x2 x1 x0 . . . ck . . sk-1 sk-2 . . . s2 s1 x0 HA HA HA HA sk-1 sk-2 . . . s2 s1 x0 Decrementer xk-1 xk-2 x2 x1 x0 . . . ck . . MHA MHA MHA MHA sk-1 sk-2 . . . s2 s1 x0

Possible solutions to the carry propagate problem 1. Detect the end of propagation rather than wait for the worst-case time 2. Speed-up propagation via look-ahead carry skip carry select, etc 3. Limit carry propagation to within a small number of bits 4. Eliminate carry propagation through the redundant number representation

Analysis of carry propagation Probability of carry generation = (xiyi = 11) Probability of carry propagation = (xiyi = 01 or 10) Probability of carry anihilation = (xiyi = 00 or 11) j j-1 . . . . . . . i+1 i 1 0 … 1 …0 … 1 1 1 1 … 0 …1 … 0 1 11 or 00 01 or 10 Probability of carry propagating from position i to position j =  = probability of propagation probability of anihilation

Expected length of the carry chain that starts at position i (1) Expected length(i, k) = Length of the carry chain Probability of the given length Distance till the end of adder Probability of propagation till the end of adder

Expected length of the carry chain that starts at position i (2) Expected length(i, k) = For i << k Expected length of the carry propagation is  2