Basic Adders and Counters Implementation of Adders in FPGAs ECE 645: Lecture 3.

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
ECE 506 Reconfigurable Computing ece. arizona
Spartan-3 FPGA HDL Coding Techniques
Reconfigurable Computing (EN2911X, Fall07) Lecture 04: Programmable Logic Technology (2/3) Prof. Sherief Reda Division of Engineering, Brown University.
Survey of Reconfigurable Logic Technologies
A Survey of Logic Block Architectures For Digital Signal Processing Applications.
Spartan II Features  Plentiful logic and memory resources –15K to 200K system gates (up to 5,292 logic cells) –Up to 57 Kb block RAM storage  Flexible.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Overview of Modern FPGAs ECE 448 Lecture 14.
Lecture 11 Xilinx FPGA Memories
FPGA Devices & FPGA Design Flow
ECE 448 Lecture 7 FPGA Devices
1 CS 140 Lecture 14 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego Some slides from Harris and Harris.
EECS Components and Design Techniques for Digital Systems Lec 18 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
Programmable logic and FPGA
Introduction to Field Programmable Gate Arrays (FPGAs) COE 203 Digital Logic Laboratory Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Overview of Modern FPGAs ECE 448 Lecture 14.
ECE 301 – Digital Electronics
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic: Internal Organization of an FPGA José Nelson Amaral.
Implementing Digital Circuits Lecture L3.1. Implementing Digital Circuits Transistors and Integrated Circuits Transistor-Transistor Logic (TTL) Programmable.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
The Xilinx Spartan 3 FPGA EGRE 631 2/2/09. Basic types of FPGA’s One time programmable Reprogrammable (non-volatile) –Retains program when powered down.
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
1. Copyright  2005 by Oxford University Press, Inc. Computer Architecture Parhami2 Figure 10.1 Truth table and schematic diagram for a binary half-adder.
Ch.9 CPLD/FPGA Design TAIST ICTES Program VLSI Design Methodology Hiroaki Kunieda Tokyo Institute of Technology.
George Mason University Modern FPGA Devices ATHENa - Automated Tool for Hardware EvaluatioN ECE 545 Lecture 11.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
ECE 448 – FPGA and ASIC Design with VHDL Lecture 11 Memories in Xilinx FPGAs.
Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry.
EECS Components and Design Techniques for Digital Systems Lec 16 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
VHDL Project Specification Naser Mohammadzadeh. Schedule  due date: Tir 18 th 2.
1 CPSC3850 Adders and Simple ALUs Simple Adders Figures 10.1/10.2 Binary half-adder (HA) and full-adder (FA). Digit-set interpretation: {0, 1}
CSE115: Digital Design Lecture 20: Comparators, Adders and Subtractors Faculty of Engineering.
July 2005Computer Architecture, The Arithmetic/Logic UnitSlide 1 Part III The Arithmetic/Logic Unit.
Computer Architecture, The Arithmetic/Logic UnitSlide 1 Part III The Arithmetic/Logic Unit.
Fast Adders: Parallel Prefix Network Adders, Conditional-Sum Adders, & Carry-Skip Adders ECE 645: Lecture 5.
FPGA-Based System Design: Chapter 4 Copyright  2003 Prentice Hall PTR Topics n Number representation. n Shifters. n Adders and ALUs.
ECE 448 Lecture 6 FPGA devices
George Mason University ECE 449 – Computer Design Lab Introduction to FPGA Devices & Tools.
ECE 545 Lecture 7 FPGA Design Flow.
ECE 645 – Computer Arithmetic Lecture 6: Multi-Operand Addition ECE 645—Computer Arithmetic 3/5/08.
ESS | FPGA for Dummies | | Maurizio Donna FPGA for Dummies Basic FPGA architecture.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
CDA 4253 FGPA System Design Xilinx FPGA Memories
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Lecture 10 Xilinx FPGA Memories Part 1
Survey of Reconfigurable Logic Technologies
1. 2 Figure 10.1 Truth table and schematic diagram for a binary half-adder Simple Adders Half-adder.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL FPGA Devices ECE 448 Lecture 5.
Carry-Lookahead, Carry-Select, & Hybrid Adders ECE 645: Lecture 2.
George Mason University Class Exercise 1B. 2ECE 448 – FPGA and ASIC Design with VHDL Rules If you believe that you know a correct answer, please raise.
George Mason University FPGA Devices & FPGA Design Flow ECE 545 Lecture 8.
EEL 5722 FPGA Design Fall 2003 Digit-Serial DSP Functions Part I.
FPGA Devices & FPGA Design Flow
FPGA 상명대학교 소프트웨어학부 2007년 1학기.
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 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Carry-Lookahead & Carry-Select Adders
Basic Adders and Counters
Programmable Logic Memories
FPGA Devices & FPGA Tools
ECE 448 Lecture 7 FPGA Devices
ECE 448 Lecture 5 FPGA Devices
Basic Adders and Counters Implementation of Adders
Tree and Array Multipliers
Pipelined Array Multiplier Aldec Active-HDL Design Flow
Carry-Lookahead & Carry-Select Adders
Presentation transcript:

