Skip to the content
PCBKitNew board
2 layers250 × 225 mm8BitComputer, the printed circuit board in 3D

This is a simple programmable 8-bit computer that is built from scratch.

Size
250 × 225 mm
Copper layers
2
Thickness
1.6 mm
Parts
333
Nets
363
Pads
1,293
Tracks, vias
4,929, 358
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
18 May 2024
Updated
18 May 2024

Overview

8BitComputer is an open-source printed circuit board by MatanBright, from the MatanBright/8BitComputer repository on GitHub. It is a 2-layer board of 250 × 225 mm with 333 parts on 363 nets, routed with 4,929 tracks and 358 vias.

It is built around the 74LS245SC, 74LS273PC and NE555P, with the 74LS157PC, 74LS161DC and 74LS04PC among its other parts. Its parts include 153 resistors, 106 diodes, 39 ICs, 13 switches and 11 capacitors. It belongs with the retro computing and games boards of this library.

Main components

11

README

README.md

8-Bit Computer

8-Bit Computer

Introduction

This is a simple programmable 8-bit computer that is built from scratch.

It's inspired by Ben Eater's 8-bit computer project: https://eater.net/8bit.

How Does It Work?

The main component of the computer is the clock. It's the "heart" of the computer. The clock outputs a periodic signal to all the components in the computer at once. Every time this signal goes high, the various components in the computer commit an operation synchronously.

The "backbone" of the computer is the main bus. It is used to transfer data between the various components.

The next important component in the computer is the control unit. It controls the various components of the computer. It does that using control signals which are outputted through control lines that are spread across the computer and are connected to the various components. If for example, we want to transfer data between two registers, the control unit will have to output two signals before the clock signal goes high, one for enabling the output of the first register, and the other for enabling the input of the second register. When the clock signal goes high, the transfer operation will be committed. A simple operation like this is called a micro-instruction and it is defined in a micro-code (a pattern of control signals which are needed for performing a micro-instruction). An instruction consists of multiple micro-codes. When an instruction is executed, The control unit must perform the micro-codes of that instruction one after the other in order to complete the instruction. In order for the control unit to know which instruction to execute, the instruction needs to be loaded into the instruction register. The instruction register stores the code and parameter of the current instruction that is being executed. Please note that there are 2 general micro-codes that are executed before starting every instruction. They are responsible for loading the instruction from RAM to the instruction register, so the control unit will be able to execute the specific micro-codes for that instruction afterward.

In order for the computer to execute instructions, we will need to program it by writing the instructions to the RAM (Random Access Memory). In this computer we write to the RAM using physical switches on the board, that select the address in the RAM to write to, and the data to write). After the program is loaded to the RAM and we start the clock, the computer begins executing the instructions. In addition to the program's code, the RAM can also store data for use by the program, and it can also store variables that are saved in run-time by the program. The RAM address at which the current read/write operation is performed is stored in the memory address register.

To control the flow of the program and keep track of the current RAM address from which an instruction will be executed, there is the program counter. It's a counter (a special register that has an option to increment its value by one) that stores the RAM address at which the current instruction is located. Normally, when executing an instruction, the program counter is incremented so that the next instruction will be executed afterward, but if we change its value manually we can change the flow of the program.

The computer has 2 general-purpose registers, called A and B. These registers allow the saving of a single temporary 8-bit value, each one, that will be used by some operations.

In order for the computer to be able to perform arithmetic operations (like adding 2 numbers) it has an ALU (Arithmetic Logic Unit). This unit performs arithmetic operations by taking the values from registers A and B, and calculating them (using logic gates). This computer's ALU can only perform addition and subtraction. If we need to calculate the sum of two numbers, we will need to store the first number in register A, store the second number in register B, and output the data from the ALU. By doing that we will get the sum of these two numbers. There is also a control signal which causes the ALU to perform subtraction instead, so if we want to subtract the number stored in register B from the number stored in register A, the control unit must output the subtraction signal to the ALU before we read from the ALU.

