Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

34 Commits

Repository files navigation

CPU-Simulator

Python Badge
Python program to simulate CPU functionalities using OOP structure.

Structure

📁inputs - Modifiable input files to be read into simulation
| data_input - Contains sample data that are read into memory bus
| instruction input - Contains sample instructions that are read into CPU

cache.py - Cache class
cpu.py - CPU class that contains the bulk of the applicable programming. Utilizes intstantiations of the cache and memory bus
main.py - Instantiates CPU, reads applicable data, and runs the simulation
memory.py - Memory bus class

Instruction Key

CommandArgumentFunction
CACHE0Turn cache off
CACHE1Turn cache on
CACHE2Flush cache
JMPINTJump to specified position
ADDDestination, Source, TargetAdd target and source register values on destination register
ADDIDestination, Source, ImmediateAdd immediate value to source register on destination register
HALTHalt program

References

Code is based on Codecademy'sCPU Simulator Portfolio Project.

Thanks to Dr. Timothy Heil for his computer architecture knowledge.

About

A Python program to simulate CPU functionalities including a cache and memory bus with programmable instructions

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages