Design and Implementation of Floating Point ALU With Parity Generator Using Verilog HDL
Design and Implementation of Floating Point ALU With Parity Generator Using Verilog HDL
(Asst. Professor, Electronics and Communication Engineering, S.I.E.T Vijayapur, Karnataka, India)
2
(Asst. Professor, Electrical and Electronics Engineering, S.I.E.T Vijayapur, Karnataka, India)
Abstract: A floating-point unit (FPU) colloquially is a math coprocessor, which is a part of a computer system
specially designed to carry out operations on floating point numbers. Typical operations that are handled by
FPU are addition, subtraction, multiplication and division. The functions performed are handling of Floating
Point data, converting data to IEEE754 format, perform any one of the following arithmetic operations like
addition, subtraction, multiplication, division . All the above algorithms have been evaluated under Modelsim
environment. All the functions are built by possible efficient algorithms with several changes incorporated at
our end as far as the scope permitted. Consequently all of the unit functions are unique in certain aspects and
given the right environment these functions will tend to show comparable efficiency and speed ,and if pipelined
then higher throughput.
Keywords: Floating, Algorithm, coprocessor, pipelined, throughput.
I. Introduction
In computing, an arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and logical
operations. The ALU is a fundamental building block of the central processing unit (CPU) of a computer, and
even the simplest microprocessors contain one for purposes such as maintaining timers. The processors found
inside modern CPUs and graphics processing units (GPUs) accommodate very powerful and very complex
ALUs; a single component may contain a number of ALUs. ALU is a necessity for a computer because it is
guaranteed that a computer will have to compute basic mathematical operations, including addition, subtraction,
multiplication, and division.
Fig1:General ALU
II.
DOI: 10.9790/4200-05515459
www.iosrjournals.org
54 | Page
Design and Implementation of Floating Point ALU with Parity Generator Using Verilog HDL
2.2 Floating point ALU Model
www.iosrjournals.org
55 | Page
Design and Implementation of Floating Point ALU with Parity Generator Using Verilog HDL
Operation
Add
Subtract
Multiply
Divide
Shifting
www.iosrjournals.org
56 | Page
Design and Implementation of Floating Point ALU with Parity Generator Using Verilog HDL
Set the overflow flag to 1
If for any operand (sign(operand with exponent)==1'b1 AND (exp_lesser>8'd255))
Set the underflow flag to 1
Step 5: Aggregate the result as concatenation of {Sign_bit,Resultant_exponent,diff}
3.6 Multiplication Module
The process of developing an efficient multiplication module was iterative and with gradual
improvement at each attempt. The product of two n-digit operands can be accommodated in 2n-digit operand.
3.6.1multiplication Using * Operator
It used a 47 bit register to store the product. The algorithm is explained
Step 1: Check if oper = 4.b0010
Step 2: product = Temp_op1_ieee[22:0] * Temp_op2_ieee[22:0]
Step 3: Resultant_exponent = op1_ieee[30:23] + op2_ieee[30:23] - 127
Step 4: If for product ( Resultant_exponent >255 ), then do,
. Set the overflow flag to 1
Step 5: Sign_bit = op1_ieee[31] ^op2_ieee[31]
Step 6: Aggregate the result as concatenation of { Sign_bit, Resultant_exponent, product }
3.7 Module Division
Division is regarded as the most complex and time-consuming of the four basic arithmetic operations.
Given two inputs, a dividend and a divisor, division operation has two components as its result, quotient and a
remainder.
3.7.1 Division Using ./. Operator
The initial attempt was to divide two numbers using the simple in-built / operator available in
Verilog library. It used a 32 bit result_div_ieee register to store the quotient and register remainder to store the
remainder of the division operation.
Step 1: Check if the oper = 4 bit 0100
Step 2: result_div_ieee = temp_op1_ieee[22:0] / temp_op2_ieee[22:0]
Step 3: If op2_ieee[30:0] is all 0
. Set div_bby_zero flag to 1
Step 4: Aggregate the result as concatenation of {Sign_bit, Resultant_exponent, result_div_ieee}
www.iosrjournals.org
57 | Page
Design and Implementation of Floating Point ALU with Parity Generator Using Verilog HDL
calculations we need two operands but in a microprocessor there is only one databus, and we have to multiplex
this databus. If selop is 000, it is considered as first operand and if selop have any other values, then the operand
that present at that time is considered as the second operand.
Selop
000
001
010
011
100
101
110
111
Operation
Select operand a
Add operand a and b
Subtract operands a and b
Multiply operands a and b
Divide operands a and b
Logically NOT operand a
Logically NAND operand a and b
Shift right the operand a
DOI: 10.9790/4200-05515459
www.iosrjournals.org
58 | Page
Design and Implementation of Floating Point ALU with Parity Generator Using Verilog HDL
V. Simulation Results
VI. Conclusion
Hence, Floating Point ALU is successfully designed and implemented by using verilog description
language and simulated using modelsim6.3g version. The addition of two floating point numbers are determined
by showing separately sign,exponent,mantissa.
References
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
DOI: 10.9790/4200-05515459
www.iosrjournals.org
59 | Page