Jan Klhůfek 56c86c13ca
New multipliers (#13)
* #10 CGP Circuits as inputs (#11)

* CGP Circuits as inputs

* #10 support of signed output in general circuit

* input as output works

* output connected to input (c)

* automated verilog testing

* output rename

* Implemented CSA and Wallace tree multiplier composing of CSAs. Also did some code cleanup.

* Typos fix and code cleanup.

* Added new (approximate) multiplier architectures and did some minor changes regarding sign extension for c output formats.

* Updated automated testing scripts.

* Small bugfix in python code generation (I initially thought this line is useless).

* Updated generated circuits folder.

Co-authored-by: Vojta Mrazek <mrazek@fit.vutbr.cz>
2022-04-17 16:00:00 +02:00

543 lines
38 KiB
C

#include <stdio.h>
#include <stdint.h>
uint8_t and_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) & ((b >> 0) & 0x01);
}
uint8_t nand_gate(uint8_t a, uint8_t b){
return ~(((a >> 0) & 0x01) & ((b >> 0) & 0x01)) & 0x01;
}
uint8_t xor_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) ^ ((b >> 0) & 0x01);
}
uint8_t not_gate(uint8_t a){
return ~(((a >> 0) & 0x01)) & 0x01;
}
uint8_t or_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) | ((b >> 0) & 0x01);
}
uint8_t ha(uint8_t a, uint8_t b){
uint8_t ha_out = 0;
uint8_t ha_xor0 = 0;
uint8_t ha_and0 = 0;
ha_xor0 = xor_gate(((a >> 0) & 0x01), ((b >> 0) & 0x01));
ha_and0 = and_gate(((a >> 0) & 0x01), ((b >> 0) & 0x01));
ha_out |= ((ha_xor0 >> 0) & 0x01ull) << 0;
ha_out |= ((ha_and0 >> 0) & 0x01ull) << 1;
return ha_out;
}
uint8_t fa(uint8_t a, uint8_t b, uint8_t cin){
uint8_t fa_out = 0;
uint8_t fa_xor0 = 0;
uint8_t fa_and0 = 0;
uint8_t fa_xor1 = 0;
uint8_t fa_and1 = 0;
uint8_t fa_or0 = 0;
fa_xor0 = xor_gate(((a >> 0) & 0x01), ((b >> 0) & 0x01));
fa_and0 = and_gate(((a >> 0) & 0x01), ((b >> 0) & 0x01));
fa_xor1 = xor_gate(((fa_xor0 >> 0) & 0x01), ((cin >> 0) & 0x01));
fa_and1 = and_gate(((fa_xor0 >> 0) & 0x01), ((cin >> 0) & 0x01));
fa_or0 = or_gate(((fa_and0 >> 0) & 0x01), ((fa_and1 >> 0) & 0x01));
fa_out |= ((fa_xor1 >> 0) & 0x01ull) << 0;
fa_out |= ((fa_or0 >> 0) & 0x01ull) << 1;
return fa_out;
}
uint64_t u_rca8(uint64_t a, uint64_t b){
uint64_t u_rca8_out = 0;
uint8_t u_rca8_ha_xor0 = 0;
uint8_t u_rca8_ha_and0 = 0;
uint8_t u_rca8_fa1_xor1 = 0;
uint8_t u_rca8_fa1_or0 = 0;
uint8_t u_rca8_fa2_xor1 = 0;
uint8_t u_rca8_fa2_or0 = 0;
uint8_t u_rca8_fa3_xor1 = 0;
uint8_t u_rca8_fa3_or0 = 0;
uint8_t u_rca8_fa4_xor1 = 0;
uint8_t u_rca8_fa4_or0 = 0;
uint8_t u_rca8_fa5_xor1 = 0;
uint8_t u_rca8_fa5_or0 = 0;
uint8_t u_rca8_fa6_xor1 = 0;
uint8_t u_rca8_fa6_or0 = 0;
uint8_t u_rca8_fa7_xor1 = 0;
uint8_t u_rca8_fa7_or0 = 0;
u_rca8_ha_xor0 = (ha(((a >> 0) & 0x01), ((b >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_ha_and0 = (ha(((a >> 0) & 0x01), ((b >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa1_xor1 = (fa(((a >> 1) & 0x01), ((b >> 1) & 0x01), ((u_rca8_ha_and0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa1_or0 = (fa(((a >> 1) & 0x01), ((b >> 1) & 0x01), ((u_rca8_ha_and0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa2_xor1 = (fa(((a >> 2) & 0x01), ((b >> 2) & 0x01), ((u_rca8_fa1_or0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa2_or0 = (fa(((a >> 2) & 0x01), ((b >> 2) & 0x01), ((u_rca8_fa1_or0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa3_xor1 = (fa(((a >> 3) & 0x01), ((b >> 3) & 0x01), ((u_rca8_fa2_or0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa3_or0 = (fa(((a >> 3) & 0x01), ((b >> 3) & 0x01), ((u_rca8_fa2_or0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa4_xor1 = (fa(((a >> 4) & 0x01), ((b >> 4) & 0x01), ((u_rca8_fa3_or0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa4_or0 = (fa(((a >> 4) & 0x01), ((b >> 4) & 0x01), ((u_rca8_fa3_or0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa5_xor1 = (fa(((a >> 5) & 0x01), ((b >> 5) & 0x01), ((u_rca8_fa4_or0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa5_or0 = (fa(((a >> 5) & 0x01), ((b >> 5) & 0x01), ((u_rca8_fa4_or0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa6_xor1 = (fa(((a >> 6) & 0x01), ((b >> 6) & 0x01), ((u_rca8_fa5_or0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa6_or0 = (fa(((a >> 6) & 0x01), ((b >> 6) & 0x01), ((u_rca8_fa5_or0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_fa7_xor1 = (fa(((a >> 7) & 0x01), ((b >> 7) & 0x01), ((u_rca8_fa6_or0 >> 0) & 0x01)) >> 0) & 0x01;
u_rca8_fa7_or0 = (fa(((a >> 7) & 0x01), ((b >> 7) & 0x01), ((u_rca8_fa6_or0 >> 0) & 0x01)) >> 1) & 0x01;
u_rca8_out |= ((u_rca8_ha_xor0 >> 0) & 0x01ull) << 0;
u_rca8_out |= ((u_rca8_fa1_xor1 >> 0) & 0x01ull) << 1;
u_rca8_out |= ((u_rca8_fa2_xor1 >> 0) & 0x01ull) << 2;
u_rca8_out |= ((u_rca8_fa3_xor1 >> 0) & 0x01ull) << 3;
u_rca8_out |= ((u_rca8_fa4_xor1 >> 0) & 0x01ull) << 4;
u_rca8_out |= ((u_rca8_fa5_xor1 >> 0) & 0x01ull) << 5;
u_rca8_out |= ((u_rca8_fa6_xor1 >> 0) & 0x01ull) << 6;
u_rca8_out |= ((u_rca8_fa7_xor1 >> 0) & 0x01ull) << 7;
u_rca8_out |= ((u_rca8_fa7_or0 >> 0) & 0x01ull) << 8;
return u_rca8_out;
}
int64_t s_csamul_rca8(int64_t a, int64_t b){
int64_t s_csamul_rca8_out = 0;
uint8_t s_csamul_rca8_and0_0 = 0;
uint8_t s_csamul_rca8_and1_0 = 0;
uint8_t s_csamul_rca8_and2_0 = 0;
uint8_t s_csamul_rca8_and3_0 = 0;
uint8_t s_csamul_rca8_and4_0 = 0;
uint8_t s_csamul_rca8_and5_0 = 0;
uint8_t s_csamul_rca8_and6_0 = 0;
uint8_t s_csamul_rca8_nand7_0 = 0;
uint8_t s_csamul_rca8_and0_1 = 0;
uint8_t s_csamul_rca8_ha0_1_xor0 = 0;
uint8_t s_csamul_rca8_ha0_1_and0 = 0;
uint8_t s_csamul_rca8_and1_1 = 0;
uint8_t s_csamul_rca8_ha1_1_xor0 = 0;
uint8_t s_csamul_rca8_ha1_1_and0 = 0;
uint8_t s_csamul_rca8_and2_1 = 0;
uint8_t s_csamul_rca8_ha2_1_xor0 = 0;
uint8_t s_csamul_rca8_ha2_1_and0 = 0;
uint8_t s_csamul_rca8_and3_1 = 0;
uint8_t s_csamul_rca8_ha3_1_xor0 = 0;
uint8_t s_csamul_rca8_ha3_1_and0 = 0;
uint8_t s_csamul_rca8_and4_1 = 0;
uint8_t s_csamul_rca8_ha4_1_xor0 = 0;
uint8_t s_csamul_rca8_ha4_1_and0 = 0;
uint8_t s_csamul_rca8_and5_1 = 0;
uint8_t s_csamul_rca8_ha5_1_xor0 = 0;
uint8_t s_csamul_rca8_ha5_1_and0 = 0;
uint8_t s_csamul_rca8_and6_1 = 0;
uint8_t s_csamul_rca8_ha6_1_xor0 = 0;
uint8_t s_csamul_rca8_ha6_1_and0 = 0;
uint8_t s_csamul_rca8_nand7_1 = 0;
uint8_t s_csamul_rca8_ha7_1_xor0 = 0;
uint8_t s_csamul_rca8_and0_2 = 0;
uint8_t s_csamul_rca8_fa0_2_xor1 = 0;
uint8_t s_csamul_rca8_fa0_2_or0 = 0;
uint8_t s_csamul_rca8_and1_2 = 0;
uint8_t s_csamul_rca8_fa1_2_xor1 = 0;
uint8_t s_csamul_rca8_fa1_2_or0 = 0;
uint8_t s_csamul_rca8_and2_2 = 0;
uint8_t s_csamul_rca8_fa2_2_xor1 = 0;
uint8_t s_csamul_rca8_fa2_2_or0 = 0;
uint8_t s_csamul_rca8_and3_2 = 0;
uint8_t s_csamul_rca8_fa3_2_xor1 = 0;
uint8_t s_csamul_rca8_fa3_2_or0 = 0;
uint8_t s_csamul_rca8_and4_2 = 0;
uint8_t s_csamul_rca8_fa4_2_xor1 = 0;
uint8_t s_csamul_rca8_fa4_2_or0 = 0;
uint8_t s_csamul_rca8_and5_2 = 0;
uint8_t s_csamul_rca8_fa5_2_xor1 = 0;
uint8_t s_csamul_rca8_fa5_2_or0 = 0;
uint8_t s_csamul_rca8_and6_2 = 0;
uint8_t s_csamul_rca8_fa6_2_xor1 = 0;
uint8_t s_csamul_rca8_fa6_2_or0 = 0;
uint8_t s_csamul_rca8_nand7_2 = 0;
uint8_t s_csamul_rca8_ha7_2_xor0 = 0;
uint8_t s_csamul_rca8_ha7_2_and0 = 0;
uint8_t s_csamul_rca8_and0_3 = 0;
uint8_t s_csamul_rca8_fa0_3_xor1 = 0;
uint8_t s_csamul_rca8_fa0_3_or0 = 0;
uint8_t s_csamul_rca8_and1_3 = 0;
uint8_t s_csamul_rca8_fa1_3_xor1 = 0;
uint8_t s_csamul_rca8_fa1_3_or0 = 0;
uint8_t s_csamul_rca8_and2_3 = 0;
uint8_t s_csamul_rca8_fa2_3_xor1 = 0;
uint8_t s_csamul_rca8_fa2_3_or0 = 0;
uint8_t s_csamul_rca8_and3_3 = 0;
uint8_t s_csamul_rca8_fa3_3_xor1 = 0;
uint8_t s_csamul_rca8_fa3_3_or0 = 0;
uint8_t s_csamul_rca8_and4_3 = 0;
uint8_t s_csamul_rca8_fa4_3_xor1 = 0;
uint8_t s_csamul_rca8_fa4_3_or0 = 0;
uint8_t s_csamul_rca8_and5_3 = 0;
uint8_t s_csamul_rca8_fa5_3_xor1 = 0;
uint8_t s_csamul_rca8_fa5_3_or0 = 0;
uint8_t s_csamul_rca8_and6_3 = 0;
uint8_t s_csamul_rca8_fa6_3_xor1 = 0;
uint8_t s_csamul_rca8_fa6_3_or0 = 0;
uint8_t s_csamul_rca8_nand7_3 = 0;
uint8_t s_csamul_rca8_ha7_3_xor0 = 0;
uint8_t s_csamul_rca8_ha7_3_and0 = 0;
uint8_t s_csamul_rca8_and0_4 = 0;
uint8_t s_csamul_rca8_fa0_4_xor1 = 0;
uint8_t s_csamul_rca8_fa0_4_or0 = 0;
uint8_t s_csamul_rca8_and1_4 = 0;
uint8_t s_csamul_rca8_fa1_4_xor1 = 0;
uint8_t s_csamul_rca8_fa1_4_or0 = 0;
uint8_t s_csamul_rca8_and2_4 = 0;
uint8_t s_csamul_rca8_fa2_4_xor1 = 0;
uint8_t s_csamul_rca8_fa2_4_or0 = 0;
uint8_t s_csamul_rca8_and3_4 = 0;
uint8_t s_csamul_rca8_fa3_4_xor1 = 0;
uint8_t s_csamul_rca8_fa3_4_or0 = 0;
uint8_t s_csamul_rca8_and4_4 = 0;
uint8_t s_csamul_rca8_fa4_4_xor1 = 0;
uint8_t s_csamul_rca8_fa4_4_or0 = 0;
uint8_t s_csamul_rca8_and5_4 = 0;
uint8_t s_csamul_rca8_fa5_4_xor1 = 0;
uint8_t s_csamul_rca8_fa5_4_or0 = 0;
uint8_t s_csamul_rca8_and6_4 = 0;
uint8_t s_csamul_rca8_fa6_4_xor1 = 0;
uint8_t s_csamul_rca8_fa6_4_or0 = 0;
uint8_t s_csamul_rca8_nand7_4 = 0;
uint8_t s_csamul_rca8_ha7_4_xor0 = 0;
uint8_t s_csamul_rca8_ha7_4_and0 = 0;
uint8_t s_csamul_rca8_and0_5 = 0;
uint8_t s_csamul_rca8_fa0_5_xor1 = 0;
uint8_t s_csamul_rca8_fa0_5_or0 = 0;
uint8_t s_csamul_rca8_and1_5 = 0;
uint8_t s_csamul_rca8_fa1_5_xor1 = 0;
uint8_t s_csamul_rca8_fa1_5_or0 = 0;
uint8_t s_csamul_rca8_and2_5 = 0;
uint8_t s_csamul_rca8_fa2_5_xor1 = 0;
uint8_t s_csamul_rca8_fa2_5_or0 = 0;
uint8_t s_csamul_rca8_and3_5 = 0;
uint8_t s_csamul_rca8_fa3_5_xor1 = 0;
uint8_t s_csamul_rca8_fa3_5_or0 = 0;
uint8_t s_csamul_rca8_and4_5 = 0;
uint8_t s_csamul_rca8_fa4_5_xor1 = 0;
uint8_t s_csamul_rca8_fa4_5_or0 = 0;
uint8_t s_csamul_rca8_and5_5 = 0;
uint8_t s_csamul_rca8_fa5_5_xor1 = 0;
uint8_t s_csamul_rca8_fa5_5_or0 = 0;
uint8_t s_csamul_rca8_and6_5 = 0;
uint8_t s_csamul_rca8_fa6_5_xor1 = 0;
uint8_t s_csamul_rca8_fa6_5_or0 = 0;
uint8_t s_csamul_rca8_nand7_5 = 0;
uint8_t s_csamul_rca8_ha7_5_xor0 = 0;
uint8_t s_csamul_rca8_ha7_5_and0 = 0;
uint8_t s_csamul_rca8_and0_6 = 0;
uint8_t s_csamul_rca8_fa0_6_xor1 = 0;
uint8_t s_csamul_rca8_fa0_6_or0 = 0;
uint8_t s_csamul_rca8_and1_6 = 0;
uint8_t s_csamul_rca8_fa1_6_xor1 = 0;
uint8_t s_csamul_rca8_fa1_6_or0 = 0;
uint8_t s_csamul_rca8_and2_6 = 0;
uint8_t s_csamul_rca8_fa2_6_xor1 = 0;
uint8_t s_csamul_rca8_fa2_6_or0 = 0;
uint8_t s_csamul_rca8_and3_6 = 0;
uint8_t s_csamul_rca8_fa3_6_xor1 = 0;
uint8_t s_csamul_rca8_fa3_6_or0 = 0;
uint8_t s_csamul_rca8_and4_6 = 0;
uint8_t s_csamul_rca8_fa4_6_xor1 = 0;
uint8_t s_csamul_rca8_fa4_6_or0 = 0;
uint8_t s_csamul_rca8_and5_6 = 0;
uint8_t s_csamul_rca8_fa5_6_xor1 = 0;
uint8_t s_csamul_rca8_fa5_6_or0 = 0;
uint8_t s_csamul_rca8_and6_6 = 0;
uint8_t s_csamul_rca8_fa6_6_xor1 = 0;
uint8_t s_csamul_rca8_fa6_6_or0 = 0;
uint8_t s_csamul_rca8_nand7_6 = 0;
uint8_t s_csamul_rca8_ha7_6_xor0 = 0;
uint8_t s_csamul_rca8_ha7_6_and0 = 0;
uint8_t s_csamul_rca8_nand0_7 = 0;
uint8_t s_csamul_rca8_fa0_7_xor1 = 0;
uint8_t s_csamul_rca8_fa0_7_or0 = 0;
uint8_t s_csamul_rca8_nand1_7 = 0;
uint8_t s_csamul_rca8_fa1_7_xor1 = 0;
uint8_t s_csamul_rca8_fa1_7_or0 = 0;
uint8_t s_csamul_rca8_nand2_7 = 0;
uint8_t s_csamul_rca8_fa2_7_xor1 = 0;
uint8_t s_csamul_rca8_fa2_7_or0 = 0;
uint8_t s_csamul_rca8_nand3_7 = 0;
uint8_t s_csamul_rca8_fa3_7_xor1 = 0;
uint8_t s_csamul_rca8_fa3_7_or0 = 0;
uint8_t s_csamul_rca8_nand4_7 = 0;
uint8_t s_csamul_rca8_fa4_7_xor1 = 0;
uint8_t s_csamul_rca8_fa4_7_or0 = 0;
uint8_t s_csamul_rca8_nand5_7 = 0;
uint8_t s_csamul_rca8_fa5_7_xor1 = 0;
uint8_t s_csamul_rca8_fa5_7_or0 = 0;
uint8_t s_csamul_rca8_nand6_7 = 0;
uint8_t s_csamul_rca8_fa6_7_xor1 = 0;
uint8_t s_csamul_rca8_fa6_7_or0 = 0;
uint8_t s_csamul_rca8_and7_7 = 0;
uint8_t s_csamul_rca8_ha7_7_xor0 = 0;
uint8_t s_csamul_rca8_ha7_7_and0 = 0;
uint64_t s_csamul_rca8_u_rca8_a = 0;
uint64_t s_csamul_rca8_u_rca8_b = 0;
uint64_t s_csamul_rca8_u_rca8_out = 0;
s_csamul_rca8_and0_0 = and_gate(((a >> 0) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and1_0 = and_gate(((a >> 1) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and2_0 = and_gate(((a >> 2) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and3_0 = and_gate(((a >> 3) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and4_0 = and_gate(((a >> 4) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and5_0 = and_gate(((a >> 5) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and6_0 = and_gate(((a >> 6) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_nand7_0 = nand_gate(((a >> 7) & 0x01), ((b >> 0) & 0x01));
s_csamul_rca8_and0_1 = and_gate(((a >> 0) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha0_1_xor0 = (ha(((s_csamul_rca8_and0_1 >> 0) & 0x01), ((s_csamul_rca8_and1_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha0_1_and0 = (ha(((s_csamul_rca8_and0_1 >> 0) & 0x01), ((s_csamul_rca8_and1_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and1_1 = and_gate(((a >> 1) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha1_1_xor0 = (ha(((s_csamul_rca8_and1_1 >> 0) & 0x01), ((s_csamul_rca8_and2_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha1_1_and0 = (ha(((s_csamul_rca8_and1_1 >> 0) & 0x01), ((s_csamul_rca8_and2_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and2_1 = and_gate(((a >> 2) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha2_1_xor0 = (ha(((s_csamul_rca8_and2_1 >> 0) & 0x01), ((s_csamul_rca8_and3_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha2_1_and0 = (ha(((s_csamul_rca8_and2_1 >> 0) & 0x01), ((s_csamul_rca8_and3_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and3_1 = and_gate(((a >> 3) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha3_1_xor0 = (ha(((s_csamul_rca8_and3_1 >> 0) & 0x01), ((s_csamul_rca8_and4_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha3_1_and0 = (ha(((s_csamul_rca8_and3_1 >> 0) & 0x01), ((s_csamul_rca8_and4_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and4_1 = and_gate(((a >> 4) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha4_1_xor0 = (ha(((s_csamul_rca8_and4_1 >> 0) & 0x01), ((s_csamul_rca8_and5_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha4_1_and0 = (ha(((s_csamul_rca8_and4_1 >> 0) & 0x01), ((s_csamul_rca8_and5_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and5_1 = and_gate(((a >> 5) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha5_1_xor0 = (ha(((s_csamul_rca8_and5_1 >> 0) & 0x01), ((s_csamul_rca8_and6_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha5_1_and0 = (ha(((s_csamul_rca8_and5_1 >> 0) & 0x01), ((s_csamul_rca8_and6_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and6_1 = and_gate(((a >> 6) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha6_1_xor0 = (ha(((s_csamul_rca8_and6_1 >> 0) & 0x01), ((s_csamul_rca8_nand7_0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha6_1_and0 = (ha(((s_csamul_rca8_and6_1 >> 0) & 0x01), ((s_csamul_rca8_nand7_0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand7_1 = nand_gate(((a >> 7) & 0x01), ((b >> 1) & 0x01));
s_csamul_rca8_ha7_1_xor0 = (ha(((s_csamul_rca8_nand7_1 >> 0) & 0x01), (0x01)) >> 0) & 0x01;
s_csamul_rca8_and0_2 = and_gate(((a >> 0) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa0_2_xor1 = (fa(((s_csamul_rca8_and0_2 >> 0) & 0x01), ((s_csamul_rca8_ha1_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha0_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa0_2_or0 = (fa(((s_csamul_rca8_and0_2 >> 0) & 0x01), ((s_csamul_rca8_ha1_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha0_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and1_2 = and_gate(((a >> 1) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa1_2_xor1 = (fa(((s_csamul_rca8_and1_2 >> 0) & 0x01), ((s_csamul_rca8_ha2_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha1_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa1_2_or0 = (fa(((s_csamul_rca8_and1_2 >> 0) & 0x01), ((s_csamul_rca8_ha2_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha1_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and2_2 = and_gate(((a >> 2) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa2_2_xor1 = (fa(((s_csamul_rca8_and2_2 >> 0) & 0x01), ((s_csamul_rca8_ha3_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha2_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa2_2_or0 = (fa(((s_csamul_rca8_and2_2 >> 0) & 0x01), ((s_csamul_rca8_ha3_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha2_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and3_2 = and_gate(((a >> 3) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa3_2_xor1 = (fa(((s_csamul_rca8_and3_2 >> 0) & 0x01), ((s_csamul_rca8_ha4_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha3_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa3_2_or0 = (fa(((s_csamul_rca8_and3_2 >> 0) & 0x01), ((s_csamul_rca8_ha4_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha3_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and4_2 = and_gate(((a >> 4) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa4_2_xor1 = (fa(((s_csamul_rca8_and4_2 >> 0) & 0x01), ((s_csamul_rca8_ha5_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha4_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa4_2_or0 = (fa(((s_csamul_rca8_and4_2 >> 0) & 0x01), ((s_csamul_rca8_ha5_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha4_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and5_2 = and_gate(((a >> 5) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa5_2_xor1 = (fa(((s_csamul_rca8_and5_2 >> 0) & 0x01), ((s_csamul_rca8_ha6_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha5_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa5_2_or0 = (fa(((s_csamul_rca8_and5_2 >> 0) & 0x01), ((s_csamul_rca8_ha6_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha5_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and6_2 = and_gate(((a >> 6) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_fa6_2_xor1 = (fa(((s_csamul_rca8_and6_2 >> 0) & 0x01), ((s_csamul_rca8_ha7_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha6_1_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa6_2_or0 = (fa(((s_csamul_rca8_and6_2 >> 0) & 0x01), ((s_csamul_rca8_ha7_1_xor0 >> 0) & 0x01), ((s_csamul_rca8_ha6_1_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand7_2 = nand_gate(((a >> 7) & 0x01), ((b >> 2) & 0x01));
s_csamul_rca8_ha7_2_xor0 = (ha(((s_csamul_rca8_nand7_2 >> 0) & 0x01), ((s_csamul_rca8_nand7_1 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha7_2_and0 = (ha(((s_csamul_rca8_nand7_2 >> 0) & 0x01), ((s_csamul_rca8_nand7_1 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and0_3 = and_gate(((a >> 0) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa0_3_xor1 = (fa(((s_csamul_rca8_and0_3 >> 0) & 0x01), ((s_csamul_rca8_fa1_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa0_3_or0 = (fa(((s_csamul_rca8_and0_3 >> 0) & 0x01), ((s_csamul_rca8_fa1_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and1_3 = and_gate(((a >> 1) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa1_3_xor1 = (fa(((s_csamul_rca8_and1_3 >> 0) & 0x01), ((s_csamul_rca8_fa2_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa1_3_or0 = (fa(((s_csamul_rca8_and1_3 >> 0) & 0x01), ((s_csamul_rca8_fa2_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and2_3 = and_gate(((a >> 2) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa2_3_xor1 = (fa(((s_csamul_rca8_and2_3 >> 0) & 0x01), ((s_csamul_rca8_fa3_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa2_3_or0 = (fa(((s_csamul_rca8_and2_3 >> 0) & 0x01), ((s_csamul_rca8_fa3_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and3_3 = and_gate(((a >> 3) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa3_3_xor1 = (fa(((s_csamul_rca8_and3_3 >> 0) & 0x01), ((s_csamul_rca8_fa4_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa3_3_or0 = (fa(((s_csamul_rca8_and3_3 >> 0) & 0x01), ((s_csamul_rca8_fa4_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and4_3 = and_gate(((a >> 4) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa4_3_xor1 = (fa(((s_csamul_rca8_and4_3 >> 0) & 0x01), ((s_csamul_rca8_fa5_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa4_3_or0 = (fa(((s_csamul_rca8_and4_3 >> 0) & 0x01), ((s_csamul_rca8_fa5_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and5_3 = and_gate(((a >> 5) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa5_3_xor1 = (fa(((s_csamul_rca8_and5_3 >> 0) & 0x01), ((s_csamul_rca8_fa6_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa5_3_or0 = (fa(((s_csamul_rca8_and5_3 >> 0) & 0x01), ((s_csamul_rca8_fa6_2_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and6_3 = and_gate(((a >> 6) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_fa6_3_xor1 = (fa(((s_csamul_rca8_and6_3 >> 0) & 0x01), ((s_csamul_rca8_ha7_2_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_2_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa6_3_or0 = (fa(((s_csamul_rca8_and6_3 >> 0) & 0x01), ((s_csamul_rca8_ha7_2_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_2_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand7_3 = nand_gate(((a >> 7) & 0x01), ((b >> 3) & 0x01));
s_csamul_rca8_ha7_3_xor0 = (ha(((s_csamul_rca8_nand7_3 >> 0) & 0x01), ((s_csamul_rca8_ha7_2_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha7_3_and0 = (ha(((s_csamul_rca8_nand7_3 >> 0) & 0x01), ((s_csamul_rca8_ha7_2_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and0_4 = and_gate(((a >> 0) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa0_4_xor1 = (fa(((s_csamul_rca8_and0_4 >> 0) & 0x01), ((s_csamul_rca8_fa1_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa0_4_or0 = (fa(((s_csamul_rca8_and0_4 >> 0) & 0x01), ((s_csamul_rca8_fa1_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and1_4 = and_gate(((a >> 1) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa1_4_xor1 = (fa(((s_csamul_rca8_and1_4 >> 0) & 0x01), ((s_csamul_rca8_fa2_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa1_4_or0 = (fa(((s_csamul_rca8_and1_4 >> 0) & 0x01), ((s_csamul_rca8_fa2_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and2_4 = and_gate(((a >> 2) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa2_4_xor1 = (fa(((s_csamul_rca8_and2_4 >> 0) & 0x01), ((s_csamul_rca8_fa3_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa2_4_or0 = (fa(((s_csamul_rca8_and2_4 >> 0) & 0x01), ((s_csamul_rca8_fa3_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and3_4 = and_gate(((a >> 3) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa3_4_xor1 = (fa(((s_csamul_rca8_and3_4 >> 0) & 0x01), ((s_csamul_rca8_fa4_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa3_4_or0 = (fa(((s_csamul_rca8_and3_4 >> 0) & 0x01), ((s_csamul_rca8_fa4_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and4_4 = and_gate(((a >> 4) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa4_4_xor1 = (fa(((s_csamul_rca8_and4_4 >> 0) & 0x01), ((s_csamul_rca8_fa5_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa4_4_or0 = (fa(((s_csamul_rca8_and4_4 >> 0) & 0x01), ((s_csamul_rca8_fa5_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and5_4 = and_gate(((a >> 5) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa5_4_xor1 = (fa(((s_csamul_rca8_and5_4 >> 0) & 0x01), ((s_csamul_rca8_fa6_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa5_4_or0 = (fa(((s_csamul_rca8_and5_4 >> 0) & 0x01), ((s_csamul_rca8_fa6_3_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and6_4 = and_gate(((a >> 6) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_fa6_4_xor1 = (fa(((s_csamul_rca8_and6_4 >> 0) & 0x01), ((s_csamul_rca8_ha7_3_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_3_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa6_4_or0 = (fa(((s_csamul_rca8_and6_4 >> 0) & 0x01), ((s_csamul_rca8_ha7_3_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_3_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand7_4 = nand_gate(((a >> 7) & 0x01), ((b >> 4) & 0x01));
s_csamul_rca8_ha7_4_xor0 = (ha(((s_csamul_rca8_nand7_4 >> 0) & 0x01), ((s_csamul_rca8_ha7_3_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha7_4_and0 = (ha(((s_csamul_rca8_nand7_4 >> 0) & 0x01), ((s_csamul_rca8_ha7_3_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and0_5 = and_gate(((a >> 0) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa0_5_xor1 = (fa(((s_csamul_rca8_and0_5 >> 0) & 0x01), ((s_csamul_rca8_fa1_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa0_5_or0 = (fa(((s_csamul_rca8_and0_5 >> 0) & 0x01), ((s_csamul_rca8_fa1_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and1_5 = and_gate(((a >> 1) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa1_5_xor1 = (fa(((s_csamul_rca8_and1_5 >> 0) & 0x01), ((s_csamul_rca8_fa2_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa1_5_or0 = (fa(((s_csamul_rca8_and1_5 >> 0) & 0x01), ((s_csamul_rca8_fa2_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and2_5 = and_gate(((a >> 2) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa2_5_xor1 = (fa(((s_csamul_rca8_and2_5 >> 0) & 0x01), ((s_csamul_rca8_fa3_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa2_5_or0 = (fa(((s_csamul_rca8_and2_5 >> 0) & 0x01), ((s_csamul_rca8_fa3_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and3_5 = and_gate(((a >> 3) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa3_5_xor1 = (fa(((s_csamul_rca8_and3_5 >> 0) & 0x01), ((s_csamul_rca8_fa4_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa3_5_or0 = (fa(((s_csamul_rca8_and3_5 >> 0) & 0x01), ((s_csamul_rca8_fa4_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and4_5 = and_gate(((a >> 4) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa4_5_xor1 = (fa(((s_csamul_rca8_and4_5 >> 0) & 0x01), ((s_csamul_rca8_fa5_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa4_5_or0 = (fa(((s_csamul_rca8_and4_5 >> 0) & 0x01), ((s_csamul_rca8_fa5_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and5_5 = and_gate(((a >> 5) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa5_5_xor1 = (fa(((s_csamul_rca8_and5_5 >> 0) & 0x01), ((s_csamul_rca8_fa6_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa5_5_or0 = (fa(((s_csamul_rca8_and5_5 >> 0) & 0x01), ((s_csamul_rca8_fa6_4_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and6_5 = and_gate(((a >> 6) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_fa6_5_xor1 = (fa(((s_csamul_rca8_and6_5 >> 0) & 0x01), ((s_csamul_rca8_ha7_4_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_4_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa6_5_or0 = (fa(((s_csamul_rca8_and6_5 >> 0) & 0x01), ((s_csamul_rca8_ha7_4_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_4_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand7_5 = nand_gate(((a >> 7) & 0x01), ((b >> 5) & 0x01));
s_csamul_rca8_ha7_5_xor0 = (ha(((s_csamul_rca8_nand7_5 >> 0) & 0x01), ((s_csamul_rca8_ha7_4_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha7_5_and0 = (ha(((s_csamul_rca8_nand7_5 >> 0) & 0x01), ((s_csamul_rca8_ha7_4_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and0_6 = and_gate(((a >> 0) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa0_6_xor1 = (fa(((s_csamul_rca8_and0_6 >> 0) & 0x01), ((s_csamul_rca8_fa1_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa0_6_or0 = (fa(((s_csamul_rca8_and0_6 >> 0) & 0x01), ((s_csamul_rca8_fa1_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and1_6 = and_gate(((a >> 1) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa1_6_xor1 = (fa(((s_csamul_rca8_and1_6 >> 0) & 0x01), ((s_csamul_rca8_fa2_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa1_6_or0 = (fa(((s_csamul_rca8_and1_6 >> 0) & 0x01), ((s_csamul_rca8_fa2_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and2_6 = and_gate(((a >> 2) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa2_6_xor1 = (fa(((s_csamul_rca8_and2_6 >> 0) & 0x01), ((s_csamul_rca8_fa3_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa2_6_or0 = (fa(((s_csamul_rca8_and2_6 >> 0) & 0x01), ((s_csamul_rca8_fa3_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and3_6 = and_gate(((a >> 3) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa3_6_xor1 = (fa(((s_csamul_rca8_and3_6 >> 0) & 0x01), ((s_csamul_rca8_fa4_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa3_6_or0 = (fa(((s_csamul_rca8_and3_6 >> 0) & 0x01), ((s_csamul_rca8_fa4_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and4_6 = and_gate(((a >> 4) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa4_6_xor1 = (fa(((s_csamul_rca8_and4_6 >> 0) & 0x01), ((s_csamul_rca8_fa5_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa4_6_or0 = (fa(((s_csamul_rca8_and4_6 >> 0) & 0x01), ((s_csamul_rca8_fa5_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and5_6 = and_gate(((a >> 5) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa5_6_xor1 = (fa(((s_csamul_rca8_and5_6 >> 0) & 0x01), ((s_csamul_rca8_fa6_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa5_6_or0 = (fa(((s_csamul_rca8_and5_6 >> 0) & 0x01), ((s_csamul_rca8_fa6_5_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and6_6 = and_gate(((a >> 6) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_fa6_6_xor1 = (fa(((s_csamul_rca8_and6_6 >> 0) & 0x01), ((s_csamul_rca8_ha7_5_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_5_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa6_6_or0 = (fa(((s_csamul_rca8_and6_6 >> 0) & 0x01), ((s_csamul_rca8_ha7_5_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_5_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand7_6 = nand_gate(((a >> 7) & 0x01), ((b >> 6) & 0x01));
s_csamul_rca8_ha7_6_xor0 = (ha(((s_csamul_rca8_nand7_6 >> 0) & 0x01), ((s_csamul_rca8_ha7_5_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha7_6_and0 = (ha(((s_csamul_rca8_nand7_6 >> 0) & 0x01), ((s_csamul_rca8_ha7_5_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand0_7 = nand_gate(((a >> 0) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa0_7_xor1 = (fa(((s_csamul_rca8_nand0_7 >> 0) & 0x01), ((s_csamul_rca8_fa1_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa0_7_or0 = (fa(((s_csamul_rca8_nand0_7 >> 0) & 0x01), ((s_csamul_rca8_fa1_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa0_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand1_7 = nand_gate(((a >> 1) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa1_7_xor1 = (fa(((s_csamul_rca8_nand1_7 >> 0) & 0x01), ((s_csamul_rca8_fa2_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa1_7_or0 = (fa(((s_csamul_rca8_nand1_7 >> 0) & 0x01), ((s_csamul_rca8_fa2_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa1_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand2_7 = nand_gate(((a >> 2) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa2_7_xor1 = (fa(((s_csamul_rca8_nand2_7 >> 0) & 0x01), ((s_csamul_rca8_fa3_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa2_7_or0 = (fa(((s_csamul_rca8_nand2_7 >> 0) & 0x01), ((s_csamul_rca8_fa3_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa2_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand3_7 = nand_gate(((a >> 3) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa3_7_xor1 = (fa(((s_csamul_rca8_nand3_7 >> 0) & 0x01), ((s_csamul_rca8_fa4_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa3_7_or0 = (fa(((s_csamul_rca8_nand3_7 >> 0) & 0x01), ((s_csamul_rca8_fa4_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa3_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand4_7 = nand_gate(((a >> 4) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa4_7_xor1 = (fa(((s_csamul_rca8_nand4_7 >> 0) & 0x01), ((s_csamul_rca8_fa5_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa4_7_or0 = (fa(((s_csamul_rca8_nand4_7 >> 0) & 0x01), ((s_csamul_rca8_fa5_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa4_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand5_7 = nand_gate(((a >> 5) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa5_7_xor1 = (fa(((s_csamul_rca8_nand5_7 >> 0) & 0x01), ((s_csamul_rca8_fa6_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa5_7_or0 = (fa(((s_csamul_rca8_nand5_7 >> 0) & 0x01), ((s_csamul_rca8_fa6_6_xor1 >> 0) & 0x01), ((s_csamul_rca8_fa5_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_nand6_7 = nand_gate(((a >> 6) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_fa6_7_xor1 = (fa(((s_csamul_rca8_nand6_7 >> 0) & 0x01), ((s_csamul_rca8_ha7_6_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_6_or0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_fa6_7_or0 = (fa(((s_csamul_rca8_nand6_7 >> 0) & 0x01), ((s_csamul_rca8_ha7_6_xor0 >> 0) & 0x01), ((s_csamul_rca8_fa6_6_or0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_and7_7 = and_gate(((a >> 7) & 0x01), ((b >> 7) & 0x01));
s_csamul_rca8_ha7_7_xor0 = (ha(((s_csamul_rca8_and7_7 >> 0) & 0x01), ((s_csamul_rca8_ha7_6_and0 >> 0) & 0x01)) >> 0) & 0x01;
s_csamul_rca8_ha7_7_and0 = (ha(((s_csamul_rca8_and7_7 >> 0) & 0x01), ((s_csamul_rca8_ha7_6_and0 >> 0) & 0x01)) >> 1) & 0x01;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_fa1_7_xor1 >> 0) & 0x01ull) << 0;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_fa2_7_xor1 >> 0) & 0x01ull) << 1;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_fa3_7_xor1 >> 0) & 0x01ull) << 2;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_fa4_7_xor1 >> 0) & 0x01ull) << 3;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_fa5_7_xor1 >> 0) & 0x01ull) << 4;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_fa6_7_xor1 >> 0) & 0x01ull) << 5;
s_csamul_rca8_u_rca8_a |= ((s_csamul_rca8_ha7_7_xor0 >> 0) & 0x01ull) << 6;
s_csamul_rca8_u_rca8_a |= (0x01) << 7;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa0_7_or0 >> 0) & 0x01ull) << 0;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa1_7_or0 >> 0) & 0x01ull) << 1;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa2_7_or0 >> 0) & 0x01ull) << 2;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa3_7_or0 >> 0) & 0x01ull) << 3;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa4_7_or0 >> 0) & 0x01ull) << 4;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa5_7_or0 >> 0) & 0x01ull) << 5;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_fa6_7_or0 >> 0) & 0x01ull) << 6;
s_csamul_rca8_u_rca8_b |= ((s_csamul_rca8_ha7_7_and0 >> 0) & 0x01ull) << 7;
s_csamul_rca8_u_rca8_out = u_rca8(s_csamul_rca8_u_rca8_a, s_csamul_rca8_u_rca8_b);
s_csamul_rca8_out |= ((s_csamul_rca8_and0_0 >> 0) & 0x01ull) << 0;
s_csamul_rca8_out |= ((s_csamul_rca8_ha0_1_xor0 >> 0) & 0x01ull) << 1;
s_csamul_rca8_out |= ((s_csamul_rca8_fa0_2_xor1 >> 0) & 0x01ull) << 2;
s_csamul_rca8_out |= ((s_csamul_rca8_fa0_3_xor1 >> 0) & 0x01ull) << 3;
s_csamul_rca8_out |= ((s_csamul_rca8_fa0_4_xor1 >> 0) & 0x01ull) << 4;
s_csamul_rca8_out |= ((s_csamul_rca8_fa0_5_xor1 >> 0) & 0x01ull) << 5;
s_csamul_rca8_out |= ((s_csamul_rca8_fa0_6_xor1 >> 0) & 0x01ull) << 6;
s_csamul_rca8_out |= ((s_csamul_rca8_fa0_7_xor1 >> 0) & 0x01ull) << 7;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 0) & 0x01ull) << 8;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 1) & 0x01ull) << 9;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 2) & 0x01ull) << 10;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 3) & 0x01ull) << 11;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 4) & 0x01ull) << 12;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 5) & 0x01ull) << 13;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 6) & 0x01ull) << 14;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 15;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 16;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 17;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 18;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 19;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 20;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 21;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 22;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 23;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 24;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 25;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 26;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 27;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 28;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 29;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 30;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 31;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 32;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 33;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 34;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 35;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 36;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 37;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 38;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 39;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 40;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 41;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 42;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 43;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 44;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 45;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 46;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 47;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 48;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 49;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 50;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 51;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 52;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 53;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 54;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 55;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 56;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 57;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 58;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 59;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 60;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 61;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 62;
s_csamul_rca8_out |= ((s_csamul_rca8_u_rca8_out >> 7) & 0x01ull) << 63;
return s_csamul_rca8_out;
}