Breadboard exercisesEnglishРусский

Breadboard exercises

Each exercise is a circuit of CMOS 4000 chips on a breadboard with a full set of materials: how it works, the chips, three schematics, a wiring checklist, and the same circuit in SystemVerilog, with a testbench and the files to run it on an FPGA board or on Tiny Tapeout.

Getting started

G1 · Getting started

Getting started: power, LEDs, a gate and two buttons

The breadboard and its power module, a 5 V LED, the LED module, one AND gate of a 4081 and two buttons: the LED lights only while both are pressed.

4081

SystemVerilog · testbench · scripts · schematics

Basics

B1 · Basics · logic gates

AND, OR, XOR and NOT gates

Two buttons drive one gate of each chip, and an LED module shows A, B and all five results at once: a truth table row per press.

4081407140704069

SystemVerilog · testbench · scripts · schematics

B2 · Basics · logic gates

De Morgan's laws

Both sides of NOT (A AND B) = NOT A OR NOT B and of NOT (A OR B) = NOT A AND NOT B, each from its own gates: the two LEDs of a pair always agree.

408140714069

SystemVerilog · testbench · scripts · schematics

B3a · Basics · gate datasheets

Explore a gate chip: the quad 2-input family

One gate each of the 4001 (NOR), 4011 (NAND) and 4077 (XNOR) on the same two buttons: three truth tables at once, read from the datasheets and checked on the board.

400140114077

SystemVerilog · testbench · scripts · schematics

B3b · Basics · gate datasheets

Explore a gate chip: the triple 3-input family

The four triple 3-input chips, 4023, 4025, 4073 and 4075, on three buttons: NAND, NOR, AND and OR of the same inputs side by side.

4023402540734075

SystemVerilog · testbench · scripts · schematics

B3c · Basics · gate datasheets

Explore a gate chip: the dual 4-input family

The four dual 4-input chips, 4002, 4012, 4072 and 4082, on four buttons: all eight LEDs of the module show the inputs and the four results.

4002401240724082

SystemVerilog · testbench · scripts · schematics

B3d · Basics · gate datasheets

Explore a gate chip: the 8-input gates

The 8-input 4068 (AND/NAND) and 4078 (OR/NOR): four inputs from buttons, four from wires you move between the rails to find the value that decides each gate.

40684078

SystemVerilog · testbench · scripts · schematics

B4 · Basics · flip-flop

D flip-flop with an asynchronous reset

A 4013 stores the button D at each rising edge of a 1 Hz clock; presses between edges are ignored, and the reset button clears Q at once.

4013

SystemVerilog · testbench · scripts · schematics

B5 · Basics · counter

Up/down counter

A 4029 counts the clock up or down, from 0 to 9 or 0 to 15; two wires set the mode, and ~CARRY OUT marks the last count.

4029

SystemVerilog · testbench · scripts · schematics

B6 · Basics · shift register

Shift register: serial in, parallel out

Both halves of a 4015 joined into an 8-bit register: every clock edge takes the button D in and moves all bits one LED along.

4015

SystemVerilog · testbench · scripts · schematics

B7 · Basics · display

Seven-segment display and the 4511 decoder

First light each segment of a common-cathode display by hand, then let a 4511 turn the 4-bit code from four buttons into a digit.

4511

SystemVerilog · testbench · scripts · schematics

B8 · Basics · adder

4-bit adder with buttons and LEDs

Eight buttons give two 4-bit numbers, a 4008 adds them, and five LEDs show the sum in binary, the carry first: practice with binary numbers.

4008

SystemVerilog · testbench · scripts · schematics

B9 · Basics · adder

4-bit adder with three displays

Eight buttons give A and B, a 4008 adds them, and three 4511s show A, B and the sum on two breadboards; the carry lights a decimal point.

40084511

SystemVerilog · testbench · scripts · schematics

Building blocks

BB1 · Building blocks · programmable gate

4048 multifunction 8-input gate

Three wires turn the 4048 into an 8-input AND, OR, NAND, NOR or one of four two-level functions; four buttons drive A-D and the LEDs show J.

4048

SystemVerilog · testbench · scripts · schematics

BB2 · Building blocks · shift register

4014 parallel-in, serial-out shift register

Eight wires set a value, LOAD puts it into a 4014, and every clock edge moves it one stage on: the value leaves at Q8 bit by bit, the serializer of the bit-serial adder.

4014

SystemVerilog · testbench · scripts · schematics

BB3 · Building blocks · comparator

4063 4-bit magnitude comparator

Eight buttons give two 4-bit numbers; a 4063 compares them and a traffic light shows the answer: green A > B, yellow A = B, red A < B.

