Built-in project · no microcontroller

CD4000 gate drawer

16 chips on breadboards, powered, every input tied low and ready to rewire. There is no microcontroller in it: the simulator solves the 16 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

Teaching? Assign it to your class in one click.

Beginner About 20 minutes to build and run. Runs in your browser. Free, and no account needed.

The parts retail for about $21. On Mokxi they're free.

The circuit runs here once the page has loaded.

What you'll learn

  • What AND, OR, NAND, NOR, XOR and XNOR do
  • Why unused inputs are tied low, not left floating
  • Reading a truth table from a real circuit
  • The difference between a gate and an inverter
  • What a Schmitt trigger input is for
  • Difficulty: Beginner
  • Time: About 20 minutes
  • Parts: 22

How it works

This is a drawer of 16 CD4000 series chips on three breadboards: NOR, NAND, OR, AND, XOR, XNOR, inverters and Schmitt triggers. Each chip has power on its VDD pin and ground on its VSS pin.

Every input is wired to ground, so none is left floating. Nothing else is connected. No code runs, because there is no microcontroller.

You pick a chip and move an input wire from ground to the plus rail. Then you put an LED and a resistor on an output and see what the gate does. Each chip's help page has its pins and truth table.

Parts list

22 parts, plus the jumper wires. They retail for about $21; on Mokxi they're free.

  • 3 × Full-size breadboard
  • 3 × Power, 5 V
  • 1 × CD4001 quad NOR
  • 1 × CD4011 quad NAND
  • 1 × CD4071 quad OR
  • 1 × CD4081 quad AND
  • 1 × CD4070 quad XOR
  • 1 × CD4030 quad XOR
  • 1 × CD4077 quad XNOR
  • 1 × CD4002 dual 4-input NOR
  • 1 × CD4012 dual 4-input NAND
  • 1 × CD4023 triple 3-input NAND
  • 1 × CD4025 triple 3-input NOR
  • 1 × CD4069 hex inverter
  • 1 × CD4049 hex inverter buffer
  • 1 × CD4050 hex buffer
  • 1 × CD4093 quad Schmitt NAND
  • 1 × CD40106 hex Schmitt inverter

Wiring table

Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.

Part and pinConnects to
CD4001 quad NOR pin VDD5 V
CD4011 quad NAND pin VDD5 V
CD4071 quad OR pin VDD5 V
CD4081 quad AND pin VDD5 V
CD4070 quad XOR pin VDD5 V
CD4030 quad XOR pin VDD5 V
CD4001 quad NOR pin 1AGround
CD4001 quad NOR pin 1BGround
CD4001 quad NOR pin 2AGround
CD4001 quad NOR pin 2BGround
CD4001 quad NOR pin VSSGround
CD4001 quad NOR pin 3AGround
CD4001 quad NOR pin 3BGround
CD4001 quad NOR pin 4AGround
CD4001 quad NOR pin 4BGround
CD4011 quad NAND pin 1AGround
CD4011 quad NAND pin 1BGround
CD4011 quad NAND pin 2AGround
CD4011 quad NAND pin 2BGround
CD4011 quad NAND pin VSSGround
CD4011 quad NAND pin 3AGround
CD4011 quad NAND pin 3BGround
CD4011 quad NAND pin 4AGround
CD4011 quad NAND pin 4BGround
CD4071 quad OR pin 1AGround
CD4071 quad OR pin 1BGround
CD4071 quad OR pin 2AGround
CD4071 quad OR pin 2BGround
CD4071 quad OR pin VSSGround
CD4071 quad OR pin 3AGround
CD4071 quad OR pin 3BGround
CD4071 quad OR pin 4AGround
CD4071 quad OR pin 4BGround
CD4081 quad AND pin 1AGround
CD4081 quad AND pin 1BGround
CD4081 quad AND pin 2AGround
CD4081 quad AND pin 2BGround
CD4081 quad AND pin VSSGround
CD4081 quad AND pin 3AGround
CD4081 quad AND pin 3BGround
CD4081 quad AND pin 4AGround
CD4081 quad AND pin 4BGround
CD4070 quad XOR pin 1AGround
CD4070 quad XOR pin 1BGround
CD4070 quad XOR pin 2AGround
CD4070 quad XOR pin 2BGround
CD4070 quad XOR pin VSSGround
CD4070 quad XOR pin 3AGround
CD4070 quad XOR pin 3BGround
CD4070 quad XOR pin 4AGround
CD4070 quad XOR pin 4BGround
CD4030 quad XOR pin 1AGround
CD4030 quad XOR pin 1BGround
CD4030 quad XOR pin 2AGround
CD4030 quad XOR pin 2BGround
CD4030 quad XOR pin VSSGround
CD4030 quad XOR pin 3AGround
CD4030 quad XOR pin 3BGround
CD4030 quad XOR pin 4AGround
CD4030 quad XOR pin 4BGround

94 more connections: open it in the simulator to see them all.

The notes that come with it

There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.

sketch.ino
// CD4000 gate drawer.
//
// Every chip is on a breadboard and powered, and every one of its inputs is
// tied low by a wire to a ground rail, so nothing floats. Nothing else is
// wired: pick a chip, move an input's wire to the + rail, put an LED with a
// resistor on an output, and see what it does. Each chip's help page has its
// pins and its truth table.

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The output LED never lights, whatever the inputs. This project
    Put the LED in series with a resistor from the output pin to ground, and check the chip's truth table for what the output should be.
  • A gate behaves strangely after you rewire it. This project
    Do not leave an input unconnected. Tie it to the plus rail or to ground, because a floating CMOS input picks up noise.
  • Outputs behave randomly. CD4001 quad NOR
    Tie every unused input to GND or VDD. A floating CMOS input picks up noise. Also tie unused gates so they do not waste power.
  • It is slow or weak at low voltage. CD4001 quad NOR
    The CD4001 runs on 3 V to 18 V, VDD on pin 14 and VSS on pin 7. Output current is small, so use a resistor with an LED and add a 0.1 uF decoupling cap.
  • An unused gate in the package floats and the output behaves oddly, or current rises. CD4011 quad NAND
    Tie both inputs of every unused NAND gate to GND or VCC. Floating CMOS inputs pick up noise and can draw current. VDD is pin 14 and VSS is pin 7.
  • The output does not drive an LED or other load well. CD4011 quad NAND
    CMOS outputs supply only a few mA. Add a resistor and use a buffer or transistor for anything heavier. Supply is 3 to 18 V, and the output swings to the supply voltage.
  • An output is stuck or the chip acts randomly. CD4071 quad OR
    Never leave a CMOS input floating. Tie unused OR inputs to ground, and tie unused gates' inputs low. A high on any input of an OR gives a high output.
  • The output cannot drive a load such as an LED or motor. CD4071 quad OR
    CMOS outputs only supply a few mA. Use a resistor and LED with low current, or add a transistor. Connect VDD (pin 14) and VSS (pin 7), and add a 0.1 uF decoupling capacitor.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.