Lab 8.
Three bits pick
one line.
Light up one of eight lines with the 74138 3-to-8 decoder, then turn its active LOW outputs into a full adder and a full subtractor, first with inverters and OR gates and then with one 4-input NAND per output. Everything is wired on a 3D logic trainer with a working breadboard.
Read the concepts first →Your details
Free to use, no sign up. Your name is only printed on your own lab sheet, and your work is saved in this browser so you can continue later. Nothing is sent to a server.
Decoders with the 74138
This virtual lab is a 74138 decoder simulator on a 3D digital logic trainer with a real breadboard. Three switches select one of eight output lines, and the chosen line goes low while the other seven stay high, which you read on the LEDs.
A decoder makes every minterm of its inputs, so it can build any logic function. You turn the 74138 into a full adder and a full subtractor, first with inverters and OR gates and then with one 4 input NAND gate per output, which uses the active low outputs directly.

What you do on this bench
- Place the 74138 and wire its power and its three enable inputs.
- Step through the eight input codes and record which output goes low.
- Build a full adder from the decoder with inverters and OR gates.
- Rebuild it with 4 input NAND gates on the active low outputs.
- Build a full subtractor the same way and test it.
On the bench
- Digital logic trainer with 16 toggle switches, 16 LEDs, pulse switches, a clock and a two digit seven segment display
- Full size breadboard with power rails and jumper wires that are wired pin by pin
- Cabinet of TTL chips with real pinouts (7400 series)
- Logic probe, multimeter and a binder of chip data sheets
Free, runs in the browser, no sign up and nothing to install. A computer with a graphics card gives the smoothest 3D view.
Questions students ask
What does the 74138 do?
It is a 3 to 8 line decoder. The three select inputs choose one of eight outputs, which goes low; the chip works only when G1 is high and G2A and G2B are low.
Why use NAND gates on the decoder outputs?
The outputs are active low, so each output is already a complemented minterm. A NAND gate of the chosen outputs gives the OR of those minterms without extra inverters.
How can two 74138 chips make a 4 to 16 decoder?
Use the fourth input to enable one chip and disable the other through their enable pins, so each chip covers eight of the sixteen outputs.
Read the concepts page for this lab · All Digital Logic Design virtual labs · All articles