Technical · On hold

16-Bit Computer

August 2022 - On Hold

A 16-bit computer from the architecture up: 16 registers, an FPGA ALU, a stack pointer, an interrupt controller, and 64 KB of address space.

Status: currently on hold. Future continuation is uncertain.

From 8-bit to 16-bit

The project started after I built Ben Eater’s 8-bit breadboard kit in sophomore year of high school. The 8-bit computer was limited in what I could program into it; a 16-bit design increases program size from 16 bytes to 64 kilobytes, and includes a stack pointer, increment and decrement registers, and a ROM chip so it can have an operating system. I first programmed the computer in C++ to get a feel for how it should work, then designed it physically.

Block diagram of the 16-bit computer
16-bit computer design

Architecture

The machine is designed around 16 registers (4 shift, 4 inc/dec, 6 normal, and 2 ALU output). Every two registers can be paired to hold and manipulate 32-bit numbers. Clock speed will be limited by the through-hole chips in use, so each cycle needs to do more work. The ALU will support addition, subtraction, multiplication, division, AND, OR, and XOR, for both integer and floating-point numbers. Because that many functions would take too many chips to build with TTL gates, an FPGA will hold the programmed logic.

Interrupts and Memory

A stack pointer makes subroutines easier and more space-efficient. An interrupt controller lets external devices pause the program and run timing-critical code. The example I designed around is a real-time clock sending an interrupt every two seconds: the computer pauses, runs that code, then pulls the paused address off the stack. Sixteen external device ports are planned (keyboard, mouse, external storage, graphics card, sound card, and so on). Each device gets one interrupt signal; if it needs more, it will use the bus and jump commands to simulate additional interrupts.

The computer will use all 16 bits for memory addresses and data. The first 256 bytes will be ROM, followed by 256 bytes for the stack; the rest will be RAM. An external storage device using an SD card is planned, storing games, utility programs, and an operating system.

Interrupt controller design diagram
Interrupt controller design
Instruction set table for the 16-bit computer
Computer instruction set

If Work Resumes

The computer is almost fully designed. If I resume work, I’ll start PCB design using the programmable breadboard. Each component (register, program counter, ALU, and so on) will sit on its own PCB, all connected by a backplane. New parts can then be added without scrapping former components, just the backplane. Once built, the project continues with external devices and a set of programs: 2D and possibly 3D games from scratch (I’ve made games in Unity; this would be from the metal), a text editor with an assembler so the machine can be programmed without an external device, and a spreadsheet. A graphical operating system that supports a mouse and keyboard is also planned.