Skip to content

8-bit CPU emulator for running simple ASSEMBLY code, final project for the 'Management and Analysis of Physics Dataset (MOD. A)' course.

Notifications You must be signed in to change notification settings

LorenzoVigorelli/8-Bit-Cpu-Emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

8-bit CPU emulator for running simple ASSEMBLY code, final project for the 'Management and Analysis of Physics Dataset (MOD. A)' course.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages