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

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.
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.
9/15/09 - L26 Shift RegistersCopyright Joanne DeGroat, ECE, OSU1 Shift Registers.
Computer Architecture Lecture 22 Fasih ur Rehman.
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.
Number Representation and Arithmetic Circuits
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
2.4. Floating Point Numbers
Integer Division.
Modification that can be done to the datapath.
Floating Point Number system corresponding to the decimal notation
William Stallings Computer Organization and Architecture 7th Edition
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
Project Step 2 – A single bit slice of the ALU
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
Behavioral modeling of a dual ported register set.
The IEEE Floating Point Standard and execution units for it
Project Step 2 – A single bit slice of the ALU
A floating point multiplier behavior model.
Copyright Joanne DeGroat, ECE, OSU
Beyond the ALU and Datapath. Sequential Machine Modeling exercise.
Project Step 2 – A single bit slice of the ALU
Lecture 9: Shift, Mult, Div Fixed & Floating Point
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 cycle 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. 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 will need to be renormalized 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 and repeat for each successive bit to the msb 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 +1 to exponent giving 01.xxxxx 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 your 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 Probably easiest to do a binary to integer conversion at the start for the exponent. Then Exp_res = Exp_a + Exp_b – 127 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 denormalized number or underflow When in the 1 to 254 range do an integer to binary conversion 1/8/2007 - L25 Project Step 10 - Floating Point Adder Copyright 2006 - Joanne DeGroat, ECE, OSU