Basic Adders and Counters Implementation of Adders in FPGAs ECE 645: Lecture 3

Required Reading Chapter 5, Basic Addition and Counting, Sections , pp Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design

Required Reading Chapter 9, Using Carry and Arithmetic Logic Spartan-3 Generation FPGA User Guide

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

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

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

Full-adder x y c out s FA x + y + c in = ( c out s ) xy c out s c in

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

Full-adder Alternative implementations (2) s = x  y  c in = xyc in + xyc in + xyc in + xyc in c out = xy + xc in + yc in b)

Full-adder Alternative implementations (3) c) xyc out s c in

x y A2 A1 XOR D 01 C in C out S p g Full-adder Alternative implementations (4) Implementation used to generate fast carry logic in Xilinx FPGAs xyc out yyyy c in p = x  y g = y s= p  c in = x  y  c in

Latency of a k-bit ripple-carry adder T ripple-add = T FA (x,y  c out ) + + (k-2)  T FA (c in  c out ) + + T FA (c in  s) Latency  k  T FA Latency  k

Overflow for signed numbers (1) Indication of overflow Positive + Positive = Negative Negative + Negative = Positive Formulas Overflow 2’s complement = x k-1 y k-1 s k-1 + x k-1 y k-1 s k-1 = = c k  c k-1

Overflow for signed numbers (2) x k-1 y k-1 c k-1 c k s k-1 overflow c k  c k

Implementation of Adders in FPGAs

TechnologyLow-costHigh- performance 120/150 nmVirtex 2, 2 Pro 90 nmSpartan 3Virtex 4 65 nmVirtex 5 45 nmSpartan 6 40 nmVirtex 6 Xilinx FPGA Devices

Altera FPGA Devices TechnologyLow-costMid-rangeHigh- performanc e 130 nmCycloneStratix 90 nmCyclone IIStratix II 65 nmCyclone IIIArria IStratix III 40 nmCyclone IVArria IIStratix IV

