4 Bit CPU
Table of Contents
💡 Tutorial #
Click the bits in the Interactive Nibble below, observe how Hex and Dec change.
1. Interactive Nibble #
2. Machine Code #
Programs for this CPU are written in machine code. Each machine code instruction is 1 byte (8 bits). The first 4 bits are the opcode, and the last 4 bits are the operand.
Only some instructions use the operand bits.
Instruction | Description | Opcode | Operand |
---|---|---|---|
STOP | Halts the CPU. | 0 | 0000 |
STA $0 | Halts the CPU. | 0 | 0000 |
Below is an interactive byte. Click the bits to change the opcode and operand.
Opcode | Operand | Hex | Assembly |
---|---|---|---|
Below is the full CPU simulator.
{{ value }}
{{ label }}
00