Skip to the content
PCBKitNew board
4 layers244.5 × 393.4 mm8-bit cpu, the printed circuit board in 3D

8-bit CPU

Size
244.5 × 393.4 mm
Copper layers
4
Thickness
1.6 mm
Parts
458
Nets
455
Pads
1,921
Tracks, vias
5,200, 271
Pours
4
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
10 Dec 2023
Updated
1 Jan 2024

Overview

8-bit cpu is an open-source printed circuit board by nurk, from the nurk/8-bit-cpu repository on GitHub. It is a 4-layer board of 244.5 × 393.4 mm with 458 parts on 455 nets, routed with 5,200 tracks and 271 vias.

It is built around the 74HCT245, 74HCT173D and 74HCT157D, with the 74HCT00D, 74HCT04D and 74HCT193D among its other parts. Its parts include 166 resistors, 122 diodes, 83 capacitors, 65 ICs and 7 switches. It belongs with the retro computing and games boards of this library.

Main components

12

README

README.md

This repository contains my design of the Ben Eater 8-bit computer. I call it an 8-CPU instead of a computer because to me it feels more like a CPU.

If you were to do a checkout of this, it is basically a KiCad project folder. It will not contain all the symbols I used because the ones I designed I made global in KiCad, but I added a PDF of all the schematics.

You will also find my instruction set, the code to program the EEPROM's and the code to program the CPU which includes my test programs.

Below is a little badly written story of my journey.

8-bit CPU

I have always been intrigued by electronics by have never done anything with it.

A while back I found a video series by Ben Eater about building an 8-bit computer on breadboards (YouTube). Watching the series I learned a lot about how CPU's (could) work and was really fascinated. It all did not seem that complicated.

So after thinking about it for a while and checking my finances (It is not really cheap) I decided to build a variation of it. But first I did some research and set some goals.

The research taught me that I should not skimp on breadboard quality. There are a lot of people that write about this and the breadboards from BusBoard Prototype Systems seem to be one of the best.

Next I started digging into what types of 74 series logic chips there are. I learned that the 74LS series that Ben uses are TTL logic chips but they are rather power hungry. I decided I wanted to go with CMOS logic chips because they are more efficient. In the end I went for 74HCT chips. They are CMOS chips with TTL level support. I went for this because I don't really know anything about this and I was not sure if I needed TTL level support in some parts.

So the chip series was decided and the breadboard brand was decided, now I needed a way to get all these things. I started searching for those online and found the usual suspects:

  • Farnell
  • Digikey
  • Mouser
  • ...

I live in Belgium so delivery costs, import taxes and VAT were important. After a test order from Mouser I learned that they take care of the VAT and the import taxes, and when you order over 50 EUR (excluding VAT) the delivery is free. Just don't get caught at checkout because the prices on the site are without VAT.

I would also need a power supply. I did not want to use a cut open USB cable but wanted some extra features.

  • The device needed a global on/off switch
  • I needed to be able to toggle the output on or off
  • Obviously the voltage should be settable
  • The amperage should be limited
  • I wanted over current protection so the output would be turned off if my creation would draw more than the set amps

On Amazon I found this device that had all the features I wanted and it was not out of my budget.

Amazon was also used to buy the wires and initially some resistors. The wires were great and I ordered multiple of those because it seems this thing needs a lot of wire. The resistors I hated and did not use. The legs have a diameter of 0.3 mm which is just too thin. When you want to insert them into a breadboard they just bend. The resistors eventually also came from Mouser.

Next up, the goals of this build.

  • I wanted a schematic of my build so I learned to use KiCad
  • Have more RAM so I could use all 8 address bits
  • Have the RAM split so the first 128 bytes are for application memory and second 128 bytes are for data memory. I did not want my application to overwrite itself
  • Have an X register with +1 / -1 feature to enable specific loops and have it set the carry flag and zero flag
  • Have a Stack
  • Do not leave any input pins floating
  • Have a 220 Ohm resistor on each LED (this includes each segment of the 7-segment display)
  • Have a 100nF decoupling capacitor for each chip

