This project emulates a simplified CPU in C++. Over 10 weeks, we’ll build essential CPU components, implement a custom instruction set, and simulate core CPU functionality. The emulator will support basic arithmetic, logic, memory operations, and control flow to understand CPU operations.
- Define project goals and CPU features.
- Set up development environment and version control.
- Select tools and libraries for C++ development.
- Design the instruction set with opcodes for
ADD
,SUB
,LOAD
,STORE
, etc. - Outline instruction formats and create a basic assembler to convert assembly code to binary.
- Implement essential components:
- ALU (Arithmetic Logic Unit) for arithmetic/logic operations.
- Registers for temporary data storage.
- Program Counter (PC) and Instruction Register (IR).
- Develop the fetch-decode-execute cycle.
- Implement functionality to fetch instructions, decode opcodes, and execute operations with the ALU.
- Set up simulated memory for storing data and instructions.
- Implement memory read/write operations and address mapping.
- Simulate basic I/O operations (keyboard, display).
- Integrate I/O handling instructions into the CPU.
- Implement branching instructions (
JUMP
,JZ
,JNZ
) and function calls. - Add support for control flow with stack-based subroutine handling.
- Profile code to identify bottlenecks.
- Optimize critical operations and enhance assembler instruction encoding.
- Conduct unit tests on each CPU component.
- Run integration tests with complete programs, debug, and validate.
- Prepare project documentation and final report.
- Create a demo session to showcase CPU operations and emulator features.
DOC LINK:https://docs.google.com/document/d/17jAEtoRiF4BH0hUGUXyOY22gvt6shxvs4sEIeUxVPFI/edit?usp=sharing