Boolean arithmetic


Boolean

Named after George Boole.

Boolean algebra properties

Associativity

  • a + (b+c) = (a+b) + c
  • a(bc) = (ab)c

Absorption

  • a + ab = a
  • a(a + b) = a

de Morgan's laws

  • (ab)' = a' + b'
  • (a+b)' = a'b'

Identity

  • a + 0 = a
  • a.1 = a

Commutativity

  • a.b = b.a
  • a + b = b + a

Distributivity

  • a(b + c) = ab + ac
  • a + bc = (a + b).(a + c)

Idempotency

  • a.a = a
  • a + a = a

Involution

aka 'double negation'.

  • (a')' = a

Operations

AND

a b y
0 0 0
0 1 0
1 0 0
1 1 1

OR

a b y
0 0 0
0 1 1
1 0 1
1 1 1

XOR

Exclusive OR.

True only when inputs doesn't have the same value.

a b y
0 0 0
0 1 1
1 0 1
1 1 0

NAND

Inverted AND

a b y
0 0 1
0 1 1
1 0 1
1 1 0

NOR

Inverted OR

a b y
0 0 1
0 1 0
1 0 0
1 1 0

XNOR

Inverted XOR.

ie, True when both inputs are the same.

a b y
0 0 1
0 1 0
1 0 0
1 1 1

Universal gates

NAND

NOR

References