Programming

After we have successfully designed our 1st processor, we must of course write programs to be executed. Normally there are already compilers that translate source code from higher level languages like C, C++, Java into machine code. Unfortunately there is no compiler for our small processor yet but we can write a simple assembler that translates assembly into machine code and then load this program into our main memory and execute it. The provided Python source code is a simple assembler that transforms our instructions into machine code.

Fibonacci

In the following example we will implement an algorithm that calculates the Fibonacci series. On the left side is the assembler source code which uses the presented Python code to generate the machine code. We can now load this machine code into the main memory using a testbench in a Verilog simulation and execute the program. The processor never terminates but repeats the last instruction an infinite number of times.

We are now through with the first tutorial and have successfully developed an 8-bit processor. From here on there are no more limits and we can extend, improve and add functionality to the processor. There are no limits to creativity.

Starting Page
Loading...