The output of the computer is a 7-segment display. The displayed digits are changed according to the content of the output register. The display is controlled by a display-control unit which acts very similar to the control unit of the computer. There are signals which are outputted through control lines that each one is connected to a LED in a segment of a digit in the display. According to the value stored in the output register, the display-control unit outputs the appropriate signals which are required in order to display the digits of the number stored in the register (Please note that although this display has 4 different digits, the display-control unit only has outputs for a single 7-segment digit. So for displaying multi digits numbers, we need to use a technique that involves displaying only one digit at a time but doing it so quickly that the human eye can't tell. This is done using a dedicated timer).

Components

The computer consists of the following components:

  • Clock - Provides the clock signal that drives the computer and synchronizes all the operations.

  • Data Bus - Allows data to be transferred between the various components.

  • Control Unit - Controls all the components using a decoder that translates micro-codes to control signals.

  • Instruction Register - Stores the code and parameter of the instruction that is being executed by the control unit.

  • RAM (Random Access Memory) - Stores the program's code and data, and also temporary 8-bit values.

  • Memory Address Register - Stores the current address that the RAM's read/write operations are performed at.

  • Program Counter - Stores the RAM address of the current instruction that is being executed.

  • Registers A and B - Store a temporary 8-bit value, each one, for use by some operations.

  • ALU (Arithmetic Logic Unit) - Performs addition and subtraction on values from the A and B registers.

  • Display-Control Unit - Controls the 7-segment display, using a decoder that translates numbers to display-control signals.

  • Output Register - Stores the 8-bit value that is being displayed on the 7-segment display by the display-control unit.

Control Signals

The control unit (which is found in the instruction register module) controls the behavior of the various components in the computer using signals. It sends them according to the current micro-code of the current instruction, using an instruction decoder in which all the micro-code definitions are flashed.

The available signals and their purpose are listed below:

Signal NameDescription
PCinConnects the program counter's input lines to the bus
PCout*Connects the program counter's output lines to the bus
PCincrementSets the program counter to increment its value by one on the next high clock signal
MARinConnects the memory address register's input lines to the bus
RAMinConnects the RAM's input lines to the bus
RAMout*Connects the RAM's output lines to the bus
IRinConnects the instruction register's input lines to the bus
IRout*Connects the instruction register's output lines to the bus
RAinConnects the register A's input lines to the bus
RAout*Connects the register A's output lines to the bus
RBinConnects the register B's input lines to the bus
ALUout*Connects the ALU's output lines to the bus
ALUsubtractCauses the ALU to output a subtraction result instead of an addition result
ORinConnects the output register's input lines to the bus
RCresetSets the micro-codes ring counter to reset its value to zero on the next high clock signal
CstopStops the clock of the computer

* Only one signal from these can be outputted at a time because there can be only one component that outputs its data to the bus at a time. If multiple components are outputting their data to the bus at the same time, a short-circuit may occur which may cause the computer to restart, and in the worst case, it may even damage the components.

All the components that can transfer and receive data are connected to a shared 8-bit data bus (the main data bus of the computer). The control unit controls at any point in time which one component is writing to the bus, which components are reading from the bus, and which components are internally disconnected from the bus. For example, if the control unit applies voltage on the "RAout" and "RBin" signals (while not applying voltage on the rest of the signals), it will cause register A to connect its output lines to the bus, register B to connect its input lines to the bus, and the rest of the components to be internally disconnected from the bus (and thus ignoring the data on it). When the clock signal goes high, the data from the outputting register (in this case, register A) will be transferred and stored in the inputting registers (in this case, register B only).

Instructions

An instruction consists of 8 bits, of which the first 4 bits are the instruction parameter and the last 4 bits are the instruction code.
Note: if an instruction doesn't have a parameter, the first 4 bits of the instruction are meaningless.

An instruction involves executing micro-codes, which are basic operations that the computer can do in a single clock cycle (like moving data between a register to another register), in order to complete itself.

The control unit has 2 EEPROM chips in which all the micro-codes are flashed. The control signals are outputted from the EEPROMs depending on the current instruction (which is outputted from the instruction register) and on the current micro-code number (which is outputted from the micro-codes ring counter).
Note: On the falling edge of the clock, the control unit changes the states of the control signals according to the current micro-code, and then, on the rising edge of the clock, all the operations are committed by the relevant components.

Before each instruction starts, there are 2 general micro-codes that are executed, regardless of the forthcoming instruction. Their purpose is to load the forthcoming instruction from the RAM, so the control unit will know what is the current instruction that needs to be executed. After each execution of these 2 general micro-codes, instruction-specific micro-codes are executed.

General micro-codes: 1) PCout, MARin : Transfers the content of the program counter into the memory address register. 2) RAMout, IRin, PCincrement : Transfers the content from the RAM at the address stored in the memory address register into the instruction register. At the same time, increments the program counter's stored value by one.

