explaingit

inkboxsoftware/excelcpu

4,722PythonAudience · developerComplexity · 2/5Setup · moderate

TLDR

A working 16-bit computer processor built entirely inside Microsoft Excel using spreadsheet formulas, complete with its own assembly language, a Python assembler, and sample programs you run by pressing F9.

Mindmap

mindmap
  root((excelcpu))
    What it does
      16-bit processor
      Inside Excel cells
    Components
      Registers
      128KB memory
      Pixel display
    Programming
      Excel-ASM16 language
      Python assembler
    Use Cases
      Education
      Novelty demo
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run sample programs on the 16-bit Excel CPU to see how a processor executes instructions step by step.

USE CASE 2

Write your own program in Excel-ASM16 assembly language and compile it into the ROM spreadsheet with the Python script.

USE CASE 3

Use the project as a teaching tool to demonstrate how processors handle registers, memory, and arithmetic.

USE CASE 4

Extend the instruction set by modifying spreadsheet formulas to add new opcodes.

Tech stack

PythonExcel

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Microsoft Excel, recalculation per clock cycle is slow, wait for Excel to finish before pressing F9 again.

In plain English

This repository contains a working 16-bit computer processor built entirely inside Microsoft Excel, using spreadsheet formulas and cells to simulate how a real processor operates. It is a novelty engineering project that demonstrates what is possible using Excel's calculation system as a computing substrate. The main file is a spreadsheet called CPU.xlsx. Inside it, the processor has 16 general-purpose storage slots called registers, access to 128 kilobytes of simulated memory, and a 128 by 128 pixel display. To step through one clock cycle of the processor, you press the F9 key, which triggers Excel to recalculate the spreadsheet. The README notes that you have to wait for Excel to finish recalculating before pressing F9 again, because updating so many cells takes time. A separate ROM.xlsx spreadsheet holds the program that gets loaded into memory when you flip a switch in the main spreadsheet. To write programs for this CPU, the project includes its own assembly language called Excel-ASM16. Assembly language is a low-level way of writing instructions that map closely to what a processor actually does, things like loading a value from memory into a register, adding two registers together, comparing values, or jumping to a different point in the program based on a condition. Excel-ASM16 has 24 instructions covering arithmetic, memory access, bitwise operations, and jumps. A Python script is included to compile programs written in Excel-ASM16 into the ROM spreadsheet format. You run the script from the command line, give it your program file and the ROM spreadsheet, and it produces output you can load into the CPU. A folder of sample programs is also included to demonstrate what the CPU can do. The instruction set details and opcode reference live in a third spreadsheet called InstructionSet.xlsx.

Copy-paste prompts

Prompt 1
I want to write a simple counter program in Excel-ASM16 for the inkboxsoftware/excelcpu project. Write the assembly code that increments a register from 0 to 100 and displays the value on the pixel display.
Prompt 2
Explain how to use the Python assembler in inkboxsoftware/excelcpu to compile an Excel-ASM16 program and load it into ROM.xlsx step by step.
Prompt 3
Using inkboxsoftware/excelcpu as a reference, explain how a 16-bit processor uses registers and memory addresses to execute a program.
Prompt 4
Write an Excel-ASM16 program for excelcpu that adds two numbers stored in memory and writes the result to a third memory location.
Open on GitHub → Explain another repo

← inkboxsoftware on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.