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

OperationLogic 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
  1. Draw the K-map according to the gray code
  2. Group adjacent cells with 1

Gray code

Two adjacent cells’ corresponding minterms differ in only one variable

  1. 0, 1 (start with 1-bit gray code)
  2. 0, 1, 1, 0 (mirror)
  3. 00, 01, 11, 10 (add 0/1 to the front of left/right part)
  4. 00, 01, 11, 10, 10, 11, 01, 00
  5. 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

InputsInputsOutputsOutputs
00LatchLatch
0101
1010
11InvalidInvalid

NAND Gates Implementation

InputsInputsOutputsOutputs
00InvalidInvalid
0110
1001
11LatchLatch

Gated D-Latch

Clock Implementation

00Unchanged
01Unchanged
100
111


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