© 2003 Xilinx, Inc. All Rights Reserved Looking Under the Hood.

Slides:



Advertisements
Similar presentations
© 2003 Xilinx, Inc. All Rights Reserved Course Wrap Up DSP Design Flow.
Advertisements

Microcomputer Systems 1
Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
EET 1131 Unit 7 Arithmetic Operations and Circuits
EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
COE 202: Digital Logic Design Signed Numbers
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Arithmetic Operations and Circuits
Parallel Adder Recap To add two n-bit numbers together, n full-adders should be cascaded. Each full-adder represents a column in the long addition. The.
CHAPTER 4: Representing Integer Data The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
Arithmetic Operations and Circuits
Number Systems Lecture 02.
© 2011 Xilinx, Inc. All Rights Reserved Intro to System Generator This material exempt per Department of Commerce license exception TSU.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
Simple Data Type Representation and conversion of numbers
ELEN 5346/4304 DSP and Filter Design Fall Lecture 12: Number representation and Quantization effects Instructor: Dr. Gleb V. Tcheslavski Contact:
Data Representation – Binary Numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
Binary Arithmetic Stephen Boyd March 14, Two's Complement Most significant bit represents sign. 0 = positive 1 = negative Positive numbers behave.
Simulink ® Interface Course 13 Active-HDL Interfaces.
Fixed-Point Arithmetics: Part II
Computer Architecture
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Simulink ® Interface Course 13 Active-HDL Interfaces.
© 2003 Xilinx, Inc. All Rights Reserved Answers DSP Design Flow.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
BR 8/99 Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to 255.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
© 2005 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU HDL Co-Simulation.
Tools - LogiBLOX - Chapter 5 slide 1 FPGA Tools Course The LogiBLOX GUI and the Core Generator LogiBLOX L BX.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
Digital Design Basics Analog vs Digital Why we need digital? Reproducibility, economy, programmability… Digital Devices Gates, FFs Combinational, sequential.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
© 2003 Xilinx, Inc. All Rights Reserved Course Wrap Up DSP Design Flow.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
Representing Integer Data
© 2003 Xilinx, Inc. All Rights Reserved Answers DSP Design Flow.
Addition, Subtraction, Logic Operations and ALU Design
Number Representation and Arithmetic Circuits
ECE 2110: Introduction to Digital Systems
Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Basic Xilinx Design Capture. © 2006 Xilinx, Inc. All Rights Reserved Basic Xilinx Design Capture After completing this module, you will be able.
CHAPTER 5: Representing Numerical Data
Addition and Subtraction
Integer Division.
CHAPTER 4: Representing Integer Data
Data Representation Data Types Complements Fixed Point Representation
King Fahd University of Petroleum and Minerals
ECEG-3202 Computer Architecture and Organization
1 The Hardware/Software Interface CSE351 Spring 2011 Module 3: Integers Monday, April 4, 2011.
Computer Architecture
ECE 352 Digital System Fundamentals
Computer Organization COMP 210
Presentation transcript:

