Binary Numbers and Logic Gates

Jun 28, 2024

Lecture on Binary Numbers and Logic Gates

Introduction to Binary Numbers

  • Binary: Refers to the number 2.
  • Only two possibilities: 0 or 1.
  • **Circuits: **
    • 0 (Off state)
    • 1 (On state)
  • True/False statements:
    • Off state: False
    • On state: True
  • **Voltage: **
    • Off state: 0 volts
    • On state: Typically 5 volts

Buffer Gate

  • Symbol: Triangle pointing right

  • Input (A): On (1) or Off (0)

  • Output: Same as input

  • **Truth Table: ** | Input | Output | |:-----:|:------:| | 0 | 0 | | 1 | 1 |

  • Circuit Representation: Uses npn transistor, LED as the output

    • Input A (voltage applied)
    • If input is on (1), transistor allows current and LED will be on
    • If input is off (0), transistor off, no current, LED off

NOT Gate

  • Symbol: Triangle with a circle at the front

  • Input (A):

  • Output: Complement of A (A′)

  • **Truth Table: ** | Input | Output | |:-----:|:------:| | 0 | 1 | | 1 | 0 |

  • Circuit Representation:

    • Similar to buffer but LED location differs
    • If input A is on (1), LED off (current diverted through transistor)
    • If input A is off (0), current flows through LED (on)

AND Gate

  • Symbol:

  • Inputs (A and B):

  • Output: A * B

  • **Truth Table: ** | A | B | Output | |:-:|:-:|:------:| | 0 | 0 | 0 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 |

  • Circuit Representation:

    • Uses two transistors in series
    • LED on only when both A and B are on (1)

OR Gate

  • Symbol:

  • Inputs (A and B):

  • Output: A + B

  • **Truth Table: ** | A | B | Output | |:-:|:-:|:------:| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 1 |

  • Circuit Representation:

    • Uses two transistors in parallel
    • LED on if either A or B is on (1)

NAND Gate

  • Symbol: Similar to AND gate but with a circle

  • Output: Complement of AND output

  • **Truth Table: ** | A | B | Output | |:-:|:-:|:------:| | 0 | 0 | 1 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 |

  • **Creating NAND Gate: **AND gate followed by NOT gate

NOR Gate

  • Symbol: Similar to OR gate but with a circle
  • Output: Complement of OR output
  • **Truth Table: ** | A | B | Output | |:-:|:-:|:------:| | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 0 |

Constructing Functions from Block Diagrams

  • Identify logic gates and connections.
  • Example problems provided with solutions:
    • Given input and outputs, derive equations (e.g. F = AB + C)
    • Provided gate function, draw circuit.

Boolean Algebra

  • Associated with binary logic.
  • Commutative Property:
    • A+B = B+A
    • AB = BA
  • Associative Property:
    • A+(B+C) = (A+B)+C
    • A(BC) = (AB)C
  • Identity Property:
    • A+0 = A
    • A1 = A
  • Null Property:
    • A+1 = 1
    • A0 = 0
  • Complement Property:
    • A + A’ = 1
    • AA' = 0

Summary: Understanding binary logic gates (Buffer, NOT, AND, OR, NAND, NOR) and principles of Boolean algebra are essential for constructing and interpreting logic circuits.