Skip to main content
  1. Favorites/

4 Bit CPU

·1 min· 0 · 0 · ·
system 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.

InstructionDescriptionOpcodeOperand
STOPHalts the CPU.
0
0000
STA $0Halts the CPU.
0
0000

Below is an interactive byte. Click the bits to change the opcode and operand.

OpcodeOperandHexAssembly

Below is the full CPU simulator.