Back to Courses

Digital Logic & Binary

Learn how digital circuits use binary signals and logic gates to process information

Binary Number System

Digital circuits operate using binary (base-2) numbers with only two states:

  • 0 (LOW): Typically 0V or ground
  • 1 (HIGH): Typically 3.3V or 5V

Binary to Decimal Conversion:

Binary 1011 = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11 (decimal)

Logic Gates

Basic building blocks of digital circuits:

  • AND: Output is 1 only if ALL inputs are 1
  • OR: Output is 1 if ANY input is 1
  • NOT: Inverts the input (0→1, 1→0)
  • NAND: AND followed by NOT (output 0 only if all inputs are 1)
  • NOR: OR followed by NOT (output 1 only if all inputs are 0)
  • XOR: Output 1 if inputs are different
Boolean Algebra

Mathematical notation for logic operations:

• AND: A · B or A ∧ B

• OR: A + B or A ∨ B

• NOT: Ā or ¬A

De Morgan's Laws:

¬(A ∧ B) = ¬A ∨ ¬B

¬(A ∨ B) = ¬A ∧ ¬B

Combinational Circuits
  • Adders: Add binary numbers (half-adder, full-adder)
  • Multiplexers: Select one of many inputs based on control signals
  • Decoders: Convert binary input to one-hot output
  • Encoders: Convert one-hot input to binary output
Sequential Circuits
  • Flip-Flops: Store one bit of information (SR, D, JK, T types)
  • Registers: Store multiple bits (8-bit, 16-bit, etc.)
  • Counters: Count events or generate sequences
  • State machines: Implement complex sequential logic
Applications
  • Microprocessors: CPUs built from millions of logic gates
  • Memory: RAM and ROM using flip-flops and gates
  • Controllers: Arduino, microcontrollers for embedded systems
  • Communication: Serial protocols (UART, SPI, I²C)