This assignment exercise the basic notions of Verilog by implementing complex sequential circuits. You will:
Floating point has a long history in the engineering field and in computer science. The promoter was Leonardo Torres Quevedo back in 1914; nowadays, we use IEEE754 Standard Implementation. Wiki The assignment consists in implementing a floating point multiplication algorithm for 2 numbers with the following format (S_EEEE_MMMMMMM):
The implementation can follow the proposed state machine: Because we encounter a multiplication of fixed point (mantissa), we should implement a dedicated module responsible for this operation. The Booth algorithm is a suitable option which reduces the complexity but keeps a good understanding behind. The size of the operands is dependent on the size of the mantissa.
Requirements:
In order to implement the requirements, you shall build a finite state machine to divide the operations executed per clock cycle. This automata communicates with additional modules with determined behavior. The detailed implementation for each module is described below.
Finite state machine to be implemented, this module also acts as a top module for the design (the one that have all the additional modules instantiated in it).
This module respects the following interface:
module floating_point_fsm( input clk, input rst, input en, input [11:0] a, input [11:0] b, output reg done, output [11:0] out );
The signals' description for this module is:
clk
- clock signal;rst
- reset signal - used to bring the module back to it's initial state;en
- when this signal asserts, it marks the valid information for a and b in the next clock cycle;a
- value for the first operand, expressed in sign_exponent_mantissa;b
- value for the second operand, expressed in sign_exponent_mantissa;done
- 1 when the result is ready;out
- the result of the multiplication;
output reg
is allowed for this module.
The module functionality is:
a
and b
in their corresponding registers after the en
signal gets asserted.out
; when out
is available, done
shall be one, to signalize that the out
is available for the outside modules to be used.
We already have the input (A
and B
) and output (RES
) registers instantiated inside and also an auxiliary register for saving the multiplication result (MUL
) with their control signals for writing and reading and the proper connections with the environment, except the ones with the booth_mul
.
This module actively used the booth_mul
module to perform any multiplication operations needed.
Implements the Booth multiplication algorithm applied on 2 8bit numbers. This module uses combinational logic - the result is available as soon as the inputs change.
This module respects the following interface:
module booth_mul( input [7:0] op1, input [7:0] op2, output [15:0] result );
The signals' description for this module is:
op1
- holds the operand 1;op2
- holds the operand 2;result
- holds the result;
output reg
is allowed for this module.
The module functionality is:
result
every time a
or b
changes.
booth_mul
module for implementing the FSMRemember that you have an error counter already implemented in each testcase inside the project files, which tells you exactly when an error is detected. However, do not count on that; the project evaluation is done manually, after analyzing the code and the anti-plagiarism report.
Even if you do not finish the assignment, you can receive up to 25% of the grade if you properly explain your idea in the README file. Your code must pass the compilation and run.