Bellow are the instructions that the computer can perform:

NOP ---------------------------------------- Instruction Binary Code: 0000 Description: Does nothing. Micro-codes: 3) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been incremented). LDA x ---------------------------------------- Instruction Binary Code: 0001 Description: Loads the value from RAM at address 'x' into "A" register. Micro-codes: 3) IRout, MARin : Transfers the content of the instruction register (only the 4 LSB bits, which are the instruction's parameter value) into the memory address register. 4) RAMout, RAin : Transfers the content from the RAM at the address stored in the memory address register into register A. 5) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been incremented). STA x ---------------------------------------- Instruction Binary Code: 0010 Description: Stores the value from "A" register in RAM at address 'x'. Micro-codes: 3) IRout, MARin : Transfers the content of the instruction register (only the 4 LSB bits, which are the instruction's parameter value) into the memory address register. 4) RAout, RAMin : Transfers the content from register A into the RAM at the address stored in the memory address register. 5) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been incremented). ADD x ---------------------------------------- Instruction Binary Code: 0011 Description: Adds the value from RAM at address 'x' to "A" register. Micro-codes: 3) IRout, MARin : Transfers the content of the instruction register (only the 4 LSB bits, which are the instruction's parameter value) into the memory address register. 4) RAMout, RBin : Transfers the content from the RAM at the address stored in the memory address register into register B. 5) ALUout, RAin : Transfers the value of the addition result from the ALU into register A. 6) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been incremented). SUB x ---------------------------------------- Instruction Binary Code: 0100 Description: Subtracts the value from RAM at address 'x' from "A" register. Micro-codes: 3) IRout, MARin : Transfers the content of the instruction register (only the 4 LSB bits, which are the instruction's parameter value) into the memory address register. 4) RAMout, RBin : Transfers the content from the RAM at the address stored in the memory address register into register B. 5) ALUsubtract, ALUout, RAin : Tells the ALU to perform subtraction and transfers the value of the subtraction result from the ALU into register A. 6) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been incremented). JMP x ---------------------------------------- Instruction Binary Code: 0101 Description: Jumps to address 'x' in RAM. Micro-codes: 3) IRout, PCin : Transfers the content of the instruction register (only the 4 LSB bits, which are the instruction's parameter value) into the program counter. 4) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been changed). OUT ---------------------------------------- Instruction Binary Code: 1110 Description: Shows the value from "A" register on the digits display. Micro-codes: 3) RAout, ORin : Transfers the content of register A into the output register. 4) RCreset : Resets the ring counter (it causes the 1st micro-code to be executed next, thus, ending the current instruction because the program counter's stored value has already been incremented). HLT ---------------------------------------- Instruction Binary Code: 1111 Description: Stops the computer (stops the computer's clock). Micro-codes: 3) Cstop : Stops the computer's clock (it causes the computer to freeze, thus, no further instructions will be executed. You will need to manually reset the computer to restart the clock).

Sample Programs

Addition of Two Numbers

This program causes the computer to add the numbers 2 and 3, output the result, and then stop.

Assembly:

assembly
            .code
[0x0]            LDA 0x4
[0x1]            ADD 0x5
[0x2]            OUT
[0x3]            HLT
            .data
[0x4]            0x2
[0x5]            0x3

Machine code:

text
[0x0]        00010100
[0x1]        00110101
[0x2]        11100000
[0x3]        11110000
[0x4]        00000010
[0x5]        00000011

Counting

This program causes the computer to output consecutive numbers one by one (please note that values can only be between -128 and 127 because the maximum size of the output register is 8 bits).

Assembly:

assembly
            .code
[0x0]            ADD 0x3
[0x1]            OUT
[0x2]            JMP 0x0
            .data
[0x3]            0x1

Machine code:

text
[0x0]        00110011
[0x1]        11100000
[0x2]        01010000
[0x3]        00000001

The Fibonacci Sequence

This program causes the computer to output the numbers in the Fibonacci sequence one by one (please note that values will start to be invalid after 127 because the maximum size of the output register is 8 bits so an overflow will occur).

Assembly:

assembly
            .code
[0x0]            LDA 0xC
[0x1]            STA 0xE
[0x2]            STA 0xF
[0x3]            LDA 0xD
[0x4]            OUT
[0x5]            STA 0xE
[0x6]            ADD 0xF
[0x7]            OUT
[0x8]            STA 0xF
[0x9]            ADD 0xE
[0xA]            OUT
[0xB]            JMP 0x5
            .data
[0xC]            0x0
[0xD]            0x1

Machine code:

text
[0x0]        00011100
[0x1]        00101110
[0x2]        00101111
[0x3]        00011101
[0x4]        11100000
[0x5]        00101110
[0x6]        00111111
[0x7]        11100000
[0x8]        00101111
[0x9]        00111110
[0xA]        11100000
[0xB]        01010101
[0xC]        00000000
[0xD]        00000001

Parts

333
QtyValueFootprintReferences
1081KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R100, R101, R102, R103, R104, R105, R106, R107, R108, R109, R110, R111, R112, R113, R114 +92
93LEDLED_THT:LED_D3.0mmD1, D2, D15, D16, D17, D18, D19, D20, D21, D100, D101, D102, D103, D104, D105, D106 +77
3610KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2, R10, R11, R13, R19, R21, R135, R136, R137, R138, R139, R140, R141, R142, R143, R144 +20
13DDiode_THT:D_DO-34_SOD68_P7.62mm_HorizontalD4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D30, D31
7S8050Package_TO_SOT_THT:TO-92_InlineQ1, Q2, Q3, Q4, Q5, Q6, Q7
674LS245Package_DIP:DIP-20_W7.62mmU10, U17, U19, U21, U31, U34
510nCapacitor_THT:C_Disc_D5.1mm_W3.2mm_P5.00mmC4, C6, C7, C10, C11
556KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR16, R17, R18, R54, R55
574LS273Package_DIP:DIP-20_W7.62mmU7, U18, U20, U27, U36
4NE555PPackage_DIP:DIP-8_W7.62mmU3, U4, U5, U26
374LS08Package_DIP:DIP-14_W7.62mmU2, U9, U33
374LS157Package_DIP:DIP-16_W7.62mmU8, U15, U16
374LS161Package_DIP:DIP-16_W7.62mmU28, U32, U35
3AT28C64Package_DIP:DIP-28_W15.24mmU29, U38, U39
210µCapacitor_THT:C_Radial_D4.0mm_H7.0mm_P1.50mmC1, C2
21µCapacitor_THT:C_Disc_D5.1mm_W3.2mm_P5.00mmC3, C5
25.6KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR15, R56
274LS04Package_DIP:DIP-14_W7.62mmU11, U14
274LS189Package_DIP:DIP-16_W7.62mmU12, U13
274LS283Package_DIP:DIP-16_W7.62mmU24, U25
274LS86Package_DIP:DIP-14_W7.62mmU22, U23
1100Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR12
1100KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR84
1100nCapacitor_THT:C_Disc_D5.1mm_W3.2mm_P5.00mmC9
11MPotentiometer_THT:Potentiometer_Vishay_T73YP_VerticalRV1
1500KPotentiometer_THT:Potentiometer_Vishay_T73YP_VerticalRV2
168pCapacitor_THT:C_Disc_D5.1mm_W3.2mm_P5.00mmC8
174LS138Package_DIP:DIP-16_W7.62mmU37
174LS139Package_DIP:DIP-16_W7.62mmU30
174LS279Package_DIP:DIP-16_W7.62mmU6
19VBattery:BatteryHolder_Eagle_12BH611-GRBT1
1AMS1117-5.0Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1Auto-Clock SelectButton_Switch_THT:SW_PUSH_6mm_H5mmSW6
1ClearButton_Switch_THT:SW_PUSH_6mm_H5mmSW4
1Clock EnableButton_Switch_THT:SW_DIP_SPSTx01_Slide_9.78x4.72mm_W7.62mm_P2.54mmSW2
1Manual-Clock SelectButton_Switch_THT:SW_PUSH_6mm_H5mmSW8
1OneShot-Clock SelectButton_Switch_THT:SW_PUSH_6mm_H5mmSW7
1Power EnableCustom:SW_SPDTSW1
1Programming Mode EnableButton_Switch_THT:SW_DIP_SPSTx01_Slide_9.78x4.72mm_W7.62mm_P2.54mmSW13
1RAM_ADDRESSButton_Switch_THT:SW_DIP_SPSTx04_Slide_9.78x12.34mm_W7.62mm_P2.54mmSW9
1RAM_DATAButton_Switch_THT:SW_DIP_SPSTx08_Slide_9.78x22.5mm_W7.62mm_P2.54mmSW10
1ResetButton_Switch_THT:SW_PUSH_6mm_H5mmSW12
1SetButton_Switch_THT:SW_PUSH_6mm_H5mmSW5
1TriggerButton_Switch_THT:SW_PUSH_6mm_H5mmSW3
1WriteButton_Switch_THT:SW_PUSH_6mm_H5mmSW11
1YY3641AHCustom:YY3641AHDS1

Questions

How big is the 8BitComputer PCB?

It measures 250 × 225 mm and has 2 copper layers, 1.6 mm thick.

What parts does the 8BitComputer use?

333 parts, built around the 74LS245SC, 74LS273PC, NE555P and 74LS157PC. 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 8BitComputer KiCad files?

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

Can I use the 8BitComputer design in my own project?

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

Similar boards

  • 2 layers370.8 × 298.5 mm8 Bit Computer, the printed circuit board in 3D

    8 Bit Computer

    The-Invent0r/8-bit-Computer-PCB

    These are the KiCAD files for my 8-Bit Computer.

    323 parts142
  • 2 layers155.2 × 78.6 mm80ColumnCard, the printed circuit board in 3D

    80ColumnCard

    btb/80ColumnCard

    An Apple II 80-Column Card. Based on the Videx Videoterm

    47 parts43Apache-2.0
  • 2 layersSap be, the printed circuit board in 3D

    Sap be

    kyllikki/eda-designs

    EDA designs

    148 parts32MIT
  • 6 layers414 × 187.5 mm8-Bit PC, the printed circuit board in 3D

    8-Bit PC

    dragonruler1000/8-bit_computer

    331 partsMIT
  • 4 layers246.4 × 185.4 mm8bit computer, the printed circuit board in 3D

    8bit computer

    tonygilkerson/8bit-computer

    8-bit Computer by Ben Eater

    281 parts
  • 2 layers236.8 × 169.8 mmTK2000, the printed circuit board in 3D

    TK2000

    clemarfolly/Microdigital-TK2000

    Reprodução da PCB do TK-2000 da Microdigital, clone do Micro-Professor MPF-II

    212 parts17
  • 2 layers426 × 307 mmI7000, the printed circuit board in 3D

    I7000

    felipesanches/Itautec_I7000_KICAD

    Esquemáticos do computador Itautec I-7000 G desenhados a partir de inspeção do circuito das PCBs

    115 parts
  • 2 layers218 × 125 mmEVA1, the printed circuit board in 3D

    EVA1

    roberto314/EVA-1_Reproduction

    Recreation of the very rare K-K Systems EVA-1 Display Adapter for the Epson HX-20 Computer

    126 parts