Logic Operations
The three fundamental logic operations are AND, OR, NOT
OR can be built using AND and NOT
NAND and NOR are universal gates
| Operation | Logic Equation |
|---|---|
| AND | |
| OR | |
| NOT | |
| NAND | |
| NOR | |
| XOR |
Combinational logic circuits
- No memory
- Can be fully specified with truth table or logic equation
- Output depends only on current inputs
Multiplexor/De-multiplexor
Multiplexor (or selector, MUX) selects one of the data inputs as output by a control input value
- -to-1 multiplexor
- data inputs
- n selection inputs
- a single output
Decoder/Encoder
Decoder (n-to- decoder) has n-bit input and 1-bit outputs, where the output maps the input to a binary form
- n-to- decoder
- n inputs
- 1-bit outputs
The output corresponds to the input bit pattern is true while all other outputs are false
- -to-n encoder
- 1-bit inputs
- n outputs
Adder
- 1-bit half adder
2-bit Comparator

Example

Canonical Form
Any Boolean function can be expressed in its two-level representation
- Sum-of-products (SoP) of its 1-minterms
- Product-of-sums (PoS) of its 0-maxterms
Programmable Logic Array (PLA)
A gate-level implementation of the two-level representation
Laws of Boolean Algebra

Exercises
K-map
- adjacent cells in each group
- Toroid (leftmost adjacent to rightmost, topmost adjacent to bottom cells)
- Larger groups fewer inputs to the AND gates
- Fewer groups fewer AND gates and fewer inputs to OR gates
- Best group might not be unique
- Draw the K-map according to the gray code
- Group adjacent cells with 1

Gray code
Two adjacent cells’ corresponding minterms differ in only one variable
- 0, 1 (start with 1-bit gray code)
- 0, 1, 1, 0 (mirror)
- 00, 01, 11, 10 (add 0/1 to the front of left/right part)
- 00, 01, 11, 10, 10, 11, 01, 00
- 000, 001, 011, 010, 110, 111, 101, 100
Sequential Logic Circuits
- Memory
- Output depends on current inputs and value stored in memory (state)
S-R Latches (set-reset latches)
NOR Gates Implementation
| Inputs | Inputs | Outputs | Outputs |
|---|---|---|---|
| 0 | 0 | Latch | Latch |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | Invalid | Invalid |

NAND Gates Implementation
| Inputs | Inputs | Outputs | Outputs |
|---|---|---|---|
| 0 | 0 | Invalid | Invalid |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | Latch | Latch |

Gated D-Latch

Clock Implementation
| 0 | 0 | Unchanged | |
| 0 | 1 | Unchanged | |
| 1 | 0 | 0 | |
| 1 | 1 | 1 |


Master-Slave D Flip-Flop

Clock
- Free-running signal with a fixed cycle time
- All state changes occur on a clock edge (rising/falling)
Register
