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

Similar documents
Lecture 3: Basic Adders and Counters

ECE 545 Lecture 12. FPGA Resources. George Mason University

INTRODUCTION TO FPGA ARCHITECTURE

ECE 448 Lecture 5. FPGA Devices

Xilinx ASMBL Architecture

EXPERIMENT NUMBER 11 REGISTERED ALU DESIGN

Topics. Midterm Finish Chapter 7

! Program logic functions, interconnect using SRAM. ! Advantages: ! Re-programmable; ! dynamically reconfigurable; ! uses standard processes.

FPGA for Complex System Implementation. National Chiao Tung University Chun-Jen Tsai 04/14/2011

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Topics. Midterm Finish Chapter 7

FPGA architecture and design technology

ECE 448 Lecture 5. FPGA Devices

ECE331: Hardware Organization and Design

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

ECE 699: Lecture 9. Programmable Logic Memories

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Basic FPGA Architectures. Actel FPGAs. PLD Technologies: Antifuse. 3 Digital Systems Implementation Programmable Logic Devices

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Real Digital Problem Set #6

Lecture 11 Memories in Xilinx FPGAs

Chapter 3: part 3 Binary Subtraction

Field Programmable Gate Array (FPGA)

ECE 545: Lecture 11. Programmable Logic Memories

ECE 545: Lecture 11. Programmable Logic Memories. Recommended reading. Memory Types. Memory Types. Memory Types specific to Xilinx FPGAs

Microcomputers. Outline. Number Systems and Digital Logic Review

Basic FPGA Architecture Xilinx, Inc. All Rights Reserved

The Virtex FPGA and Introduction to design techniques

Programmable Logic. Simple Programmable Logic Devices

ECE 545 Lecture 17 RAM. George Mason University

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses

Computer Architecture and Organization: L04: Micro-operations

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

ECE 636. Reconfigurable Computing. Lecture 2. Field Programmable Gate Arrays I

4DM4 Lab. #1 A: Introduction to VHDL and FPGAs B: An Unbuffered Crossbar Switch (posted Thursday, Sept 19, 2013)

EITF35: Introduction to Structured VLSI Design

ECE 341 Midterm Exam

ECE 341 Midterm Exam

EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs)

EE178 Lecture Module 2. Eric Crabill SJSU / Xilinx Fall 2007

ECE 448 Lecture 13. FPGA Memories. George Mason University

Outline. EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs) FPGA Overview. Why FPGAs?

REGISTER TRANSFER LANGUAGE

Altera FLEX 8000 Block Diagram

Introduction to Field Programmable Gate Arrays

Arithmetic Logic Unit. Digital Computer Design

Virtex-II Architecture

TSEA44 - Design for FPGAs

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

Review from last time. CS152 Computer Architecture and Engineering Lecture 6. Verilog (finish) Multiply, Divide, Shift

DSP Resources. Main features: 1 adder-subtractor, 1 multiplier, 1 add/sub/logic ALU, 1 comparator, several pipeline stages

Learning Outcomes. Spiral 2-2. Digital System Design DATAPATH COMPONENTS

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

ECE331: Hardware Organization and Design

ELCT 501: Digital System Design

register:a group of binary cells suitable for holding binary information flip-flops + gates

An Efficient Implementation of Floating Point Multiplier

CHAPTER 4. DIGITAL DOWNCONVERTER FOR WiMAX SYSTEM

CAD4 The ALU Fall 2009 Assignment. Description

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

2015 Paper E2.1: Digital Electronics II

An FPGA based Implementation of Floating-point Multiplier

University, Patiala, Punjab, India 1 2

CS Digital Systems Project Laboratory

Pipelined FPGA Adders

Parallel logic circuits

Lecture 12 VHDL Synthesis

Adders, Subtracters and Accumulators in XC3000

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4)

ECE 545 Lecture 12. FPGA Embedded Resources 12/8/11. Resources. Recommended reading. Use of Embedded FPGA Resources in SHA-3 Candidates

Experiment 3. Digital Circuit Prototyping Using FPGAs

Stratix II vs. Virtex-4 Performance Comparison

Note that none of the above MAY be a VALID ANSWER.

Implementation of Floating Point Multiplier Using Dadda Algorithm

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

Chapter 8 FPGA Basics

EECS 150 Homework 7 Solutions Fall (a) 4.3 The functions for the 7 segment display decoder given in Section 4.3 are:

Field Programmable Gate Array

Readings: Storage unit. Can hold an n-bit value Composed of a group of n flip-flops. Each flip-flop stores 1 bit of information.

Binary Adders. Ripple-Carry Adder

Use of Embedded FPGA Resources in Implementa:ons of 14 Round 2 SHA- 3 Candidates

Code No: R Set No. 1

A High Speed Binary Floating Point Multiplier Using Dadda Algorithm

Overview. EECS Components and Design Techniques for Digital Systems. Lec 16 Arithmetic II (Multiplication) Computer Number Systems.

Chapter 4 Arithmetic Functions

Learning Outcomes. Spiral 2 2. Digital System Design DATAPATH COMPONENTS

*Instruction Matters: Purdue Academic Course Transformation. Introduction to Digital System Design. Module 4 Arithmetic and Computer Logic Circuits

Parallel FIR Filters. Chapter 5

Pipelining & Verilog. Sequential Divider. Verilog divider.v. Math Functions in Coregen. Lab #3 due tonight, LPSet 8 Thurs 10/11

FYSE420 DIGITAL ELECTRONICS. Lecture 7

