Simplify (a + b) XOR (c + b)

Is it possible to simplify (a + b) xor (c + b) ? What is the contribution of b to the end result? Please note that I mix Boolean algebra with arithmetic, xor is bitwise exclusive or on the corresponding bits, and + is a standard 8-bit complement that wraps when overflowed. a, b, c unsigned char;

+6
source share
1 answer

We can use the SMT solver to test our hypothesis that your formula can be simplified. You can go to http://rise4fun.com :

x = BitVec('x', 8) y = BitVec('y', 8) z = BitVec('z', 8) print simplify((x + z) ^ (y + z)) 

and the result, unsurprisingly, is:

 x + z ^ y + z 

This means that your formula cannot be simplified.

+2
source

All Articles