the first thing is to define some conventions, that the answer (result) will always be 8 bit (not 1 bit) and that, rather than just one bit being set if some are set, all 8 bits are clear or all 8 bits are set.
- if result[0]: # bit 0 true?
- result[1:7] = 1 # then set the remaining 7
+ if result[0]: # bit 0 true?
+ result[1:7] = 1111111 # set the remaining 7
likewise, when configured as 2x32 the result is subdivided into two 4 bit halves: the first half is all zero if all the first 32 bits are zero, and all ones if any one bit in the first 32 bits are set.
result[0] = result[0] xor a[i]
result[4] = result[4] xor a[i+32]
if result[0]:
- result[1:3] = 1
+ result[1:3] = 111
if result[4]:
- result[5:7] = 1
+ result[5:7] = 111
-thus we have a convention where the result is *also a partitioned signal*, and can be reconfigured to return 1x xor yes/no, 2x xor yes/no, 4x xor yes/no or up to 8 independent yes/no boolean values.
+Thus we have a convention where the result is *also a partitioned signal*, and can be reconfigured to return 1x xor yes/no, 2x xor yes/no, 4x xor yes/no or up to 8 independent yes/no boolean values.
-the second observation then is that, actually, just like the other partitioned operations, it may be possible to "construct" the longer results from the 8x8 ones, based on whether the partition gates are open or closed.
+The second observation then is that, actually, just like the other partitioned operations, it may be possible to "construct" the longer results from the 8x8 ones, based on whether the partition gates are open or closed. This is further explored below.
# Boolean truth table for Partitioned XOR