8-bit processor



Hello everybody, I've finished first processor.
This is a simple 8-bit processor that we will build and learn in the game. It consists of 6000 wires and 1470 objects.

Processor can execute 4 instructions:

  1. ADD <n> - Addition <number from 0 to 15>
  2. SUB <n> - Subtraction <number from 0 to 15>
  3. NOP - No OPeration
  4. HLT - Stop the processor


Registers:

  • IP - instruction pointer, stores an address of current instruction in RAM;
  • IR - instruction register, stores current executable instruction;
  • ACC - accumulator register, stores results of ALU;
  • Temp - temp register, stores instruction data from IR.

Components:

  • RAM - Random Access Memory, 16 bytes;
  • Control Unit - controls the processor;
  • ALU - Arithmetic Logic Unit, performs math operations: addition and subtraction;
  • Clock - used to synchronize the circuit.

1 processor cycle = 22 gaming ticks.
Each instruction is executed in 4 processor cycles.
On average, it executes 1 instruction per second.

This processor is very simple and great for understanding basics such as:

  • General logic of the processor;
  • Instruction execution, FETCH-DECODE-EXECUTE cycle;
  • How memory works;
  • Arithmetic and Logic Unit: addition and subtraction;
  • How the processor stores numbers: positive and negative;
  • Clock signal synchronization;
  • Work with assembler.

What next:

  • Add new instructions;
  • Optimize the architecture;
  • Connect a mouse, keyboard and display;
  • Start writing simple programs;
  • Ideally we need to get close to the 6502 processor.

Now the hardest part: creating articles and levels in the game with detailed explanation of how it all works step by step.

Get Logical Path

Leave a comment

Log in with itch.io to leave a comment.