4063

SystemVerilog · testbench · scripts · schematics

BB4a · Building blocks · multiplexer

Multiplexer 4051: one of eight

Three buttons pick one of eight channels set by wires; INH opens all switches of the analog 4051 and its output floats.

4051

SystemVerilog · testbench · scripts · schematics

BB4b · Building blocks · multiplexer

Multiplexer 4052: two of four

Two buttons pick one of four channels in two multiplexers at once: the 4052 switches a 2-bit word.

4052

SystemVerilog · testbench · scripts · schematics

BB4c · Building blocks · multiplexer

Multiplexer 4053: three switches of two

Three independent 2:1 switches in one 4053, each with its own select button, and a common INH.

4053

SystemVerilog · testbench · scripts · schematics

BB4d · Building blocks · select gate

AND/OR select gate 4019

The 4019 passes word A, word B, both ORed or nothing, chosen by Ka and Kb: a multiplexer built from AND and OR.

4019

SystemVerilog · testbench · scripts · schematics

BB5 · Building blocks · decoder

4028 BCD-to-decimal decoder

Four buttons give a code from 0 to 15, and exactly one of ten LEDs lights for 0-9: the 4028 turns a binary number into one wire per value.

4028

SystemVerilog · testbench · scripts · schematics

BB6 · Building blocks · encoder

4532 priority encoder with a display

Press any of eight buttons and the display shows the number of the highest one: a 4532 priority encoder and a 4511 decoder; GS and EO on LEDs.

45324511

SystemVerilog · testbench · scripts · schematics

BB7 · Building blocks · counter

4017 decade counter with decoded outputs

A 4017 counts the clock from 0 to 9, and a single light runs over ten LEDs; CARRY OUT is high for the first half of the ring.

4017

SystemVerilog · testbench · scripts · schematics

BB8 · Building blocks · FIFO

40105 FIFO: a queue of 4-bit words

Push 3-bit numbers with three data buttons and PUSH, pop them with POP in the same order; a 4013 turns every press into one clean edge for the 40105.

401054013

SystemVerilog · testbench · scripts · schematics

BB9 · Building blocks · register file

40108 register file: four words, two read ports

Write 4-bit words into four registers with buttons and read any two of them at once on the LEDs: the register file of a processor, in one wide chip.

40108

SystemVerilog · testbench · scripts · schematics

BB10 · Building blocks · ALU

40181 ALU: an adder and subtractor

Eight buttons give A and B; one button and an inverter switch the 40181 ALU between A plus B and A minus B, with the carry out and the A=B output on LEDs.

401814069

SystemVerilog · testbench · scripts · schematics

Mini-projects

M1 · Mini-project · adder

Half adder from XOR and AND

Two buttons, an XOR and an AND: the sum and the carry of two bits, the first step from gates to arithmetic.

40704081

SystemVerilog · testbench · scripts · schematics

M2 · Mini-project · adder

Full adder from basic gates

Three bits in, two out: a full adder from two XOR, two AND and one OR gate, the cell that every adder repeats.

407040814071

SystemVerilog · testbench · scripts · schematics

M3 · Mini-project · adder

2-bit adder from a half adder and a full adder

A half adder for bit 0, a full adder for bit 1 and the carry between them: two 2-bit numbers add up to three bits on the LEDs.

407040814071

SystemVerilog · testbench · scripts · schematics

M4 · Mini-project · adder

8-bit adder from two cascaded 4008s

The carry out of one 4008 into the carry in of another makes an 8-bit adder: A from eight buttons, B from eight wires, the sum on the LED module and the ninth bit on a red LED.

4008

SystemVerilog · testbench · scripts · schematics

M5 · Mini-project · multiplexer

8:1 multiplexer from a 4028 decoder, AND and OR gates

A 4028 turns the select into one-hot, eight AND gates let one data wire through and an 8-input OR merges them: the 4051 of BB4a, built from logic.

402840814078

SystemVerilog · testbench · scripts · schematics

M6 · Mini-project · multiplexer

8:1 multiplexer from a 4028 and two 4086 AND-OR-INVERT gates

The same 8:1 multiplexer with two 4086 AND-OR-INVERT gates: the first one's output enables the second, and an inverter undoes the inversion.

402840864069

SystemVerilog · testbench · scripts · schematics

M7 · Mini-project · multiplexer

Dual 4:1 multiplexer from a 4555 decoder, AND and OR gates

Half of a 4555 decodes two select bits; eight AND gates and two 4-input ORs make two 4:1 channels, like the 4052 of BB4b.

455540814072

