Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int in_a = 1250;
- int in_b = -4025;
- int res = 0;
- in.op = ALU::OpAdd;
- in.ci = false;
- for(unsigned i=0; i<32/4; ++i)
- {
- unsigned shift = i << 2;
- in.a = (in_a >> shift) & 0xF;
- in.b = (in_b >> shift) & 0xF;
- auto out = alu.simulate(in);
- res |= (out.out << shift);
- in.ci = out.co;
- }
Advertisement
Add Comment
Please, Sign In to add comment