1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Xor of multiple bytes

  1. Jun 1, 2005 #1

    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?

  2. jcsd
  3. Jun 1, 2005 #2
    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.
  4. Jun 1, 2005 #3
    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 ?
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook