Binary is a light switch. Turn on (1), a light goes on. Turn off (0), the light goes off.
You can combine light switches in parallel or series to make different logic.
eg. two light switches in series = AND. Both must be on for the light to turn on.
two light switches in parallel = OR. One or the other must be on for the light to turn on.
Then you build up other logic from there.
eg. Two add two single-bit binary numbers:
0 + 0 = 0, carry = 0
0 + 1 = 1, carry = 0
1 + 0 = 1, carry = 0
1 + 1 = 0, carry = 1
The carry bit is just an AND. the sum bit is an XOR (exclusive or). (A or B) and (not (A and B))
Latest Answers