I built a programmable 8-bit computer from scratch on breadboards using only simple logic gates. I documented the whole project in a series of YouTube videos and on this web site. For an introduction:
Background
If you’re interested in seeing the computer in action to get a sense of what it can do, check out these videos:
- Programming my 8-bit breadboard computer
- Stepping through a program on the 8-bit breadboard computer
- Comparing C to machine language (this and the following video will give you a sense of how this simple computer relates to modern computers you may be more familiar with)
- Programming Fibonacci on a breadboard computer
If you want to dive into the details of how the computer works and understand it from first principles, but are a little unsure of how transistors and logic gates work (or just want a refresher), here’s a few videos to serve as an introduction:
- How semiconductors work
- How a transistor works
- Making logic gates from transistors
- SR latch
- D latch
- D flip-flop
Computer modules
The computer is composed of several modules, each of which performs just a few basic functions. Check out these posts for more detailed information on building each module:
- Clock module (CLK)
- Registers (A, B, IR)
- Arithmetic and logic unit (ALU)
- Random access memory (RAM)
- Program counter (PC)
- Output (OUT)
- Bringing it all together (BUS)
- Control logic (CONT)
Complete parts list
Here’s a complete parts list of everything I used to build the breadboard computer. The total cost works out to roughly $150-$200 USD depending on what breadboards you use and how much you end up paying for shipping.
There’s no right way to do this project. There are tons of substitutions and other approaches which will work just as well (or better), so if you want to build something similar and can’t find all the parts, try to figure out what the missing part does and find a different way of doing it. It might not work the first time, but you’ll learn a ton from trying to figure out why.
(If you click through any of the Amazon links, I get a tiny cut, though it won’t cost you any more. I’m a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.)
| Quantity | Description | Approx. cost each | Approx. total cost | Sources | Modules |
|---|---|---|---|---|---|
| 14 | Breadboard | $3 - $8 | $36 - $96 | Amazon Jameco | All |
| 1 | 22 AWG Solid Tinned-Copper Hook-Up Wire | $16.00 | $16.00 | Jameco Amazon | All |
| 10 | 1kΩ resistor | $0.10 | $0.99 | Jameco Amazon | CLK, RAM, OUT |
| 9 | 10kΩ resistor | $0.10 | $0.99 | Jameco Amazon | BUS |
| 1 | 100kΩ resistor | $0.10 | $0.99 | Jameco Amazon | CLK, OUT |
| 24 | 470Ω resistor | $0.10 | $2.97 | Jameco Amazon | CONT |
| 1 | 1MΩ resistor | $0.10 | $0.99 | Jameco Amazon | CLK |
| 1 | 1MΩ potentiometer | $1.39 | $1.39 | Jameco Amazon | CLK |
| 6 | 0.01µF capacitor | $0.12 | $1.20 | Jameco Amazon | CLK, RAM, OUT |
| 16 | 0.1µF capacitor | $0.15 | $3.00 | Jameco Amazon | CLK |
| 1 | 1µF capacitor | $0.15 | $0.15 | Jameco Amazon | CLK |
| 4 | 555 timer IC | $0.35 | $1.40 | Jameco | CLK, OUT |
| 2 | 74LS00 (Quad NAND gate) | $0.79 | $1.58 | Jameco Amazon* | RAM |
| 1 | 74LS02 (Quad NOR gate) | $0.55 | $0.55 | Jameco Amazon* | CONT |
| 5 | 74LS04 (Hex inverter) | $0.59 | $2.95 | Jameco Amazon* | CLK, RAM, CONT |
| 3 | 74LS08 (Quad AND gate) | $0.69 | $2.07 | Jameco Amazon* | CLK, OUT |
| 1 | 74LS32 (Quad OR gate) | $0.49 | $0.49 | Jameco Amazon* | CLK |
| 1 | 74LS76 (Dual JK flip-flop) | $1.20 | $1.20 | Futurlec | OUT |
| 2 | 74LS86 (Quad XOR gate) | $0.55 | $1.10 | Jameco Amazon* | ALU |
| 1 | 74LS138 (3-to-8 line decoder) | $0.69 | $0.69 | Jameco Amazon* | CONT |
| 1 | 74LS139 (Dual 2-line to 4-line decoder) | $0.69 | $0.69 | Jameco Amazon* | OUT |
| 4 | 74LS157 (Quad 2-to-1 line data selector) | $0.69 | $2.76 | Jameco Amazon* | RAM |
| 2 | 74LS161 (4-bit synchronous binary counter) | $0.79 | $1.58 | Jameco | PC, CONT |
| 8 | 74LS173 (4-bit D-type register) | $1.39 | $11.12 | Jameco | REG, RAM |
| 2 | 74189 (64-bit random access memory) | $4.95 | $9.90 | Jameco | RAM |
| 6 | 74LS245 (Octal bus transceiver) | $0.79 | $4.74 | Jameco Amazon* | REG, ALU, RAM, PC |
| 1 | 74LS273 (Octal D flip-flop) | $0.75 | $0.75 | Jameco Amazon* | OUT |
| 2 | 74LS283 (4-bit binary full adder) | $1.49 | $2.98 | Jameco | ALU |
| 4 | 28C16 EEPROM | $3.95 | $11.85 | Jameco | OUT, CONT |
| 3 | Double-throw toggle switch | $0.99 | $2.97 | Jameco Amazon | CLK, RAM |
| 3 | Momentary 6mm tact switch | $0.35 | $1.05 | Amazon Jameco | CLK, RAM |
| 1 | 8-position DIP switch | $0.79 | $0.79 | Jameco Amazon | RAM |
| 1 | 4-position DIP switch | $0.89 | $0.89 | Jameco Amazon | RAM |
| 44 | Red LED | $0.12 | $6.00 | Amazon Jameco | BUS, REG, ALU, RAM |
| 8 | Yellow LED | $0.09 | $0.90 | Amazon Jameco | REG, RAM, CONT |
| 12 | Green LED | $0.10 | $2.00 | Amazon Jameco | RAM, PC, CONT |
| 21 | Blue LED | $0.59 | $12.39 | Amazon Jameco | CLK, REG, CONT |
| 4 | Common cathode 7-segment display | $1.09 | $4.36 | Jameco Amazon | OUT |
Additionally, I used an Arduino Nano and two 74HC595 shift registers to build a simple EEPROM programmer to program the 28C16 EEPROMs used in the output module and control logic.
Breadboards
A note on breadboards: You can get them from lots of places for different prices. The best quality I’ve found is the BB830 by BusBoard Prototype Systems. I get them on Amazon, but they’re not cheap. (If you’re paying less than $7-8 USD each, you’re probably getting a fake.)
Lower quality, cheaper breadboards will probably work just fine (and save a bunch of money if you’re buying ~12 of them). The biggest differences include inadequate funneling on each hole, making it harder to properly insert components (this can vary a lot, from not a big deal to useless); inconsistent coloring (i.e., several breadboards, even ordered at the same time, are different shades of white); confusing labeling (e.g., numbers not lining up with holes); and warping (i.e., the breadboard doesn’t sit completely flat). Most of those aren’t deal-breakers, and if something doesn’t work right, look on the bright side: you get to troubleshoot it and learn more 🙂
Discuss this on Hacker News: https://news.ycombinator.com/item?id=14883776