XOR of Multiple Bytes - Procedure and Methods

  • Thread starter Thread starter temujin
  • Start date Start date
  • Tags Tags
    bytes Multiple
Click For Summary
SUMMARY

The discussion centers on the procedure for performing XOR operations on multiple bytes. The consensus is that while XOR traditionally operates on two operands, it is possible to extend the operation to multiple bytes by sequentially XORing each byte together. The method involves taking the result of the first two bytes and XORing it with the next byte, continuing this process until all bytes are included. The outcome may differ from a hypothetical three-input XOR operation, which is not standard in binary logic.

PREREQUISITES
  • Understanding of binary operations and logic gates
  • Familiarity with the XOR operation and its properties
  • Basic knowledge of bitwise operations in programming
  • Experience with data manipulation in programming languages
NEXT STEPS
  • Research the implementation of bitwise operations in Python
  • Explore the concept of multi-input XOR functions in digital logic design
  • Learn about the applications of XOR in cryptography and error detection
  • Investigate performance implications of XOR operations in data processing
USEFUL FOR

Software developers, computer scientists, and anyone interested in data manipulation and binary operations will benefit from this discussion.

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 ?
 

Similar threads

Replies
2
Views
2K
Replies
5
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · 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