XOR of Multiple Bytes - Procedure and Methods

  • Thread starter Thread starter temujin
  • Start date Start date
  • Tags Tags
    bytes Multiple
Click For Summary
To XOR multiple bytes, the standard method is to sequentially XOR each byte together, starting with the first two and then combining the result with the next byte, and so on. While XOR operations typically involve two operands, a truth table can be constructed for a three-input XOR, yielding different results than the sequential method. The choice of method may depend on the specific application or desired outcome. Ultimately, the bit-by-bit XOR operation will produce a result that retains the same number of bits as the operands. Clarifying the intended goal can help determine the most effective approach.
temujin
Messages
46
Reaction score
1
Hi,

Short question,

I have to XOR multiple bytes. Is the right procedure to XOR first and second byte then XOR the result with the third byte and so on?

Or is there a different method?

t.
 
Engineering news on Phys.org
As far as I know an XOR operation can only have 2 operands.

Having said that I don't see why you couldn't have an operator with a truth table like so...

a b c 3bitXOR
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0

And I think that would give you a different result to ((a XOR b) XOR c).

That's probably not helped! I suppose the mechanism to use depends on what you're trying to achive.
 
a computer will ido a bit by bit XOR prducing a result of the same number of bits as the two operands.. an XOR is a Test or filter , if 101 is XORd with 010 the result is 111..
temujin what are you trying to do ?
 
What mathematics software should engineering students use? Is it correct that much of the engineering industry relies on MATLAB, making it the tool many graduates will encounter in professional settings? How does SageMath compare? It is a free package that supports both numerical and symbolic computation and can be installed on various platforms. Could it become more widely used because it is freely available? I am an academic who has taught engineering mathematics, and taught the...

Similar threads

Replies
2
Views
2K
Replies
5
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K