I've looked all through my notes and searched on google and cannot find the binary Add, and, or, xor rules. I know add. eg 10+11=101 Can anyone help with and, or and xor. Or a link if they have better luck searching.
and 11 + 01 = 100 , straight binary and
or 11 + 01 = 11 , if a bit is set to one then that bit in answer is 1
xor 11 + 01 = 10 , bit in answer is set ONLY if bits are different
//edit// if using a adder for the And otherwise as below
AND and XOR are very simple operations; you simply go through each bit and compare them. For an AND operation, the resultant bit is 1 if both operand bits are 1, 0 if otherwise. For XOR operation, the resultant bit is 1 if only one operand bit is 1. If either both are 0 or both are 1, the resultant bit is 0.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.