SystemVerilog · testbench · scripts · schematics

M8 · Mini-project · multiplexer

Dual 4:1 multiplexer from a 4555 and two 4086 AND-OR-INVERT gates

The dual 4:1 multiplexer again, each channel one 4086 AND-OR-INVERT gate and an inverter.

455540864069

SystemVerilog · testbench · scripts · schematics

M9 · Mini-project · select gate

4019 bit-mask merge and the same from basic gates

D = A·Ka + B·Kb for four bits, built twice on one board: in a 4019 and from two 4081s and a 4071; the LED module shows both results side by side.

401940814071

SystemVerilog · testbench · scripts · schematics

M10 · Mini-project · counter

Johnson counter from a 4015 and a 4069

Five stages of a 4015 and one inverter of a 4069 make a ring of ten states: the Johnson counter that hides inside the 4017 of BB7.

40154069

SystemVerilog · testbench · scripts · schematics

M11a · Mini-project · finite state machine

Traffic light: Timofei's original circuit

Timofei Nikiforov's circuit, as on the photo of his board: 3 seconds green, 1 yellow, 3 red. Q7 resets the 4017, so the ring has seven states, and the four OR gates of a 4071 make two 3-input ones.

40174071

SystemVerilog · testbench · scripts · schematics

M11b · Mini-project · finite state machine

Traffic light: 4 + 2 + 4 seconds

All ten states of a 4017 decade counter, ORed into 4 seconds of green, 2 of yellow and 4 of red, in the order of a real traffic light.

401740724071

SystemVerilog · testbench · scripts · schematics

M11c · Mini-project · finite state machine

Traffic light with CARRY OUT

CARRY OUT of the 4017 is high in states 0–4: it gives 5 seconds of red with no gate. One 4-input OR makes green, and Q9 lights yellow directly.

40174072

SystemVerilog · testbench · scripts · schematics

M11d · Mini-project · finite state machine

Traffic light: 3 + 1 + 3 with a 4075 and a reset button

Timofei's timing with one 3-input OR gate of a 4075 per light; the third gate lets a reset button share RESET with Q7.

40174075

SystemVerilog · testbench · scripts · schematics

M12 · Mini-project · counters

Binary counter against a Johnson counter on the 4063

One clock, two counters: a 4029 in binary and a Johnson counter from a 4015 and a 4069; a 4063 compares them and a traffic light shows who is ahead.

4029401540694063

SystemVerilog · testbench · scripts · schematics

Projects

P1 · Project · serial arithmetic

Bit-serial adder: a 4032 between two 4014s and a 4015

LOAD turns two numbers into streams of bits, the 4032 adds them one bit per clock with a stored carry, and a 4015 collects the sum; three displays, three boards, three students.

4014403240154511

SystemVerilog · testbench · scripts · schematics

P2 · Project · serial arithmetic

Bit-serial adder from gates and a flip-flop for the carry

The adder of P1 with the 4032 opened up: a full adder from XOR, AND and OR gates and a 4013 that keeps the carry from one clock to the next.

4014407040814071401340154511

SystemVerilog · testbench · scripts · schematics

P3 · Project · FIFO and flow control

FIFO adder: three 40105s and a 4008 with backpressure

Numbers pushed into two FIFOs at different times are added in pairs into a third; when it is full, the first two wait: the pipeline idea with backpressure, on two boards.

40134010540084082

SystemVerilog · testbench · scripts · schematics

P4 · Project · arbiter

Round-robin arbiter: two requests, two grants

A flip-flop remembers who got the last grant; four gates make sure that two requesters held at 1 take turns, every clock.

4013401140814071

SystemVerilog · testbench · scripts · schematics

P5 · Project · finite state machine

FSM that recognizes 0, 1: the Harris & Harris snail

Two flip-flops of a 4013, an inverter and an AND gate make a Moore machine that lights Y after the button was released for one clock and then pressed.

401340814069

SystemVerilog · testbench · scripts · schematics

P6 · Project · finite state machine

Your own FSM: a code lock

From a sequence to a circuit: a state table, minimized equations, a 40174 and a few gates make a lock that opens after 1, 0, 1; every student gets a code of their own.

40174406940814071

SystemVerilog · testbench · scripts · schematics

P7 · Project · finite state machine

Bit-serial comparator: an FSM against the 4063

Two flip-flops and a handful of gates compare two numbers of any length, one bit per clock, lowest bit first; a traffic light shows the result, as with the 4063.

40694077408140714013

SystemVerilog · testbench · scripts · schematics

More exercises will follow. The full list of 39 breadboard exercises with their parts is on the LSSK exercises page.