Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 1.51 KB

README.md

File metadata and controls

16 lines (15 loc) · 1.51 KB

8-bit CPU emulator

The context

The final project for the 'Management and Analysis of Physics Dataset (MOD. A)' course in the 'Physics of Data' master program, University of Padua.
Group 7: Paolo Lapo Cerni , Emanuele Quaglio , Lorenzo Vigorelli

The project

A Python object-oriented high-level emulator for a simple 8-bit CPU, inspired by the project of Ben Eater .
The code is organized into three different files:

  • utils.py : the definition of the classes of the components (registers, clock, ...) and some helper functions
  • CPU.py : the main class with all the logic functions to handle every microinstruction flexibly and scalably. Inside the class, there are also the functions load() (the RAM) to read an ASSEMBLY code from a .txt file, and run() . By default, the state of the CPU after every micro-instruction will be saved into a log file.
  • main.py : to load the RAM and start the emulator.

At the moment, our instruction set is composed of LDA, ADD, SUB, STA, LDI, JMP, JC, JZ, OUT, HLT. Thus, this CPU is slightly more complicated than a SAP 1.
As a reference, here are the high-level schematics of the Ben Eater CPU:

schematics