# ADDER8 (Half adder) # Half adder: 8 bits adder from reducing a 9-bits adder to 8 bits # Input: a7, a6, a5, a4, a3, a2, a1, a0, b7, b6, b5, b4, b3, b2, b1, b0 # Output: y8, y7, y6, y5, y4, y3, y2, y1, y0 #equivalent to: for i in expand("a<7:0>;b<7:0>"): # Gate(i, type="inp") GATE("a<7:0>;b<7:0>", type="inp") GATE("y<8:0>", type="out") GATE("g0", type="zero") GATE("ad9", type="adder9") WIRE("a<0:7>", "ad9/a<0:7>") WIRE("b<0:7>", "ad9/b<0:7>") WIRE("ad9/y<0:8>", "y<0:8>") WIRE("g0", "ad9/a8") WIRE("g0", "ad9/b8") WIRE("g0", "ad9/cin")