@BE1

@invar
 (A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 A8 B8)

@sub
CAR1 = 
(AND A1 B1)
CAR2 = 
(OR (AND (OR A2 B2) CAR1) (AND A2 B2))
CAR3 = 
(OR (AND (OR A3 B3) CAR2) (AND A3 B3))
CAR4 = 
(OR (AND (OR A4 B4) CAR3) (AND A4 B4))
CAR5 = 
(OR (AND (OR A5 B5) CAR4) (AND A5 B5))
CAR6 = 
(OR (AND (OR A6 B6) CAR5) (AND A6 B6))
CAR7 = 
(OR (AND (OR A7 B7) CAR6) (AND A7 B7))

@out
SOM1 = 
(EXOR A1 B1)
SOM2 = 
(EXOR A2 B2 CAR1)
SOM3 = 
(EXOR A3 B3 CAR2)
SOM4 = 
(EXOR A4 B4 CAR3)
SOM5 = 
(EXOR A5 B5 CAR4)
SOM6 = 
(EXOR A6 B6 CAR5)
SOM7 = 
(EXOR A7 B7 CAR6)
SOM8 = 
(EXOR A8 B8 CAR7)
COUT = 
(OR (AND (OR A8 B8) CAR7) (AND A8 B8))

@end


@BE2

@invar
 (A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 A8 B8)

@sub
COUT1 = 
(AND B1 A1)
COUT2 = 
(OR (AND COUT1 B2) (AND COUT1 A2) (AND B2 A2))
COUT3 = 
(OR (AND COUT2 B3) (AND COUT2 A3) (AND B3 A3))
COUT4 = 
(OR (AND COUT3 B4) (AND COUT3 A4) (AND B4 A4))
COUT5 = 
(OR (AND COUT4 B5) (AND COUT4 A5) (AND B5 A5))
COUT6 = 
(OR (AND COUT5 B6) (AND COUT5 A6) (AND B6 A6))
COUT7 = 
(OR (AND COUT6 B7) (AND COUT6 A7) (AND B7 A7))

@out
SOM1 = 
(NOT (OR (AND (NOT A1) (NOT B1)) (AND A1 B1))) 
SOM2 = 
(NOT (OR (AND (OR (AND (NOT A2) (NOT B2)) (AND A2 B2)) (NOT COUT1)) (AND COUT1 (NOT (OR (AND (NOT A2) (NOT B2)) (AND A2 B2)))))) 
SOM3 = 
(NOT (OR (AND (OR (AND (NOT A3) (NOT B3)) (AND A3 B3)) (NOT COUT2)) (AND COUT2 (NOT (OR (AND (NOT A3) (NOT B3)) (AND A3 B3)))))) 
SOM4 = 
(NOT (OR (AND (OR (AND (NOT A4) (NOT B4)) (AND A4 B4)) (NOT COUT3)) (AND COUT3 (NOT (OR (AND (NOT A4) (NOT B4)) (AND A4 B4)))))) 
SOM5 = 
(NOT (OR (AND (OR (AND (NOT A5) (NOT B5)) (AND A5 B5)) (NOT COUT4)) (AND COUT4 (NOT (OR (AND (NOT A5) (NOT B5)) (AND A5 B5)))))) 
SOM6 = 
(NOT (OR (AND (OR (AND (NOT A6) (NOT B6)) (AND A6 B6)) (NOT COUT5)) (AND COUT5 (NOT (OR (AND (NOT A6) (NOT B6)) (AND A6 B6)))))) 
SOM7 = 
(NOT (OR (AND (OR (AND (NOT A7) (NOT B7)) (AND A7 B7)) (NOT COUT6)) (AND COUT6 (NOT (OR (AND (NOT A7) (NOT B7)) (AND A7 B7)))))) 
SOM8 = 
(NOT (OR (AND (OR (AND (NOT A8) (NOT B8)) (AND A8 B8)) (NOT COUT7)) (AND COUT7 (NOT (OR (AND (NOT A8) (NOT B8)) (AND A8 B8)))))) 
COUT = 
(OR (AND A8 COUT7) (AND B8 COUT7) (AND A8 B8)) 

@end