The 220 Ohm resistor on each LED really made me think about component placement. It dictated the layout on the breadboards. Unlike what Ben does in his videos I could not just go from an output pin to ground.

After all the orders arrived I started building my CPU module by module in the order of the videos. I would first design each module in KiCad and use my design to build it on breadboards.

While building I initially used 10k Ohm resistors to either pull-up or pull-down control signal pins. That way I could use a jumper wire to switch its state without the pin being floating during the transition. (The resistors were removed after wiring up the control signals.) The different modules were tested individually once they were finished.

When building the output module I noticed I did not order any 74HCT273 chips. So I changed my design to use what I had which were 74HCT173 D-type flip flops. In hindsight this seems to be a blessing in disguise because there seems to be a design issue with using the 74HCT273 as can be seen here.

After finishing the clock, program counter, a register, alu, b register, output, ram and instruction register I decided to combine them and wire them up to the bus. This is were I got hit with my first problem.

Whenever there were more than 4 LED's active in the RAM value and I would change the RAM output control signal (high to low or low to high) the RAM address register would reset. I searched for hours what the cause could be but never figured it out. I rewired stuff, replaced chips, disconnected modules from the bus, added pull-up and pull-down resisters, ... but everything stayed the same. Motivation really sank so drastic measures needed to be taken. Given the RAM address gets loaded by the program counter initially I decided I did not need a reset there and removed the reset line and tied the pins to ground. Problem solved.

Next I built the last 4 modules: control logic, CPU flags, X register and stack. When they were done I wired up everything. Guess what, things did not work as expected. Some of the problems I saw:

  • The A register would reset randomly
  • The X register would reset randomly
  • The X register would load data from the bus at random points
  • The X register would increment and decrement randomly
  • The stack would increment and decrement randomly
  • RAM not always writing

Those dreaded random resets were spreading. Given I have no oscilloscope I could not really see what was going on with reset line but after some mental gymnastics I figured there must be some noise getting to the reset line. Given I know nothing about electronics I started trying things.

When I put a 10nF capacitor on the reset line close to the reset pin and ground of the A register it no longer did the random reset but the button to reset everything still worked. I did the same with the X register and wired up the reset for the RAM address again with a 10nF capacitor. No more random resets. I still don't know why this is happening but it is fixed. Problem solved.

Next up were the random actions in the X register and stack. After searching the internet I found out that when you change the address on an EEPROM there is a period of time where the data is invalid (this is also in the datasheet). This shows itself by data pins going high or low randomly during the invalid period. This was triggering the random actions.

The first fix was not to trigger the load of the X register by just using an inverted control signal. I used the non inverted control signal and the clock through a NAND gate to trigger the load. This way the loading is tied to a clock transition which is in line with the rest of the design. This made things better but did not solve everything.

After some more searching on the internet I found a post where someone explained that the entire computer reacts to the rising edge of the clock. This includes the instruction register and the CPU flags which trigger address changes. If you were to change the address on the falling edge of the clock the 'blips' on the EEPROM output would not matter.

I first thought about using the inverted clock for the instruction register and the CPU flags but decided against it. I was not sure if this would have side effects. Given I had some room below the instruction register I decided to add two more 74HCT173 D-type flip flops to latch the instruction register and the CPU flags on the falling edge of each clock. These latched values are used as the address lines for the EEPROM's. This solved all the problems of random actions occurring.

Lastly there was the problem of the RAM not always writing. I was aware of issues with the RC circuit Ben has in his original design on the clock for the RAM input. I already put in a diode to prevent back feeding any voltage as the capacitor discharges but I was still suspicious. Given writing ram works with a push button in programming mode, which does not have an RC circuit on it, I figured it might work without. After removing the RC circuit and just passing in the clock everything worked.

I now have an 8-bit breadboard CPU which supports addition, subtraction, push, pop, subroutines, ...

Some random bits:

