Logic Gates

Parts and wires of the circuit. The levels of the outputs are listed below the board.

Outputs

    Challenges

      Gate reference

      A logic gate turns one or more input bits into an output bit. The symbols are the traditional distinctive shapes. In the expressions, · is AND, + is OR, ⊕ is XOR and a bar over a term is NOT.

      Buffer

      The output copies the input.

      Y equals A

      Buffer truth table
      AY
      00
      11

      NOT

      The output is the opposite of the input. A NOT gate is also called an inverter, and the small circle on a symbol means inversion.

      Y equals not A

      NOT truth table
      AY
      01
      10

      AND

      The output is 1 only when every input is 1.

      Y equals A and B

      AND truth table
      ABY
      000
      010
      100
      111

      OR

      The output is 1 when at least one input is 1.

      Y equals A or B

      OR truth table
      ABY
      000
      011
      101
      111

      NAND

      AND followed by NOT: the output is 0 only when every input is 1. NAND gates alone can be combined into every other gate.

      Y equals the inverse of: A and B

      NAND truth table
      ABY
      001
      011
      101
      110

      NOR

      OR followed by NOT: the output is 1 only when every input is 0. NOR gates alone can also be combined into every other gate.

      Y equals the inverse of: A or B

      NOR truth table
      ABY
      001
      010
      100
      110

      XOR

      Exclusive OR: with two inputs, the output is 1 when the inputs differ. With more inputs it is normally built as a chain of two-input XOR gates, so the output is 1 when an odd number of inputs are 1.

      Y equals A exclusive or B

      XOR truth table
      ABY
      000
      011
      101
      110

      XNOR

      XOR followed by NOT: with two inputs, the output is 1 when the inputs are equal.

      Y equals the inverse of: A exclusive or B

      XNOR truth table
      ABY
      001
      010
      100
      111

      Reading the board

      Level 1 (high): a light stripe runs down the wire and the pins are filled.
      Level 0 (low): a plain wire with hollow pins.
      Unknown: dashed and gray. Usually an input somewhere upstream is not connected.

      Real gates take a short time to respond to a change, called the propagation delay, and it varies with conditions. Circuit timing is often counted in gate delays, one step for each gate a change passes through. That delay is why an odd number of NOT gates in a loop oscillates: each change runs around the loop and comes back inverted.

      Keyboard and mouse

      [ ]
      Select the previous or next part
      ← ↑ → ↓
      Move the selection one hole (with Shift, four)
      Enter or Space
      Flip the selected switch, or hold the selected push button
      W
      Connect mode: arrow keys pick a pin, [ ] pick a part, Enter confirms, Esc cancels
      Delete
      Delete the selection
      2 3 4
      Number of inputs on the selected gates
      P S
      Pause or run the clocks, step them
      Arrow keys in the toolbar or parts tray
      Move between buttons; Enter places the part
      Ctrl Z
      Undo
      Ctrl Y
      Redo (also Ctrl Shift Z)
      Ctrl C X V D
      Copy, cut, paste, duplicate
      Ctrl A
      Select everything
      + − 0
      Zoom in, zoom out, fit
      Drag a pin
      Wire it to the pin you release on
      Drag the board
      Pan; with Shift, select an area. Ctrl with the wheel, or a pinch, zooms.