Simple Microprocessor Simulation

A very basic CPU: control unit, ALU, 4 registers · 2 operations (ADD, SUB)

ISA legend

6-bit instruction, no unused bits
54opcode
32Rd
10Rs

Register codes

R0 = 00 · R1 = 01 · R2 = 10 · R3 = 11

How it works

The control unit reads the opcode and turns on one operation line. The ALU uses the matching unit and the answer is shown on the monitor. Registers keep their values; change them in the Registers panel.

Flags

Made from the ALU result with gates: SF sign = bit 7 · ZF zero = NOR of all 8 bits · PF parity = NOT(XOR of all 8 bits), 1 when the count of 1s is even

Colour key

1 / active   0   opcode Rd Rs

Chip pins

data in   data out   control (register select, write)   operation lines. Gaps split pin groups; hover a chip for details.