Having briefly touched on field programmable gate arrays (FPGAs) in one of my elective courses in third year, I wanted to further build my knowledge of how they work and become more fluent in Verilog. I purchased a Tang Nano 9K, a beginner FPGA board that contains 8640 logic units, as well as HDMI, SPI and RGB display output compatibility. My end goal is to have some form of game console hardware emulator running on it. However, as a starting point I needed something simple to solidify my understanding of computer architecture, and to help properly understand Verilog. This led me to the Chip-8, a hardware interpreter/emulator built to run as a virtual machine on 8-bit microcomputers from the mid-70s. The main development items that would need to be built for it to run on an FPGA include:
So far I have implemented Verilog modules for memory, the program counter, the stack pointer, and the delay and sound timers along with 26 of the 35 opcodes required by the system architecture. From here I need to finish developing the remaining opcodes, write/implement an HDMI driver that interfaces with the original Chip-8 display logic, and then handle the input control logic. Once implemented, the FPGA should be able to run programs such as Breakout, Tic-Tac-Toe, and Pong, all written for the Chip-8 virtual machine.
In the past I have learnt the basic overview of computer architecture however, using a hardware description language to create a CPU from scratch is an entirely different ball game. One of the primary learnings so far has been understanding how the different sections of a CPU (ALU, registers, etc.) all interface and work together. Alongside this, I have gained an understanding of what a computer instruction set actually means in terms of opcodes.