FPGA Architecture Overview. Generic FPGA Architecture (1) FPGA Architecture

CSE140 L. Instructor: Thomas Y. P. Lee January 18,2006. CSE140L Course Info

Programmable Logic Devices FPGA Architectures II CMPE 415. Overview This set of notes introduces many of the features available in the FPGAs of today.

Advanced Computer Architecture-CS501

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Lecture 19: Arithmetic Modules 14-1

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

Transcription:

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

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

Required Reading Spartan-3 Generation FPGA User Guide http://www.xilinx.com/support/documentation/spartan-3_user_guides.htm Chapter 9, Using Carry and Arithmetic Logic

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

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

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

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

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

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

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

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

Latency of a k-bit ripple-carry adder d RCA (k) = d FA (x,y c out ) + + (k-2) d FA (c in c out ) + + d FA (c in s) Latency = a k + b

Unsigned addition vs. signed addition weight carry + = X Y S Machine 28 64 32 6 8 4 2 Unsigned mind Programmer Signed mind x 7 y 7 x 6 y 6 x 5 y 5 x 4 y 4 x 3 y 3 x 2 y 2 x y x y c 8 FA c 7 FA c 6 FA c 5 FA c 4 FA c 3 FA c 2 FA c FA s 7 s 6 s 5 s 4 s 3 s 2 s s

Out of range flags Carry flag - C out-of-range for unsigned numbers C = if result > MAX_UNSIGNED or result < otherwise where MAX_UNSIGNED = 2 8 - for 8-bit operands 2 6 - for 6-bit operands Overflow flag - V out-of-range for signed numbers V = if result > MAX_SIGNED or result < MIN_SIGNED otherwise where MAX_SIGNED = 2 7 - for 8-bit operands 2 5 - for 6-bit operands MIN_SIGNED = -2 7 for 8-bit operands -2 5 for 6-bit operands

Overflow for signed numbers Indication of overflow Positive + Positive = Negative Negative + Negative = Positive Formulas Overflow 2 s complement = x k- y k- s k- + x k- y k- s k-

Addition of Signed and Unsigned Numbers C= and V= 8 4 2 3 24 8-8 4 2-3 -5-8 C= and V= 8 4 2 3 6 9-8 4 2 3 6 9-7

Addition of Signed and Unsigned Numbers C= and V= 8 4 2 5 9 4-8 4 2 5-7 -2 C= and V= 8 4 2 2 23 7-8 4 2-4 -5-9 -7

Two s complement representation of signed integers +5 + + +4 +2 +3 +3 +2 +4 + +5 + +6 +9 +8 +7

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

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

Implementation of Adders in FPGAs

Xilinx FPGA Devices Technology Low- cost High- performance 22 nm Spartan II Virtex 2/5 nm Virtex II, II Pro 9 nm Spartan 3 Virtex 4 65 nm Virtex 5 45 nm Spartan 6 4 nm Virtex 6 28 nm Ar<x 7 Virtex 7

Altera FPGA Devices Technology Low- cost Mid- range High- performance 3 nm Cyclone Stra<x 9 nm Cyclone II Stra<x II 65 nm Cyclone III Arria I Stra<x III 4 nm Cyclone IV Arria II Stra<x IV 28 nm Cyclone V Arria V Stra<x V

General structure of an FPGA Programmable interconnect Programmable logic blocks The Design Warrior s Guide to FPGAs Devices, Tools, and Flows. ISBN 7567643 Copyright 24 Mentor Graphics Corp. (www.mentor.com) 29

3

Xilinx Spartan 3 FPGAs Configurable logic block (CLB) Slice Slice CLB CLB Logic cell Logic cell Logic cell Logic cell Slice Slice CLB CLB Logic cell Logic cell Logic cell Logic cell The Design Warrior s Guide to FPGAs Devices, Tools, and Flows. ISBN 7567643 Copyright 24 Mentor Graphics Corp. (www.mentor.com) 3

CLB Slice Structure Each slice contains two sets of the following: Four-input LUT Any 4-input logic function, or 6-bit x sync RAM (SLICEM only) or 6-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 32

33 COUT D Q CK S R EC D Q CK R EC O G4 G3 G2 G Look-Up Table Carry & Control Logic O YB Y F4 F3 F2 F XB X Look-Up Table F5IN BY SR S Carry & Control Logic CIN CLK CE SLICE Carry & Control Logic

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

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

x y 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.9 ns for Spartan 3

.2 ns for Spartan 3 Carry Propagation Delay t BYP

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

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

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

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

Addition of a Constant

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

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

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

Incrementer x k- x k-2... x 2 x x c k HA HA.. HA HA Decrementer s k- s k-2... s 2 s x x k- x k-2... x 2 x x c k MHA MHA.. MHA MHA s k- s k-2... s 2 s x

Bit-Serial & Digit-Serial Adders

x i y i c i+ Bit-serial adder c start clk s i

x i y i d d c i+ Digit-serial adder c start clk d s i

Asynchronous Adders

Possible solutions to the carry propagate problem. 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 = ) 4 Probability of carry propagation = (x i y i = or ) 2 Probability of carry anihilation = (x i y i = or ) 2 j j-....... i+ i or or Probability of carry propagating from position i to position j = 2 j i probability of propagation 2 = probability of anihilation 2 j i

Expected length of the carry chain that starts at position i () Expected length(i, k) = j k = i ( j + i) 2 j i + ( k i) 2 k i 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) = 2 2 ( k i ) For i << k Expected length of the carry propagation is 2