+ 2
Can anyone explain why the output of OR and XOR are like that what not the output of OR is {0,10,1,3,7,9,11,13}
2 odpowiedzi
0
Consider that bits2 got changed with each of the operations. When you execute one of them only, you will get different results. So when you execute the "xor" only, you get the result you expect in your question.
1) and
All odd bits are 0 now.
2) or
Bits 0 and 10 get set to 1.
3) xor
All bits are 0 now, because bits1 and bits2 were equal.
0
XOR usually will be used for finding of bits, which have changed to a previous situation.