Do you want to create a computer? All by yourself?

Do you want to do it step-by-step, starting with a single bit and ending with a design that can run real programs, written in C?

Do you also want to see how the design can be done using different languages, such as VHDL and Verilog?

Then this might be a book for you. The book will show you, in a step-by-step manner, how a simple computer can be created. While doing so, it will also provide an introduction to how computers work, and how their main parts can be constructed, and put together into a functioning design.

We start with a simple building block that can store one bit, and we end with a computer that can run software that is compiled and linked using gcc.

Read more

Storing one bit

A bit can have the values 0 or 1. In a computer, these values are represented by a low and a high value of an electrical signal.

Read more

Storing data in registers

When a computer executes instructions, it often needs intermidiate storage places. Reading instructions from memory, writing results back to memory. For example adding numbers, and writing back only when all numbers have been added. Then registers can be used, to hold the intermediate sum, while the calculation is ongoing. We can refer to such a row using the term register. Another use of registers is for addressing. In this scenario, the value stored in the register is an address, addressing a part of the memory. One such register is holding an address pointing to the next instruction to be executed. This register is referred to as the program counter.

Read more

Our first instruction

A computer executes programs by following instructions. The instructions belong to an an instruction set. As mentioned in Chapter Welcome, we will use a subset of the OR1K instruction set as the instruction set for our computer.

Read more