---
# System prepended metadata

title: DPFP multiplier using verilog

---

### DPFP multiplier implementation
#### IEEE 754 Double Precision Multiplier
![image](https://hackmd.io/_uploads/BknmwwPygg.png)
#### Check special number
* $0$, $\pm \infty$, $\mathrm{NaN}$
    * $0$ : `Exponent == 0 && Mantissa = 0`
    * $\pm \infty$ : `Exponent == 0xFFF && Mantissa = 0`
    * $\mathrm{NaN}$ : `Exponent == 0xFFF && Mantissa != 0`

#### Operation description
1. Add Exponent:  $Exponent_1 + Exponent_2 - \text{bias}(127\ \text{or}\ 1023)$
2. **Multiply significant**
3. Calculate the sign : $Sign_1 \oplus Sign_2$
4. Normalize the result and check rounding
5. Round and renormalize if necessary

#### Binary Mutiplier
$A\times B =  10111011 \times 01101010$
![image](https://hackmd.io/_uploads/HJw4BGAJge.png)


#### Pipeline operation
![image](https://hackmd.io/_uploads/SJWEDGCJxl.png)

* 10 stages
    * AND : 1st stage
    * Step 1 -- In group addition : 2nd to 6th stage
    * Step 2 -- Grouping bits, then add : 7th to 8th stage
    ![image](https://hackmd.io/_uploads/SJ-vwz0Jlg.png)
    * Step 3 -- Check MSB : 9th stage
     MSB cannot be 0, if it is, shift left 1 bit
     ![image](https://hackmd.io/_uploads/BJXmOfRJgl.png)
    * Step 4 -- Handling exceptions : 10th stage
     ![image](https://hackmd.io/_uploads/rk70wGCJge.png)
