This repository contains the complete source code and documentation for a Custom 16-bit Central Processing Unit (CPU). This project serves as the Final Term Project for the Computer Architecture course at the University of Information Technology, VNU-HCM.
The design is built from the ground up, featuring a fully custom Instruction Set Architecture (ISA) inspired by the classic MIPS architecture. The project encompasses the entire design hierarchy, ranging from fundamental logic modules to the top-level CPU integration.
- Architecture: 16-bit Data Path and Address Space.
- ISA Design: Custom-defined instruction set optimized for educational demonstration and efficiency.
- Modularity: Hierarchical design including ALU, Register File, Control Unit, Program Counter, and Memory interfaces.
- Completeness: Includes all source codes (
src) and testbenches (tests) for verification.
Our custom ISA is designed with simplicity and orthogonality in mind, drawing heavy inspiration from MIPS but adapted for a 16-bit environment. The instruction set is categorized into three primary formats:
Used for arithmetic and logical operations involving three registers.
- Structure:
[Opcode] [Rd] [Rs] [Rt] - Usage: Operations where the result of
RsandRtis stored inRd. - Examples:
ADD,SUB,AND,OR,XOR.
Used for operations involving two registers and a constant (immediate) value.
- Structure:
[Opcode] [Rt] [Rs] [Immediate] - Usage: Arithmetic or logic operations with a constant, or load/store operations with offsets.
- Examples:
ADDI(Add Immediate),LW(Load Word),SW(Store Word).
Used for operations requiring a larger immediate value or specific control flow instructions.
- Structure:
[Opcode] [Rd] [Immediate] - Usage: Loading upper immediate values, conditional branches, or jumps.
- Examples:
LUI(Load Upper Immediate),BEQ(Branch if Equal),JMP(Jump).
custom-16bit-cpu/
├── src/ # Source code for all modules (ALU, Control Unit, Datapath, etc.)
├── tests/ # Testbenches and simulation files
├── AUTHORS.md # List of project contributors and supervisor
├── LICENSE # MIT License
└── README.md # Project documentation
To simulate or synthesize this project:
- Clone the repository.
- Open the project in your preferred HDL simulator (e.g., ModelSim, Vivado, Quartus).
- Add all files from the
src/directory. - Run the testbenches located in
tests/to verify functionality.
This project was developed by a dedicated group of students from the University of Information Technology (UIT - VNU-HCM) under the supervision of MSc. Ta Tri Duc.
For a full list of contributors, please refer to the AUTHORS.md file.
This project is licensed under the MIT License - see the LICENSE file for details.