© 2003 Xilinx, Inc. All Rights Reserved Looking Under the Hood

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only After completing this module, you will be able to: Objectives Understand what is happening behind the scenes and how your decisions can impact the quality of the result Use good design habits to achieve the best solution

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Outline Quantization and Overflow The Costs of Hardware of System Abstraction Bit Picking Tips for Good Designs Using System Generator

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Quantization and Overflow

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Quantization Occurs if the number of fractional bits is insufficient to represent the fractional portion of a value Users can choose to: –Truncate - Discard bits to the right of the least significant bit –Round - Round to the nearest representable value or to the value farthest from zero if there are two equidistant nearest representable values FIX_12_9 -Truncate - Round Full Precision FIX_12_

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Quantization A signed full precision number will have a different output depending on whether truncation or rounding is employed FIX_12_9 -Truncate - Round Full Precision FIX_12_

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Quantization An unsigned full precision number will have a different output depending on whether truncation or rounding is employed UFIX_12_9 -Truncate - Round Full Precision UFIX_12_

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Overflow Occurs if a value lies outside the representable range Users can choose to: –Saturate to the largest positive (or maximum negative) value –Wrap the value (i.e., discard any significant bits beyond the most significant bit in the fixed point number) –Flag an overflow as a Simulink error during simulation FIX_7_4 - Saturate (3.9375) - Wrap ( ) Full Precision output FIX_7_4 01 ( )

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Quantization and Overflow Whatever option is selected, the generated HDL model and Simulink model will behave identically This also means rounding and saturation will use FPGA resources

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Outline Quantization and Overflow The Costs of Hardware of System Abstraction Bit Picking Tips for Good Designs Using System Generator

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Every IP core has a wrapper to interface between Simulink and hardware Each SysGen block has an RTL VHDL wrapper to –Extend IP core functionality –Simplify IP core interface Support fixed-point arithmetic –Number of bits, binary point –Overflow and quantization –Valid bit control on some cores Note: a Simulink parameter may not be identical to the corresponding COREGen parameter Wrapper file will have xl in its filename without core keyword IP Wrappers xlMult.vhd MultGen v6.0 COREGen IP Core (xmult_x_0_core.vhd) SysGen VHDL IP Core Wrapper (xmult_x_0.vhd)

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Implications of IP Wrappers Saturation arithmetic and rounding requires hardware (full adder) Excess latency is implemented with a shift register (SRL16) on the core output Some SysGen blocks perform implicit conversion of inputs –Unsigned to signed –Sign extension –Zero padding –SysGen mask parameters may not be identical to COREGen parameters Valid bit pipeline parallels to the data path, typically implemented using SRL16 System level abstraction is very expressive and powerful, but comes at some expense in hardware. Be aware!

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Lab 6 Looking Under the Hood You are given a simple design of adder circuit: Make changes to a System Generator model to see what the results would be in hardware by changing saturation arithmetic and rounding Use the Resource Estimator block to estimate the resources usage in each case Use an RTL viewer to see the changes, and Use the Xilinx implementation results to determine the cost of these system-level decisions

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Outline Quantization and Overflow The Costs of Hardware of System Abstraction Bit Picking Tips for Good Designs Using System Generator

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Picking Bits: Why We Do It To combine two data buses together to form a new bus To force a conversion of data type including the number of bits and binary bits To reinterpret unsigned data as signed, or the converse To extract certain bits of data, especially when there is bit growth

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Xilinx Blocks Concat –Available in basic elements, data types, and index libraries Reinterpret –Available in basic elements, math, and index libraries Slice –Available in basic elements, control logic, data types, and index libraries Convert –Available in basic elements, data types, math, and index libraries

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Concat Block Performs a concatenation of two bit vectors Both inputs must be unsigned integers –i.e., two unsigned numbers with binary points at position zero Reinterpret block provides signed to unsigned conversion capabilities that can extend the functionality of the concat block Does not use Xilinx LogiCORE and hardware resources

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Convert Block The Xilinx convert block converts each input sample to a number of a desired arithmetic type –A number can be converted to a signed (twos complement) or unsigned value –Total number of bits and binary point are specified by the user –Rounding and quantization options apply to the output value –Does not use Xilinx LogiCORE but may use additional hardware depending on the overflow and quantization options

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Convert Block What is it doing? –User specifies the total number of bits, where the binary point is, and the arithmetic type (signed or unsigned) –First it lines up the binary point between input and output port types –Next, the total number of bits and binary point the user specifies are used, and depending if overflow and quantization options are used the output may change, as opposed to dropping bits

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Convert Block The following through the convert block would result in the same value using a different number of bits and binary point FIX_10_8 FIX_7_

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Convert Block Saturating the overflow may change the fractional number to get the saturated value Rounding the quantization may also affect the value to the left of the binary point (the whole number)

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Convert Block When we convert to a Fix_6_0, how do we get two different values? FIX_10_8 QUANTIZATIONOVERFLOW - Truncate - Round - Wrap - Saturate - Flag Error FIX_6_0 Round to decimal +2 Add ‘1’ to round Truncate to decimal +1 Drop the bits

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Reinterpret Block Forces its output to a new type without any regard for retaining the numerical value represented by the input Total number of bits in = total number of bits out Allows for unsigned data to be reinterpreted as signed data, and the converse Also allows scaling of the data through the repositioning of the binary point Does not use Xilinx LogiCORE and hardware resources

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Reinterpret Block Reinterpret the UFIX_10_8 number and force the binary point to position 5 FIX_10_8 FIX_10_

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Slice Block The Xilinx slice block allows you to slice off a sequence of bits from your input data and create a new data value The output data type is unsigned with its binary point at zero

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only The Slice Block Take a slice of the FIX_10_8 number by taking a 4-bit slice and offsetting the bottom bit of the slice by 5 bits Upper Bit Location + Width: Offset of top bit from MSB = 0 and width = 4 Two Bit Locations: Offset of top bit from MSB of Input = -1 and Offset of Bottom bit from LSB of Input =

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only What Values Do You Expect? Signed Data Truncate and Wrap Signed Data Output Binary Point of 3 Total Number of Bits 3 Bottom Slice offset by 5 from the LSB

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only Outline Quantization and Overflow The Costs of Hardware of System Abstraction Bit Picking Tips for Good Designs Using System Generator

Looking Under the Hood © 2003 Xilinx, Inc. All Rights Reserved For Academic Use Only SysGen Design Tips Remember that saturation arithmetic and rounding have area and performance costs. Use only as necessary Register inputs and outputs, and register (rather than ignore) invalid data when possible