How nickolasnolte1/cpusimulator works
CPUsimulator models a 4-bit CPU: a machine-code program is loaded into RAM, then the control unit provides fetch, decode, and execution operations using opcode decoding, registers, and ALU operations. The README describes a clocked instruction cycle, but the sampled code does not show an orchestrator running that cycle; MAIN.py only constructs components. The graph includes the documented clock and visualization capabilities, while marking only relationships visible in the excerpts or README. Several supporting modules and instruction examples were not sampled.
Main entry points: MAIN.py CPU assembly · CU.py Control unit · RAM.py RAM · ROM.py ROM decoder
Components 13
Control flow
- CPU assembly
MAIN.py - Control unit
CU.py - Instruction clock
clock.py
CPU components
- Arithmetic logic
ALU.py - CPU registers
Registers.py - RAM
RAM.py - ROM decoder
ROM.py - Memory component
Memory.py - Circuit base
IntegratedCircuit.py
Program and display
- Machine-code program
cpufm.txt - BIOS configuration
bios.yaml - CPU state display
PrettyPrint.py
Other components
- Program author
Connections 21
- Program author → Machine-code program: writes program
README.md - CPU assembly → Control unit: constructs
MAIN.py - CPU assembly → Arithmetic logic: constructs
MAIN.py - CPU assembly → Instruction clock: constructs
MAIN.py - CPU assembly → Memory component: constructs
MAIN.py - CPU assembly → RAM: constructs
MAIN.py - CPU assembly → ROM decoder: constructs
MAIN.py - CPU assembly → CPU registers: constructs
MAIN.py - RAM → Machine-code program: reads instructions
RAM.py - RAM → ROM decoder: loads data from
RAM.py - ROM decoder → BIOS configuration: loads configuration
ROM.py - Control unit → RAM: fetches and accesses
CU.py - Control unit → ROM decoder: decodes opcodes
CU.py - Control unit → CPU registers: reads and writes
CU.py - Control unit → Arithmetic logic: requests operations
CU.py - Control unit → Circuit base: inherits from
CU.py - Arithmetic logic → Circuit base: inherits from
ALU.py - CPU registers → Circuit base: inherits from
Registers.py - Memory component → Circuit base: inherits from
Memory.py - Program author → CPU state display: requests display
PrettyPrint.py - Program author → Instruction clock: uses timed cycle
README.md