Basics of binary logic

Truth Table

a b T
R
U
E
O
R
N
a
O
R

b
b a
O
R

N
b
a X
N
O
R
A
N
D
N
A
N
D
X
O
R
N
O
T

a
N
a
A
N
D

b
N
O
T

b
a
A
N
D

N
b
N
O
R
F
A
L
S
E
TTTTTTTTT TFFFFFFFF
FTTTTTFFF FTTTTFFFF
TFTTFFTTF FTTFFTTFF
FFTFTFTFT FTFTFTFTF

Legend

Light grey coloured cells are where no single gate is used to produce output. The output can however be descibed by a single proposition.

T - True
F - False

X - Exclusive, works in conjunction with an OR for example a statement like a OR b.
N / NOT - Not, operates upon a single statement for example NOT a or NOT (a OR b).

AND - operates upon two inputs such as a & b in the form a AND b.
OR - operates upon two inputs such as a & b, OR is inclusive meaning that in a statement like a OR b both a and b can be T and the output will be T, whereas an exclusive OR (XOR) with two inputs both being T will result in the output being F but otherwise the same as OR.

TRUE - No matter what the input from both a & b output will always be T.
OR - If both or either a & b are T output will be T otherwise F.
b - The output is the same as the input from b.
a - The output is the same as the input from a.
XNOR - If input from both a & b are the same then output is T otherwise F (This is the opposite to the XOR).
AND - If input from both a & b is T then output is T otherwise F.
NAND - If input from both a & b is T then output is F otherwise T (This is the opposite to the AND).
XOR - If input from a & b are opposite to each other then output is T otherwise F (This is the exclusivity acting on the OR).
NOT a / N a - Whatever the input is from a the output is the opposite.
NOT b / N b - Whatever the input is from b the output is the opposite.
NOR - If the input from both a & b are F then output is T otherwise F (This is the opposite of OR).
FALSE - No matter what the input from both a & b output will always be F.

Notes

Contrasting this to programming statements a & b are tests, so for example a could look like:

counter_1 > counter_2 (where counter_1 and counter_2 are variables)

and a AND b could look like:

counter_1 > counter_2 AND size_1 <= size_2 (where counter_1, counter_2, size_1 and size_2 are variables)

Note the difference between programming variables like counter_1 and Truth table inputs like a & b, a Truth table input can relate to a programming variable but more commonly it will relate to a condition such as an equality test ie. do some two variables house equal values?.

Page last modified: Unknown since javascript not enabled

1