m.next = next_state
# denormalised, correct exponent to zero
with m.If(z.is_denormalised()):
- m.d.sync += z.m.eq(z.N127)
+ m.d.sync += z.e.eq(z.N127)
# FIX SIGN BUG: -a + a = +0.
with m.If((z.e == z.N126) & (z.m[0:] == 0)):
m.d.sync += z.s.eq(0)
sys.exit(0)
def testbench(dut):
+ yield from check_case(dut, 0x82471f51, 0x243985f, 0x801c3790)
yield from check_case(dut, 0, 0, 0)
yield from check_case(dut, 0x40000000, 0xc0000000, 0x00000000)
yield from check_case(dut, 0x3F800000, 0x40000000, 0x40400000)