This project implements a 32-bit Floating Point Arithmetic Logic Unit (FP-ALU) using Verilog HDL, compliant with the IEEE-754 single-precision format. The design supports core arithmetic operations including:
- Addition
- Multiplication
- Division
The architecture is modular, synthesizable, and verified using a self-checking testbench.
The top-level module integrates three independent floating-point units:
fp_adderfp_multiplierfp_divider
All units operate in parallel, and a multiplexer selects the output based on the operation code.
| op_code | Operation |
|---|---|
| 00 | Addition |
| 01 | Multiplication |
| 10 | Division |
-
FSM-based multi-cycle design
-
Stages:
- Operand alignment
- Addition/Subtraction
- Normalization
-
Handles:
- NaN
- Infinity
- Zero
-
Limitations:
- No rounding logic
- Incomplete normalization for subtraction
-
3-stage FSM design:
- Initialization
- Mantissa multiplication
- Normalization
-
Uses 24×24-bit multiplication
-
Handles special cases:
- NaN
- Infinity × Zero
-
Limitations:
- No rounding (truncation used)
- No denormal handling
-
Multi-cycle FSM with restoring division
-
Performs iterative mantissa division (24 cycles)
-
Handles:
- Divide-by-zero
- NaN
- Infinity
-
Limitations:
- Incomplete normalization
- No rounding support
- Denormals not supported
- Inputs (
op_a,op_b) are fed to all units in parallel - Each unit computes independently
- Output is selected using
op_code - Results are registered for timing stability
| Bit | Description |
|---|---|
| 0 | Invalid Operation |
| 1 | Divide by Zero |
| 2 | Overflow |
| 3 | Underflow |
| 4 | Inexact |
- Self-checking testbench
- Task-based stimulus generation
- Automatic PASS/FAIL reporting
- Waveform dumping (VCD)
- Basic arithmetic operations
- Zero handling
- Infinity operations
- NaN propagation
- Overflow conditions
- Sign combinations
SDC constraint used:
create_clock -period 10.000 -name clk -waveform {0 5} [get_ports clk]
- Clock frequency: 100 MHz
- Duty cycle: 50%
- Verilog HDL
- AMD Vivado (Simulation & Synthesis)
| Feature | Description |
|---|---|
| Data Width | 32-bit IEEE-754 |
| Architecture | Modular FSM-based |
| Execution Type | Multi-cycle |
| Parallel Units | Yes |
| Output Register | Yes |
- DSP systems
- Scientific computation
- Embedded processors
- Hardware accelerators
This project demonstrates a modular and scalable floating-point ALU design using Verilog, covering key arithmetic operations with FSM-based control. While functionally correct for most standard cases, further enhancements are required for full IEEE-754 compliance and high-performance applications.