A floating point multiplier behavior model.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
EE694v-Verification-Lect6-1- Lecture 6 - Writing Tests A difference if treating the design as a black box or if you have access to internal signals EE762.
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Floating Point Numbers
COE 308: Computer Architecture (T041) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (Appendix A, Computer Architecture: A Quantitative Approach,
ECEN 248 Integer Multiplication, Number Format Adopted from Copyright 2002 David H. Albonesi and the University of Rochester.
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
Data Representation – Binary Numbers
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Computer Arithmetic Nizamettin AYDIN
Computer Architecture Lecture 3: Logical circuits, computer arithmetics Piotr Bilski.
Number Systems II Prepared by Dr P Marais (Modified by D Burford)
Computer Arithmetic.
ECE232: Hardware Organization and Design
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
EE694v-Verification-Lect11-1- Lect : The FP adder test plan As noted earlier – there is a difference in black box and while box testing and verificiation.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Oct. 18, 2007SYSC 2001* - Fall SYSC2001-Ch9.ppt1 See Stallings Chapter 9 Computer Arithmetic.
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
Computer Arithmetic See Stallings Chapter 9 Sep 10, 2009
EE694v-Verification-Lect6-1- Lecture 6 - Writing Tests A difference if treating the design as a black box or if you have access to internal signals EE762.
1/8/ L25 Floating Point Adder Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point Adder Using the IEEE Floating Point Standard for an.
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
Floating Point Representations
2.4. Floating Point Numbers
Computer Architecture & Operations I
Integer Division.
Lecture 9: Floating Point
Modification that can be done to the datapath.
Floating Point Number system corresponding to the decimal notation
Arithmetic for Computers
Behavioral modeling of a dual ported register set.
Luddy Harrison CS433G Spring 2007
Integers in 2’s compliment Floating point
CSCE 350 Computer Architecture
The IEEE Floating Point Standard and execution units for it
CSCI206 - Computer Organization & Programming
Modification that can be done to the datapath.
How to represent real numbers
ECEG-3202 Computer Architecture and Organization
Copyright Joanne DeGroat, ECE, OSU
Copyright Joanne DeGroat, ECE, OSU
L25 – Datapath ALU.
Copyright Joanne DeGroat, ECE, OSU
IEEE Floating Point Adder
A floating point multiplier behavior model.
Chapter 8 Computer Arithmetic
Beyond the ALU and Datapath. Sequential Machine Modeling exercise.
IEEE Floating Point Adder Verification
Copyright Joanne DeGroat, ECE, OSU
A floating point multiplier behavior model.
Behavioral modeling of a dual ported register set.
The IEEE Floating Point Standard and execution units for it
Structural Modeling and the Generate Statement
Copyright Joanne DeGroat, ECE, OSU
Beyond the ALU and Datapath. Sequential Machine Modeling exercise.
Lecture 9: Shift, Mult, Div Fixed & Floating Point
Structural Modeling and the Generate Statement
Presentation transcript:

A floating point multiplier behavior model. Project Step 10 A floating point multiplier behavior model. 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Model of a floating point multiplier This exercise will once again be a high level behavioral model. The code style will be algorithmic yet you will be working with the 32-bit data words. As it is high level it is not intended for synthesis, rather as a reference model for the design. It would be used to generate the reference output of the model that would be used for synthesis 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Where to start? THE INTERFACE!!! Very simple 2 Data inputs A and B 32-bits each in IEEE single precision A latch signal to latch the inputs A drive signal to latch the outputs A results output C that is also IEEE single precision and 32-bits 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Interface timing Similar to other designs. However, now 2 distinct cycles The load cycle The drive cycle 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Recommended step 1 Get the interface working Once you can pass the input straight to the output start the algorithm This is a major step as you will be using a package that reads the test vectors from a file. 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Reading from the file The procedure is already compiled and in a package in LIBRARY ASSIGN that is located in directory ~degroat/ee762_assign The procedure is hardcoded to read the vectors from the file fpm_vectors in this directory. You can see the vector file and copy it, but it will use the vectors in my file. You will need to map to this library. You will not be able to see the code of concurrent procedure gen_vec which generates the test vectors and checks the result. This assignment needs to be simulated on the workstations to map to the shared library. 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Mapping to the library The library name will be ASSIGN The testbench has a clause USE ASSIGN.fpm_test_vect.all This procedure uses STD.TEXTIO.ALL for the file operations (info only) In Modeltech you need to map to this library /rcc4/homes/degroat/ee762_assign/assign Testbench also has a signal yourname 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

The rest of the algorithm As this is behavioral it is easy to use if/else to handle all the special cases NaN by all the other class results in NaN IF (Ain=NaN or Bin=Nan) THEN out=NaN ELSE Only time you have to actually manipulate bits is for the Normalized x Normalized or Denormalized. 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Manipulate bits Need to do a multiplication of the mantissas x.xxxxx… x.xxxxx… where each is 24 bits xx.xxxxx… giving 48 bit result which needs to be renormalized – Note the position of the binary point in the result. Range of input is [0…2) i.e. from and including 0 to 2 but not including 2 Range of output is [0…4) which means you need to be aware of all the bits of the output 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Note on doing multiplication This is a behavioral model Several possible approaches to actually do the multiplication One method – shift and add Initialize a result vector (48-bits) to 0 Place the multiplicand into the least significant 24 bits of another 48-bit vector called prod_term. Start with the lsb of the multiplier (located in a 24-bit register) and repeat for each successive bit to the msb is reached If the bit of the multiplier is a 1 add the prod_term to the result. Shift the prod_term 1 to the left with a 0 input as the lsb, i.e., x 2 Repeat Output the result vector 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Renormalization of result If result is in form 1x.xxxx Shift right on fixed binary point and add 1 to the exponent giving 01.xxxxx as the mantissa If result is in form 01.xxxx your are OK as is If result is in form 00.00…1xxxx must shift left on fixed binary point until the leading 1 is to the left of the binary point, taking -1 from the exponent each time Then look at exponent 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Handling the exponent As this is a behavioral model it is probably easiest to do a binary to integer conversion right at the start for the exponent. Then Exp_res = Exp_a + Exp_b – 127 As both exponents are biased After renormalization exponent must be between 0 and 255. Adjust a necessary. If >255 you have overflow to infinity. If negative or 0 then you probably have a de-normalized number or underflow. In this case you will have to right shift the result on a fixed binary point, adding one to the exponent each time until the exponent reaches 0. If any bits in the fractional part are a 1 it is a denomalized number. If all 0 now, you have an underflow. When in the 1 to 254 range do an integer to binary conversion for the exponent of the result to construct the final output. 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU