This project is a multi-cycle processor designed with an accumulator and 6 registers. It was developed as part of a course project for Computer Architecture. The processor follows a multi-cycle design approach, where each instruction is executed over several clock cycles. The processor includes key components such as an accumulator and a set of six general-purpose registers, making it suitable for various basic computational tasks.
To test all the functions, we programmed the Sieve of Eratosthenes to find the prime numbers up to 32.
- Accumulator-based architecture: The processor uses an accumulator to hold intermediate data and results.
- 6 General-purpose Registers: The design includes 6 registers to hold temporary data during computations.
- Multi-cycle Execution: Each instruction is processed over multiple clock cycles for better control and efficiency.
- Simple Instruction Set: The microprocessor supports a set of basic instructions for arithmetic, logic, and control operations.
- Clock-controlled design: The microprocessor operates under a clock-driven control unit that dictates the cycle-by-cycle execution.
- Instruction Set: A basic set of instructions like ADD, SUB, MOV, etc., that can be executed. They are all listed in the "instructions.xlsx" file.
To get started with the project, follow these steps:
-
Please make sure to have Make (or follow the commands in the Makefile), GHDL, and GTKWAVE installed.
-
Clone this repository to your local machine:
git clone https://github.com/RicardoAffonso0607/Processor.git
-
Navigate into the project directory:
cd Processor
/Processor
├── UC.vhd # VHDL code for the control unit
├── ULA.vhd # VHDL code for the ALU
├── reg_bank.vhd # Registers bank
├── PC.vhd # Special register to iterate over the instructions inside ROM
├── ROM.vhd # Contain the instruction set (It's the program memory)
├── ram.vhd # It's the data memory
├── maquina_estados.vhd # The state machine to control the multi-cycle processing
├── processor.vhd # Top-level processor module
└── processor_tb.vhd # Testbench for the processor
- The processor executes instructions in a multi-cycle manner. Each instruction involves several stages:
- Fetch: The instruction is fetched from ROM.
- Decode: The instruction is decoded to determine the operation and operands.
- Execute: The operation is performed.
- Compile the VHDL files:
make
- Run the testbench for simulation:
make run
- If it goes wrong, run this in the console and try again:
unset GTK_PATH - When the program oppens, select the Three Bars -> Time -> Zoom -> Zoom Full to see the processor executing the Sieve of Eratosthenes.
- Don't forget to add the outputs! You can see the operations, the state, the components working and in saida_reg_r0, the prime numbers.
- Assembly.txt -> Contains the code inside the ROM in Assembly format
- instructions.xlsx -> It's a guide to all the instructions programmed
- This project was developed as part of the Computer Architecture course.
- Special thanks to the course instructor and peers for feedback and support.