Verilog Project Report
Verilog Project Report
<Dhaval_Sanepara>
<Riya_Patel>
<Shrushti_Boraniya>
<Group 4>
PROJECT STATEMENT
Design a Floating point Arithmetic
FUNCTIONAL SPECIFICATIONS
Introduction
Floating-point units (FPU) colloquially are a math coprocessor which is designed
specially to carry out operations on floating point numbers. Typically FPUs can handle
operations like addition, subtraction, multiplication and division. FPUs can also
perform various transcendental functions such as exponential or trigonometric
calculations, though these are done with software library routines in most modern
processors.
Floating Point Arithmetic represent a very good compromise for most numerical
applications.
Basic Concept
The term floating point implicates that there is no fixed number of digits before and
after the decimal point; i.e. the decimal point can float. Floating-point representations
are slower and less accurate than fixed-point representations, but can handle a larger
range of numbers. Because mathematics with floating-point numbers requires a great
deal of computing power, many microprocessors come with a chip, called a floating
point unit (FPU), specialized for performing floating-point arithmetic.
FPUs are also called math coprocessors and numeric co- processors. Usage of binary
numeration and powers of 2 resulted in floating point numbers being represented as
single precision (32-bit) and double precision (64-bit) floating-point numbers.
4 Project Report - <Floating Point Arithmetic>
The floating point numbers representation is based on the scientific notation: the
decimal point is not set in a fixed position in the bit sequence, but its position is
indicated as a base power.
• Overview
Standard IEEE 754 specifies formats and methods in order to operate with
floating point arithmetic. These methods for computational with floating point
numbers will yield the same result regardless the processing is done in hardware,
software or a combination for the two or the implementation.
IEEE 754 specifies four different formats to representing the floating point values:
• Simple Precision (32 bits)
• Double precision (64 bits)
• Simple Extended Precision (≥43 bits but not too used)
• Double Extended Precision (≥79 bits, usually represented by 80)
System Diagram
WORKING
Floating-point Addition/Subtraction
Given two floating-point numbers, the sum is
(F 1 x 2 E1 ) + (F 2 x 2 E2 ) = F x 2 E
Addition:
AS
ES
BS EX1=EX2 CS
FS HS
ADDER
DS GS
OUTPUT
Subtraction:
AS
ES
EX1=EX2
BS CS
FS
Subtractor HS
DS GS
OUTPUT
1) The Data in1 and Data in2 both are fed to the hardware ALU.
2) When whole data of 32 bits is filled then the signals full1 and full2 will get high.
After that the rest of the state goes high.It will move to AS state.
3) In AS state comparison of exponent is done and it will move to ES sstate.
4) When the EXP1=EXP2 are equal then it will pass to FS state
5) when EXP1>EXP2 it will pass to BS state.
6) When EXP<EXP2 it will pass to CS state.
7) The state BS and CS state will multiply the mantissa by 10 each time the loop is
executed.
8) the output of BS and CS process goes to FS
9) FS State will get the new data and main data (nmd,ndc) and will perform the
required operation.
10) Subtraction is performed in the DS state.
8 Project Report - <Floating Point Arithmetic>
11) If the value is negative then 2's complement is done in the successive stage
and the output data is transferred to IEEE 754 Standard.
12) The final data output is achieved in the HS State.
• Floating-point Multiplication
In this designed the single-precision multiplier for floating-point numbers. Use 23
bit fractions and 9 bit exponents, with negative numbers represented in 2’s
complement.
Given two floating-point numbers, the product is
(F 1 ×2 E1 ) × (F 2 × 2 E2 ) = (F 1 × F 2 ) × 2 (E1+E2) = F × 2 E
aluin1 aluin2
MAS
Multiplier
MBS
Overfow
MCS
out
• Floating-point Division
In this designed the single-precision divider for floating-point numbers. Used 23 bit
fractions and 9 bit exponents, with negative numbers represented in 2’s
complement.
Given two floating-point numbers, the product is
(F 1 ×2 E1 ) ÷ (F 2 × 2 E2 ) = (F 1 ÷ F 2 ) × 2 (E1-E2) = F × 2 E
aluin1 aluin2
DAS
EX1 - EX2
UnderFlow
DBS
Divider
DCS out
• NOTE:
The fraction part of the division is the division of fractions, and the exponent part
of the division is the subtraction of exponents. Assumed that F 1 and F 2 are
properly normalized; if they are not normalized than first normalize the fraction
part of division.
SIMULATIONS
data:
-5x 1062 and 225 x 1056
ADD:
SUB:
data:
-500x 1062 and -225 x 1056
MUL:
data:
-500x 1062 and -225 x 1062
DIV:
data:
-500x 1062 and -225 x 1062
RTL SCHEMATIC
REFERENCES
[1] Floating Point Arithmetic Unit Using Verilog--Lalita Gangwar 1 and Rajan
Chaudhary 2_1,2 Department of Electronics and Communication, Future Institute of
Engineering and Technology_Bareilly, India.
[5] AN EFFICIENT IEEE 754 COMPLIANT FLOATING POINT UNIT USING VERILOG__A
Thesis Submitted For The Partial Fulfilment Of Requirements For Degree Of Bachelor Of
Technology IN Computer Science and Engineering BY LIPSA SAHU (108CS038) & RUBY
DEV (108CS069)__DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
NATIONAL INSTITUTE OF TECHNOLOGY ROURKELA_ROURKELA - 769008, INDIA