Binary Logic and Circuits

Example

Algebraic representation:

Truth table representation:

0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Drawing canvas

Binary Logic Variables

(same as in programming)

Definition

0: false
1: true

Good way to remember, 0 is nothing, so it's false, 1 is something, so it's true

Binary Logic Functions

Definition

These are functions of expressions of binary logic variables on these functions product only 1 and 9 depending on the input.

Logic Operators

Operator Symbol Example
AND "" or nothing ,
OR "+"
NOT "'" or overline ,

Operator precedence: (), NOT, AND, OR (same as in programming)

Notation differs from Logical Operators in mathematics

Binary Circuits

NOT

See negation

Symbol

Drawing canvas
Truth Table

x x'
0 1
1 0

AND

See logical and

Symbol

Drawing canvas
Truth Table

x y xy
0 0 0
0 1 0
1 0 0
1 1 1

OR

See logical or

Symbol

Drawing canvas
Truth Table

x y x + y
0 0 0
0 1 1
1 0 1
1 1 1

NAND

Symbol

Drawing canvas
Truth Table

x y (xy)'
0 0 1
0 1 1
1 0 1
1 1 0

Remark

Thanks to De Morgan's law, the NAND operation is functionally complete. That is, any boolean expression can be re-expressed equivalently with ONLY NAND gates. See Making Other Gates using NAND Gates.

Also see Canonical Expressions#NAND NAND Realization

NOR

Symbol

Drawing canvas
Truth Table

x y (x + y)'
0 0 1
0 1 0
1 0 0
1 1 0

Also see Canonical Expressions#NOR NOR Realization

XOR

Symbol

Drawing canvas
Truth Table

x y
0 0 0
0 1 1
1 0 1
1 1 0

Note

XNOR

Symbol

Drawing canvas
Truth Table

x y
0 0 1
0 1 0
1 0 0
1 1 1

Note

Buffer

Symbol

Drawing canvas
Truth Table

x f
0 0
1 1

Tri-State Buffer

Symbol

Drawing canvas
Truth Table

e x f
0 0 Z
0 1 Z
1 0 0
1 1 1

Multiple Input Gates

You may see gates with multiple inputs

Example

Drawing canvas

This is just taking in multiple inputs and combining them with AND

NAND and NOR Equivalency

Recall De Morgan's law.

Drawing canvas