23 ECE 448 – FPGA and ASIC Design with VHDL The Design Warrior’s Guide to FPGAs Devices, Tools, and Flows. ISBN Copyright © 2004 Mentor Graphics Corp. ( General structure of an FPGA

24 ECE 448 – FPGA and ASIC Design with VHDL

25 ECE 448 – FPGA and ASIC Design with VHDL The Design Warrior’s Guide to FPGAs Devices, Tools, and Flows. ISBN Copyright © 2004 Mentor Graphics Corp. ( Xilinx Spartan 3 FPGAs

26 ECE 448 – FPGA and ASIC Design with VHDL CLB Structure

27 ECE 448 – FPGA and ASIC Design with VHDL CLB Slice Structure Each slice contains two sets of the following: Four-input LUT Any 4-input logic function, or 16-bit x 1 sync RAM (SLICEM only) or 16-bit shift register (SLICEM only) Carry & Control Fast arithmetic logic Multiplier logic Multiplexer logic Storage element Latch or flip-flop Set and reset True or inverted inputs Sync. or async. control

28 ECE 448 – FPGA and ASIC Design with VHDL LUT (Look-Up Table) Functionality Look-Up tables are primary elements for logic implementation Each LUT can implement any function of 4 inputs

29 ECE 448 – FPGA and ASIC Design with VHDL COUT D Q CK S R EC D Q CK R EC O G4 G3 G2 G1 Look-Up Table Carry & Control Logic O YB Y F4 F3 F2 F1 XB X Look-Up Table F5IN BY SR S Carry & Control Logic CIN CLK CE SLICE Carry & Control Logic

xy COUT yyyy CIN Propagate = x  y Generate = y Sum= Propagate  CIN = x  y  CIN x y Carry & Control Logic in Xilinx FPGAs

Carry & Control Logic in Spartan 3 FPGAs LUT Hardwired (fast) logic

Simplified View of Spartan-3 FPGA Carry and Arithmetic Logic in One Logic Cell

Simplified View of Carry Logic in One Spartan 3 Slice

Critical Path for an Adder Implemented Using Xilinx Spartan 3 FPGAs

Number and Length of Carry Chains for Spartan 3 FPGAs

Bottom Operand Input to Carry Out Delay T OPCYF 0.9 ns for Spartan 3

0.2 ns for Spartan 3 Carry Propagation Delay t BYP

Carry Input to Top Sum Combinational Output Delay T CINY 1.2 ns for Spartan 3

Critical Path Delays and Maximum Clock Frequencies (into account surrounding registers)

Major Differences between Xilinx Families Number of CLB slices per CLB Number of LUTs per CLB slice Look-Up Tables Number of adder stages per CLB slice Spartan 3 Virtex 4 Virtex 5, Virtex 6, Spartan 6 4-input6-input

Altera Cyclone III Logic Element (LE) – Normal Mode

Altera Cyclone III Logic Element (LE) – Arithmetic Mode

Altera Stratix III, Stratix IV Adaptive Logic Modules (ALM) – Normal Mode

Altera Stratix III, Stratix IV Adaptive Logic Modules (ALM) – Arithmetic Mode

Bit-Serial & Digit-Serial Adders

Bit-serial adder xixi yiyi sisi c0c0 start c i+1 clk

Digit-serial adder d d d xixi yiyi sisi c0c0 start c i+1 clk

Addition of a Constant

Addition of a constant (1) x k-1 x k-2... x 1 x 0 y k-1 y k-2... y 1 y 0 variable constant + x k-1 x k-2... x h+1 x h x h-1... x 0 y k-1 y k-2... y h variable constant + x h x h-1... x 0 s k-1 s k-2... s 1 s 0 s k-1 s k-2... s h+1

Addition of a constant (2)... HA/ MHA HA/ MHA HA/ MHA HA/ MHA x0x0 x h-1 xhxh x h+1 x h+2 x k-1 x k x0x0 x h-1 xhxh s h+1 s h+2 s k-1 s k-2... If y i = 0 Half-adder (HA) y i = 1 Modified half-adder (MHA) ckck

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

HA x1x1 x2x2 x k-1 x k s1s1 s2s2 s k-1 s k-2... x0x0 x0x0 ckck Incrementer MHA x1x1 x2x2 x k-1 x k s1s1 s2s2 s k-1 s k-2... x0x0 x0x0 ckck Decrementer

Asynchronous Adders

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 = (x i y i = 11) Probability of carry propagation = (x i y i = 01 or 10) Probability of carry anihilation = (x i y i = 00 or 11) j j i+1 i 1 0 … 1 …0 … … 0 …1 … 0 1 Probability of carry propagating from position i to position j = 11 or or 10  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 Probability of propagation till the end of adder Distance 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