I can program the CPU using the dip switches but that got old really quickly. I wrote a little Arduino application that could program the CPU. I just hook up the ground, the address lines, the data lines and write signal to the breadboard from an Arduino Nano Every. This saves a lot of time and does not discourage me from making changes and retesting.

On the internet there are many posts that say you have to add a lot of bulk capacitors to the breadboards in order to make it stable. My CPU does not seem to need it. It could be the quality of the breadboards, the fact that I used 74HCT chips or the quality of the power supply. When running my Fibonacci program it draws a maximum of 350 mA.

I used an alternative to the EEPROM programmer designed by Ben. Given I used an Arduino Nano Every, which has more digital pins, I did not have to combine the write signal into the shift registers. I did have to rewire it because my EEPROM's did not seems to have the content I expected.

Picture

Parts

458
QtyValueFootprintReferences
130220RResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1, R100, R101, R102, R103, R104, R105, R107, R108, R109, R110, R111, R112, R113, R114, R116 +114
66100n01_my_library:C_Disc_D4.0mm_W2.6mm_P2.50mmC1, C2, C10, C11, C14, C15, C16, C18, C19, C20, C21, C22, C23, C24, C25, C26 +50
52RED01_my_library:LED_D5.0mmD1, D13, D14, D15, D16, D17, D18, D19, D107, D108, D109, D110, D111, D112, D113, D114 +36
3110kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR10, R11, R12, R13, R14, R15, R16, R20, R24, R25, R59, R60, R61, R62, R106, R115 +15
28YELLOW01_my_library:LED_D5.0mmD10, D12, D45, D46, D47, D48, D49, D50, D115, D116, D117, D118, D119, D120, D121, D122 +12
25BLUE01_my_library:LED_D5.0mmD11, D81, D82, D83, D84, D85, D86, D87, D88, D89, D90, D100, D101, D102, D103, D104 +9
17GREEN01_my_library:LED_D5.0mmD54, D56, D57, D58, D59, D60, D61, D62, D63, D75, D76, D77, D78, D79, D105, D106 +1
1510n01_my_library:C_Disc_D4.0mm_W2.6mm_P2.50mmC6, C8, C12, C13, C17, C28, C38, C45, C46, C50, C51, C54, C69, C75, C79
1374HCT173Package_DIP:DIP-16_W7.62mmU8, U9, U11, U12, U20, U21, U36, U38, U39, U40, U42, U43, U57
774HCT157Package_DIP:DIP-16_W7.62mmU22, U23, U24, U25, U27, U28, U54
774HCT245Package_DIP:DIP-20_W7.62mmU7, U10, U15, U18, U29, U60, U63
7MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4, H5, H6, H7
474HCT00Package_DIP:DIP-14_W7.62mmU26, U41, U58, U59
474HCT04Package_DIP:DIP-14_W7.62mmU2, U46, U48, U50
474HCT193Package_DIP:DIP-16_W7.62mmU61, U62, U64, U65
4AT28C64BPackage_DIP:DIP-28_W15.24mm_SocketU37, U47, U49, U51
4LMC555xNPackage_DIP:DIP-8_W7.62mmU4, U5, U6, U34
31kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR18, R19, R96
374HCT08Package_DIP:DIP-14_W7.62mmU1, U53, U55
374HCT161Package_DIP:DIP-16_W7.62mmU30, U31, U45
3ButtonButton_Switch_THT:SW_PUSH_6mmSW1, SW6, SW7
274HCT02Package_DIP:DIP-14_W7.62mmU52, U56
274HCT283Package_DIP:DIP-16_W7.62mmU16, U17
274HCT86Package_DIP:DIP-14_W7.62mmU13, U14
2SW_DIP_x08Button_Switch_THT:SW_DIP_SPSTx08_Slide_9.78x22.5mm_W7.62mm_P2.54mmSW3, SW4
1100kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR97
11mResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR22
11m01_my_library:Potentiometer_Bourns_3362U_VerticalRV1
11uCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC5
12_Complement_HeaderConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ4
1470uCapacitor_THT:CP_Radial_D10.0mm_P5.00mmC83
17130Package_DIP:DIP-48_W15.24mmU19
174HCT107Package_DIP:DIP-14_W7.62mmU32
174HCT138Package_DIP:DIP-16_W7.62mmU44
174HCT139Package_DIP:DIP-16_W7.62mmU33
174HCT32Package_DIP:DIP-14_W7.62mmU3
1Arduino_Address_Programming_HeaderConnector_PinSocket_2.54mm:PinSocket_1x09_P2.54mm_VerticalJ1
1Arduino_Data_Programming_HeaderConnector_PinSocket_2.54mm:PinSocket_1x09_P2.54mm_VerticalJ2
1Arduino_Programming_Trigger_HeaderConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ3
1LOGOLOGOCPU_LOGO
1LTC-5723HRDisplay_7Segment:CA56-12SURKWAU35
1PowerConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ6
1Programming Switch01_my_library:Mini_Slide_Switch_CUI_THT_123SW5
1Switch01_my_library:Mini_Slide_Switch_CUI_THT_123SW2
1USB_B_MicroConnector_USB:USB_Micro-B_Amphenol_10118194_HorizontalJ5

