Professional Documents
Culture Documents
Report on
1. Introduction
The Aim of the project is to design a floating-point multiplier in VHDL and implement the design
in Xilinx FPGA. As like in a micro controller we can’t handle floating point number as such. Since
FPGAs are works on bit level it is intended to study the standard representation of floating-point
notations used in bit level.
2. Representation of Floating-Point Numbers
A simple representation of a floating-point (or real) number (N) uses a fraction (F), base (B), and
exponent (E), where N = F X BE. The fraction and the exponent can be represented in many
formats. For example, they can be represented by 2’s complement formats, sign-magnitude
form, or another number representation. There are a variety of floating-point formats
depending on how many bits are available for F and E, what the base is, and how negative
numbers are represented for F and E. The base can be implied or explicit. In this project we have
chosen IEEE 754 Floating point representation and customized it to 16 bit significant and 8 bit
exponent, total 24 bit.
1
AJEESH A SUMIT SATPUTE
Floating-point multiplication unit with 16-bit significant and 8-bit exponent
The real value assumed by a given 32-bit data with a given biased exponent e and a 23-bit
fraction is
Value = (-1) sign (1+∑23 -i
𝑖=1(𝑏-i) 2 ) X 2
(e-127)
Here the 1 in the summation part (given in red) is not explicitly used in significant part.
It is hidden
The single precision binary floating point is encoded using an offset binary representation with
zero offset being 127 also known as the Exponent Bias (e) . So that the exponent can be
represented as unsigned binary format. The standard treats zero and infinity as follows
If the exponent is zero the value of the floating-point number is zero
If the exponent is FFH then the value of the floating-point number is +/- infinity.
As an example
0x41258794 = (0 10000010 01001011000011110010100)2 = 10.3456
0xc1a45810 = (1 10000011 01001000101100000010000)2 = – 20.543
5. Floating point representation using 24-bit format – 16 bits significant and 8 bit exponent
Let X3 = X1.X2
X3 = (-1) s1(M1x2E1) * (-1) s2(M2x2E2)
X3 = (-1)s3(M3x2E3)
7. Algorithm flow
1. The sign bit S3 = S1 XOR S2;
2. The Mantissa M3 is found by multiplying M1 and M2 with the hidden ‘1’ padded to M1
and M2.
M3_int = 1.M1*1.M2;
1.M1 => 16 bits
1.M2 =>16 bits
2
AJEESH A SUMIT SATPUTE
Floating-point multiplication unit with 16-bit significant and 8-bit exponent
8. Implementation
The above algorithm is implemented in VHDL and targeted for Xilinx Artix-7 XC7A35T-
ICPG236C FPGA.The Multi plier and Multiplicand are loaded in to the Floating-point
multiplier in the above-mentioned format when ‘load’ signal is High. Then in the next clock
cycle the normalized mantissa is calculated. Then in the third clock cycle the exponent and
result is calculated.
A flow diagram of the circuit is as shown in figure.
FP_MUL
load
clk
rst
The design is tested for various values and verified with a IEEE754 converter from on line
https://www.h-schmidt.net/FloatConverter/IEEE754.html .
3
AJEESH A SUMIT SATPUTE
Floating-point multiplication unit with 16-bit significant and 8-bit exponent
RESET
Count=0;
Result= X”000000” rst=0
i
If (load = ‘1’ and Count=0)
load multiplier and multiplicand, M1
and M2; Count= count +1; load=0
i
If (Count=1) exp: of result =X”FF”, count
i Calculate sign bit; =0;
i
Calculate mantissa_interm = 1&M1 *1&M2
Count = count +1
i
Calculate exponent
result(22 downto 15)<=
i
multplr(22 downto 15)+multplcnd(22 downto 15)-127+ mantissa_interm(31) ;
result = upper 15 bit of normalized mantissa_interm(31)
Count = 0;
4
AJEESH A SUMIT SATPUTE
Floating-point multiplication unit with 16-bit significant and 8-bit exponent
13. Conclusion
The Floating-point multiplier is designed in 24-bit format. The Multiplier is capable of handling
floating point multiplication in all cases. It explicitly handles zero and infinity also. For high
modulus values it is found that the precision decreases. To increase the resolution, it is suggested
to increase the number of bits from 24. The design is tested with 50 MHz clock frequency. Once
the data is loaded, the result will be available in the second clock cycle.
References
1. “Computer Architecture A Quantitative Approach”. By John L Hennessy & David A Patterson
3. https://www.rfwireless-world.com/Tutorials/floating-point-tutorial.html
4. https://steve.hollasch.net/cgindex/coding/ieeefloat.html
5
AJEESH A SUMIT SATPUTE