with m.Else():
m.d.sync += b_m[26].eq(1) # set highest mantissa bit
- # First stage of add
- with m.State("add_0"):
- m.next = "add_1"
- m.d.sync += z_e.eq(a_e)
- # same-sign (both negative or both positive) add mantissas
- with m.If(a_s == b_s):
- m.d.sync += [
- tot.eq(a_m + b_m),
- z_s.eq(a_s)
- ]
- # a mantissa greater than b, use a
- with m.Else(a_m >= b_m):
- m.d.sync += [
- tot.eq(a_m - b_m),
- z_s.eq(a_s)
- ]
- # b mantissa greater than a, use b
- with m.Else():
- m.sync += [
- tot.eq(b_m - a_m),
- z_s.eq(b_s)
+ # ******
+ # First stage of add
+
+ with m.State("add_0"):
+ m.next = "add_1"
+ m.d.sync += z_e.eq(a_e)
+ # same-sign (both negative or both positive) add mantissas
+ with m.If(a_s == b_s):
+ m.d.sync += [
+ tot.eq(a_m + b_m),
+ z_s.eq(a_s)
+ ]
+ # a mantissa greater than b, use a
+ with m.Else(a_m >= b_m):
+ m.d.sync += [
+ tot.eq(a_m - b_m),
+ z_s.eq(a_s)
]
+ # b mantissa greater than a, use b
+ with m.Else():
+ m.sync += [
+ tot.eq(b_m - a_m),
+ z_s.eq(b_s)
+ ]
return m
"""