Let's Understand How a CPU Works

Designing a CPU from the ground up, with no knowledge needed

View the Project on GitHub milen-patel/cpu_tutorial

How Do Computers Really Work?

“Wisdom is not a product of schooling but of the lifelong attempt to acquire it.”

For how many of our waking hours we spend each day staring into a screen, it’s remarkable how few people understand whats happening on the other side of the glass. It may sound like an overtly complex engineering feat, but it turns out computers, if explained clearly, aren’t all that confusing.

In this series, we will start by designing a basic CPU from scratch called the SAP-1 which was designed by Albert Paul Malvino in 1976. This simple yet powerful processor is designed to be easy to understand while also providing some impressive capabilities. You can even build this CPU after reading this series, which I did in 2020 when first introduced to the model.

Whether you are a computer science major or a curious learner without engineering experience, this guide is intended to be read by any audience and makes no prior assumption of any knowledge beyond basic math concepts you (hopefully) learned in middle school.

Table of Contents

Future Chapters


Logic Gate Diagram

View entire source