Skip to content

Blog

CPU part 7 - Branch unit

Without branches and jumps, a program can only run from top to bottom once. They are what makes loops, if statements and function calls possible. In this post I go through how the CPU handles them, with the branch unit as the last new module before the pipeline can run its first programs.

Read more →

2026-10-24

CPU part 6 - Hazard unit

Forwarding solves most data hazards without having to wait, but not all of them. Sometimes the pipeline really has to wait (stall), and sometimes it has to throw away instructions it already started on (flush). The hazard unit is the module that decides this for the whole pipeline, and it turned out to be one of the smallest modules of the CPU.

Read more →

2026-10-24

CPU part 5 - Forwarding unit

The next component of the CPU is the forwarding unit. It makes sure that an instruction always works with the newest value of a register, even when that value has not been written into the register file yet.

Read more →

2026-10-24

CPU part 4 - Register file

The register file, or sometimes called register bank or regbank, is the first component of the CPU that actually remembers something, so it is also the first one where the clock matters.

Read more →

2026-10-19

CPU part 3 - Instruction decoder

The next component of the CPU to discuss is the instruction decoder. Where the ALU does the actual work, the decoder is the part that figures out what work needs to be done. It takes the 32-bit instruction word that was just fetched from memory, and turns it into the signals that tell the rest of the pipeline what to do with it.

Read more →

2026-10-19

CPU part 2 - ALU

Now the general design of the CPU is clear, it is time to write the first Verilog module: the ALU. It is the simplest component of the CPU to write, and it shows how in the end all complex tasks we do with computers come down to simple arithmetic operations (and moving data around, but that is not the responsibility of the ALU).

Read more →

2026-10-19

CPU part 1 - General design

The core of any computer is its CPU, and the same goes for the FPGC. It is the component I build everything around, so its design is very important in terms of both functionality and performance. This is the first post in a series about how I designed and built the CPU for the FPGC project, which is called B32P4, short for Bart’s 32-bit Pipelined processor version 4.

Read more →

2026-10-19

Introduction

Hi, as I am redesigning the FPGC project again, I want to take this opportunity to start creating a little blog series where I document the journey, challenges and thoughts building the FPGC. In this series I will go chronologically through the entire design, from CPU design and simulations all the way to high level software.

Read more →

2026-10-17