Skip to content

youssefmattar/simpleCPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction: The simple computer we designed is made out of different modules which are: • Processor registers • Control unit (hardwired) • Bus multiplexer • RAM • EEPROM

Every part of the computer is synchronized with the same clock. Furthermore, the control unit fetches the binary code and the executes the necessary control signal for the specified operation code.

The most important part in this computer in my opinion is the control unit it contains the sequence timer connected to a decoder. Each operation to execute needs to do some microoperation like moving data from a register to another register. Each microoperation takes one clock cycle. In this computer an operation can take up to 16 clock cycles to execute.

How it works: When the sequencer timer is at T0 the computer first loads PC to AR the at T1 the computer loads word at AR and stores it in IR and increments PC then at T2 the computer stores IR(0-11) to AR and check bit I then at T3 the operation execution begins this was the instruction cycle.

However we made an interrupt cycle also at T0 AR will be loaded with the subroutine address then at T1 TR will be loaded from PC then at T2 M[AR] will be loaded with TR then at T3 PC will be loaded with the address of the interrupt subroutine then at T4 increment PC.

The instruction set:

Screenshot 2025-11-10 190253

I = 0 for direct address and I = 1 for indirect address.

Processor registers: -AR (12bit): address register.

-PC (12bit): program counter.

-DR (16bit): data register.

-AC (16bit): accumulator.

-IR (16bit): instruction register.

-TR (16bit): Temporary register used to handle interrupts.

-OUTR(8bit): output data register.

-INPR(8bit): input data register (can work with interrupt)

RAM address starts at (0800)16
EEPROM address starts at (0000)16

So we can write a bootloader to copy data from EEPROM to RAM very easily using just LDA and STA with in a loop and the use BUN to change the PC register to the new address.

Picture of the computer:

main2

A simple program I wrote to test interrupts, EEPROM and RAM addressing

Screenshot 2025-11-10 190704

Conclusion:

In summary, designing a simple processor involves a careful balance between efficiency, functionality, and scalability. By focusing on fundamental components such as the control unit, arithmetic logic unit, and memory integration, we can create a processor capable of executing basic instructions effectively. Through thoughtful architecture design and optimization techniques, we enhance processing performance while ensuring ease of implementation. This foundational approach not only provides insight into computer architecture but also serves as a stepping stone for more advanced processor designs in the future.

Reference:

Mano, M. M. (1993). Computer system architecture (3rd ed.). Prentice Hall.

About

computer architecture project (designing a simple cpu)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published