Docsity

IEEE Floating Point Adder Verification: Design and Exponent Unit Processing, Slides of Verilog and VHDL

Partial preview of the text

Download IEEE Floating Point Adder Verification: Design and Exponent Unit Processing and more Slides Verilog and VHDL in PDF only on Docsity!

IEEE Floating Point Adder

Verification

Using the IEEE Floating Point

Standard for an add/subtract

execution units

Lecture overview

  • The Interface
  • Part by part
  • A floating point adder design
  • Verifying the design

The partitioning of the design

  • From adjusting the inputs to prepare to add
  • To add
  • To renormalize
  • To round

INPUT LATCHES

Add Mantissas Normalize Result

RESULT LATCHES OUTPUT DRIVERS

Input Adjust

A/S

Round according to selected scheme

The first section

  • Prepare to add
  • Identify type of inputs and appropriately adjust operands

Processing^ MantissaLogic

Amantissa Bmantissa

M>M=M<MA0MB 0 EA0•MA0 (^) selR^ EA0 & Aman L 2-1 Mux^ Aman & 0 R^ EB0 & Bman Bman & 0 EB0•MB E>+(E=•M>) Swap 2x2 crossbars elements

selR L 2-1 Mux R

EA1+EB1 selR L 2-1 Mux R^ "Zero"^ selR L 2-1 Mux R"Nan" Cntrl Eq Shift Dist LinearShifter^ Right SignA xor SignB^ selR^ L^ 2-1 Mux^ R ADDER

ProcessingExponentLogic

Aexp Bexp

Larger Exp Shif t DistE>E=E<EA0EA1EB 0EB 1 (to Norm Unit)

Asign Bsign

2-1Mux (^) (E> + (E=•M>)) Sign Out (63)to output latch

Adder Output (to normalize unit)

Code for this section - behavioral

  • Most of code is

generation of

various signals and

movement of data

in muxes

--expgt <= '1' when (expa > expb) else '0';expeq <= '1' when (expa = expb) else '0'; explt <= '1' when (expa < expb) else '0';expa0 <= '1' when (expa = zeroexp) else '0';expa1 <= '1' when (expa = oneexp) else '0'; expb0 <= '1' when (expb = zeroexp) else '0';expb1 <= '1' when (expb = oneexp) else '0';shiftdist <= expdist (expa,expb); larger_exp <= expa when (expa >= expb) else expb;--mangt <= '1' when (mana > manb) else '0'; maneq <= '1' when (mana = manb) else '0';manlt <= '1' when (mana < manb) else '0';mana0 <= '1' when (mana = zeroman) else '0'; manb0 <= '1' when (manb = zeroman) else '0';--adenorm <= expa0 and (not mana0); bdenorm <= expb0 and (not manb0);lshfa(52 downto 1) <= mana; lshfa (0) <= '0';lshfb(52 downto 1) <= manb; lshfb(0) <= '0'; lxbarin <= lshfa when (adenorm = '1') else ((not expa0) & mana);rxbarin <= lashb when (bdenorm = '1') else ((not expb0) & manb);-- swap <= expgt or (expeq and mangt);xbar_r <= lxbarin when (swap = '1') else rxbarin;xbar_l <= rxbarin when (swap = '1') esle lxbarin; --in_mux_r_man <= expa1 and mana0 and expb1 and manb0 and(signa xor signb); in_mux_r <= nan_man when (in_mux_r_nan = '1') else xbar_r;-- in_mux_l_zero <= expa1 or expb1;in_mux_l <= zero_man when (in_mux_l_zero = '1') else xbar_l;-- shifted_sig <= shift (shiftdist, in_mux_l);-- twoscomp <= signa xor signb;ladderin <= '0' & shifted_sig when (twoscomp = '0') else'1' & (not shifted_sig); radderin <= '0' & in_mux_r & "0000";--adder_out <= add (ladderin, radderin, twoscomp);

Exponent Processing

Mantissa Processing Expanded NormalizedForm XBar to place larger# on right path Hard Code Nan Hard Code Zero Shift smaller A+B or A+(-B)? Binary Add

Renormalization Unit

  • Have exponent and mantissa to deal with.

4 to 1 Mux^ 5 to 1 Mux

detect all 1's

+1 incrementer (^) detect all 0'sAdder

0 & value^ 6lsb

000000 & value

zero

UF all all

inverters

Right Shift 1^ Right Shift 1

Linear^ Left Shifter

Result Signal Generation

zero

UF 2-1 Mux

1st2nd XX.XXXXXX---> Ld1pos^ fract

Larger Exponent Adder Output

c1c2c3 1 2 3 4 5 c5c

c1c2c c

1 2 3 4

exp_norm man_norm

To test (verify) the design

  • Must test for normal operation and boundary conditions
  • Will check A by B
    • NaN NaN
    • +/- infinity +/- infinity
    • +/- 0 +/- 0
    • Denorm Denorm
    • Norm Norm
  • For both direct and all crossed pairings

Boundary conditions

  • Wish to check several boundary conditions
    • Denorm + Denorm = Max Denorm
    • Denorm + Denorm = Min Norm
    • Norm – Norm = Max Denorm
    • …
    • Rounding using first guard bit
    • Rounding using 1st^ and 2nd^ guard bits
    • …

Scan of entire architecture

Scan of the chip

And then a final verification report

  • Details of implementation of the verification

plan.

  • What vectors were applied.
  • Test that failed
  • Detail of issues in the DUT that require fixing
  • Details on how the test vectors were generated.
    • Many be in programs other than HDL.