Learn

Digital logic lab experiments you can assign and grade online

Beginner

Or see every lesson.

  • 261parts on the bench
  • 31boards running now
  • 1.00xreal time, on every board
Gate lablive0.000 s 0.00x
Hold A, then B
Two buttons drive an AND, an XOR and a NOT. Hold a button to light the truth table.

These are digital logic lab experiments for a college or university class, ready to hand out. Each one starts from a circuit that is already built. Each one comes with a short list of checks, and Mokxi runs those checks on every student’s work.

The circuit above is the first one, the gate lab. Hold button A, button B or both, and the gates light their LEDs. It runs in this browser tab, with nothing to install.

You do not need a lab kit or a logic trainer for any of this. Students need a browser, on a laptop, a lab PC or a Chromebook.

How to set up a lab

Make a class at /class and read out the six-letter join code. Students join at the same address. Then press Assign work, choose A template, and pick the template the lab names.

Under the assignment, press Checks and add the checks listed with the lab. Type the name exactly as shown, because the name is what a student reads when a check fails. Then press Save the checks.

Press Try it on the starter. On the untouched starter, the checks for the change should fail and the rest should pass. That shows the checks can tell a finished lab from an unfinished one.

One thing to know about checks: all the checks in one list run in one simulation. A press in one check is a press for every other check, so each press in these lists has its own moment.

Lab 1: Turn an AND gate into a NAND gate

The gate lab has two buttons, A and B, and three gates. Gate g1 is an AND gate.

Click g1 and change its function to nand in the properties panel. Run it.

Fill in the truth table for all four rows. Hold A, then B, then both. Write down what the LED on g1 does each time.

Save, then submit from the Save menu.

The starter is the template called Gate lab in Assign work. It is also the built-in project at /projects/gate-lab.

Add these 8 checks under Checks:

Check 1: With no button pressed, g1 gives 1. The form writes it as: pin Y on g1 reads HIGH at 250 ms.

Check 2: Press A, then let go: g1 gives 1 again. The form writes it as: after pb1 is pressed at 300 ms for 400 ms: pin Y on g1 reads HIGH at 710 ms, by 710 ms.

Check 3: With only A held, g1 gives 1. The form writes it as: pin Y on g1 reads HIGH at 500 ms.

Check 4: Press B, then let go: g1 gives 1 again. The form writes it as: after pb2 is pressed at 800 ms for 400 ms: pin Y on g1 reads HIGH at 1210 ms, by 1210 ms.

Check 5: With only B held, g1 gives 1. The form writes it as: pin Y on g1 reads HIGH at 1 s.

Check 6: Press A and B together, then let go: g1 gives 1 again. The form writes it as: after pb1 is pressed at 1300 ms for 400 ms: pin Y on g1 reads HIGH at 1710 ms, by 1710 ms.

Check 7: Press B with A, then let go: the XOR gives 0. The form writes it as: after pb2 is pressed at 1300 ms for 400 ms: pin Y on g2 reads LOW at 1710 ms, by 1710 ms.

Check 8: With A and B held, g1 gives 0. The form writes it as: pin Y on g1 reads LOW at 1500 ms.

Lab 2: Make the ripple counter count twice as fast

Two 74HC74 chips hold four flip-flops. Each one divides its clock by two, so the four LEDs count in binary.

The clock part runs at 4 Hz. Bit 0 changes every 250 ms, so it makes one full cycle every 500 ms.

Change the clock so the count goes twice as fast. Before you run it, write down the new period of bit 0 and bit 1.

Run it and check your numbers on the LEDs. Then submit.

The starter is the template called Binary counter in Assign work. It is also the built-in project at /projects/binary-counter.

Add these 2 checks under Checks:

Check 1: Bit 0 makes one cycle every 250 ms. The form writes it as: pin 1 on r1 toggles every 250 ms, within 20 ms, watched for 4 s.

Check 2: Bit 1 makes one cycle every 500 ms. The form writes it as: pin 1 on r2 toggles every 500 ms, within 30 ms, watched for 4 s.

Lab 3: From one gate to a computer

For a longer unit, the logic path starts with one NAND gate. Students build NOT, AND, OR and XOR from it, then adders, an ALU, memory and a small 8-bit CPU called the Kestrel. There are twenty-three lessons, about sixteen hours in all.

Each lesson checks the student’s circuit against its truth table, on the simulator, row by row. A wrong row is named in a sentence. Some steps say NAND gates only, and the checker opens every chip to make sure.

One honest limit: the Assign work form does not list the logic path lessons yet. It lists four built-in lessons and the lessons you write. So students work through the path from its own page, and each step is still checked for them.

What students learn from real chips

The gate lab uses ideal gates, so students can focus on the truth table. The later labs use 74HC chips as real 14-pin and 16-pin packages. A chip needs its power pins wired, just like on a bench. Forget them, and the outputs do nothing.

The chips include the 74HC00, 02, 04, 08, 14, 32 and 86 gates, the 74HC74 flip-flop, the 74HC138 decoder, the 74HC161 and 74HC193 counters, and the 74HC165 and 74HC595 shift registers. There is also a clock part, a logic probe and a logic analyzer.

Questions

Do students need an account?

Not to open and run a circuit. To join your class and submit work, yes, because a class is a list of names. The join code carries through sign-up, so nobody has to remember it.

Can a check read the truth table while a button is held?

Yes, with a plain pin check timed while a press from another check is still held. A check after a press reads the pin once the button is let go. Lab 1 uses both kinds.

Is there VHDL, Verilog or an FPGA?

No. Mokxi builds circuits from gates and chips on a breadboard. There is no hardware description language and no programmable logic. Karnaugh maps are done on paper, then built.

Can I write my own lab?

Yes. Save any circuit to your account, assign it with One of my projects, and add up to twenty checks. You can lock the parts you want kept in place.

Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.