ROM

Inputs

PinTypeDescription
Addrbus8Address to read from (0–255)

Outputs

PinTypeDescription
Databus8Byte at address Addr

How It Works

ROM is a burned-in program, the computer's firmware. Inside are 256 cells, and each holds exactly one byte. Address the memory — and you get the contents of that cell: like a hotel where the room number instantly tells you who is inside.

The key property: while the circuit runs, ROM is read-only. Its contents are written once — through the Assembler panel: compile the program, and the bytes settle into the cells. The address on the Addr input usually comes from the ProgramCounter, so the reading goes instruction by instruction. Every byte packs a pair: the high 4 bits are the opcode, the low 4 bits the operand. For example, the byte 00010101 means "opcode 1, operand 5".

A nuance: empty cells hold zeros, and the ROM circuit is combinational — the address arrives, the byte is on the output at once, no clock involved. The firmware survives until the next compilation: restart the simulation without re-flashing and the program stays in place, unlike the data in RAM.

Examples

AddrData (bin)High bits — opcodeLow bits — operand
00001010100010101
10010001000100010
20001000000010000
25500000000—— (empty cell)

A program sitting in the first three cells: each row is one instruction, already turned into a byte by the assembler. The program counter reads them in order: 0, 1, 2…

Usage

ROM is the processor's instruction memory in the Harvard architecture: instructions live separately from data (level 16 and all levels 18–29). The chain is simple: the ProgramCounter points to an address, ROM outputs the instruction byte, a Splitter divides it into opcode and operand, and the Decoder turns the opcode into control signals.

The concrete path of a program: you write it in human-readable assembly, the compiler translates the mnemonics into bytes and burns them into ROM, and from then on the processor executes them automatically. Splitting "instructions in ROM, data in RAM" gives Harvard its main bonus — the processor fetches the next instruction and accesses data simultaneously, over two independent buses.

Build it yourself →

Related components

Related articles

Frequently Asked Questions

Can the program in ROM be changed?

Only through the ROM editor before running: while the circuit runs, ROM is read-only.

Why keep instructions separate from data?

That is the idea of the Harvard architecture: the processor fetches an instruction from ROM and accesses data in RAM at the same time, over two separate buses. As a bonus, the program physically cannot overwrite itself by an accidental write.

How much program fits into ROM?

256 bytes — one byte per instruction. That is plenty for educational programs: display output, a snake game, gamepad handling.