flat assembler
Message board for the users of flat assembler.
Index
> Main > What is the "Equation" of XOR (Bitwise)? (If there 
Author 

asmhack 19 Apr 2011, 00:55
Code: 110 ;6 100 ;4 ____ 010 ;2 1001 ;9 1100 ;12 ____ 0101 ;5 xor is a digital logic gate that implements an exclusive disjunction, not absolute subtraction, that's the conditions. 

19 Apr 2011, 00:55 

revolution 19 Apr 2011, 01:01
XOR is the same as addition (and subtraction) but without any internal carries propagated.
For each bit in the operand: 0+0=0 0+1=1 1+0=1 1+1=0 (ignore the carry) Works for subtraction also: 00=0 01=1 (ignore the carry) 10=1 11=0 The mathematical equivalent would be: bitwise A + B = C mod 2 

19 Apr 2011, 01:01 

typedef 19 Apr 2011, 01:12
Oh, so the trick is to just convert from whatever base you are in to base 2 and then use the truth table ?.......


19 Apr 2011, 01:12 

revolution 19 Apr 2011, 01:24
AFAIK XOR is only defined in the binary domain. "boolean" is the word that should alert you to it being binary.


19 Apr 2011, 01:24 

bitRAKE 19 Apr 2011, 02:12
A xor B = (A or B) and ((not A) or (not B))
...and the wiki has several alternatives. 

19 Apr 2011, 02:12 

bitshifter 19 Apr 2011, 10:45
My BitBox helps to visualize such things...
http://board.flatassembler.net/topic.php?t=11615 Have fun 

19 Apr 2011, 10:45 

< Last Thread  Next Thread > 
Forum Rules:

Copyright © 19992020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.