Karnaugh Maps

K-maps

Boolean logic

  • State
    • 1/0, on/off, true/false
  • Gates/conditional operators
    • and (X && Y)
      • both inputs true
    • or (X || Y)
      • at least one of the inputs true
    • xor (X ^ Y)
      • one, and only one, of the inputs is true
    • not (X' or !X)
      • opposite of the input

Truth tables

Truth tables are visual representations of a function with binary (boolean) input and output. For example, a function receives input 1,0,1 and outputs 1.

How truth tables are often solved

Karnaugh way

  • Gray codes
  • Rectangles
  • Find solutions, OR with each other

Gray Codes

  • Binary combinations, each one differs by only one byte from the previous

  • 00 -> 01 -> 11 -> 10
  • 000 -> 001 -> 011 -> 010 -> 110 -> 111 -> 101 -> 100
  • Originally created to prevent spurious output from electromechanical switches
  • Also used for error correction with digital communications

Rectangles

Now we want to draw the largest rectangles possible on each group of Trues.

Find solutions

Each rectangle's Trues have something in common. Solutions for these smaller parts are a lot easier to find on their own rather than guessing and checking the entire table.

Once you have the solutions for every rectangle, combine all of those with each other, joining with ||.

k map

By Isaac

k map

  • 491