Questions

How big is the 8-bit cpu PCB?

It measures 244.5 × 393.4 mm and has 4 copper layers, 1.6 mm thick.

What parts does the 8-bit cpu use?

458 parts, built around the 74HCT245, 74HCT173D, 74HCT157D and 74HCT00D. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the 8-bit cpu KiCad files?

From the nurk/8-bit-cpu repository on GitHub, at the commit this page was made from: the board is 8-bit-cpu.kicad_pcb and its schematic 8-bit-cpu.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the 8-bit cpu design in my own project?

Its repository states no licence, so its author keeps all rights: ask nurk before reusing the design.

Similar boards

  • 2 layers297.2 × 180.3 mm8bit computer, the printed circuit board in 3D

    8bit computer

    vascofazza/8bit-cpu

    Schematics & code for my 74LS-based 8-bit MK1 CPU

    377 parts317MIT
  • 2 layers368.3 × 215.9 mmTTL 6510 Computer fab, the printed circuit board in 3D

    TTL 6510 Computer fab

    StefansAI/TTL-6510-Computer

    Yet another CPU made from TTL chips

    330 parts1
  • 2 layers200 × 150 mmMSX ONE, the printed circuit board in 3D

    MSX ONE

    jdgabbard/MSX-ONE-Computer

    MSX 1 Computer from discrete parts

    114 parts28GPL-3.0
  • 4 layers280 × 140 mmP8x control card, the printed circuit board in 3D

    P8x control card

    ksr/p8x

    Generated by generators/genkicad.py from the canonical geneagle netlist (CARDS["peripheral-card"]), same standard as the memory card: 4-layer (F/B signals, In1=GND, In2=VCC planes), a bypass cap above each IC, a…

    58 parts
  • 2 layers235 × 158.8 mmGigatron, the printed circuit board in 3D

    Gigatron

    flypie/Gigatron

    This is a version of the files from https://gigatron.io/ altered to work on a vanilla KiCAD 5.1.6. Changes are minimal in the schematic and PCB, layout has only been changed where dimensions or orientations changed as a…

    151 parts2
  • 2 layers133.3 × 85.2 mmUart, the printed circuit board in 3D

    Uart

    nojan1/project-wrass

    The purpose of Project Wrass is to develop the Wrass 1.

    54 parts
  • 4 layers120.2 × 104.1 mmExtrom, the printed circuit board in 3D

    Extrom

    jimbro1000/DragonPalExtRom

    Dragon Pal with External Character Rom for Rev 3.1

    78 partsMIT
  • 2 layers102 × 96 mmPc sp, the printed circuit board in 3D

    Pc sp

    TomNisbet/nqsap-pcb

    NQSAP 8-bit computer PCB version

    65 parts18MIT