Do you ever wanted to know how a simple CPU is actually implemented?

(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the essential knowledge you need to know about performance tuning on SQL Server.)

Today’s blog posting is a little bit off-topic, but still quite interested when you work in the IT area. Maybe a few of you already know it, but over the last few years I have worked (and I’m still working) on a quite interesting side project: I’m developing my own CPU based on primitive AND, OR, XOR, and NOT gates. I was already fascinated by computer science and how you can build just by using 0 and 1 a whole computer system. But in the past I was never, ever able to understand how everything below the operating system is really working. I just knew that a CPU is capable to execute assembly instruction, but how that execution is done on the physical level was already a mystery for me.

Therefore I have decided a few years ago (don’t ask me why…) to build my own CPU to get a better understanding about the inner workings of a CPU, and what a CPU has to do to execute assembly instructions and computer programs. As I have said, my goal was to implement a CPU just based on simple primitive gates – namely AND, OR, XOR, and NOT gates. I don’t wanted to use any more complex gates, because they are already hiding some kind of functionality, and therefore they are already acting like a blackbox. The ultimate goal is to reinvent the *whole* computer science stack from bottom up: CPU, Assembler, C Compiler, Operating System, …

In my case I have decided to physically implement my CPU with the use of TTL 74LS chips, which are DIP chips which were quite common in 1970… Quite a long time ago, but still amazing and awesome to see what you can achieve by putting a few hundred of these chips together. Yes you read correct: Currently I’m using around 250+ TTL 74LS chips in my CPU project, and I’m still not finished. Look at the following picture:

A mess of wires...

It’s just a mess of wires – with a concept behind it – trust me! Building that whole thing took me now around 3 years (including a *very long* planning and design phase), so it’s a very time consuming, hard, challenging work with *a lot* of soldering involved. And a lot of troubleshooting and bug fixing. At least the root cause of *every* problem you encounter is YOU, YOU, YOU, because there is nothing else there – no bottom layers which could introduce some bugs.

And in addition – and that’s now the important point for you – I have also simulated the whole CPU in software. I have built a whole VHDL description of the CPU (which can be simulated within a VHDL simulator), and in addition I have also written an Emulator software in C#, which is able to execute my own assembly programs – written in my own designed and developed assembly language. How cool is that?

And now the nice thing: I have released over the last weekend the whole project stuff (VHDL description files, the custom written Assembler, and even the whole Emulator, and even the Debugger!) under the MIT License on Github. You can also follow my project journey on my project website at http://www.cpu-design.at, where I also sometimes blog about the CPU project itself, and other computer science related topics.

So if you want to get your hands dirty on real CPU development work, download the code from the Github repository, and play around with it. And trust me: you will learn *a lot* about computer science, and this knowledge can even help you some time in combination with SQL Server – even our famous database that we use in your day-to-day life is just based on 0 and 1!

If you are a conference organizer in the IT industry, and you are interested in a talk about such cool topics like CPU development, or how to design your own Assembly Language, please feel free to contact me.

Enjoy, and thanks for your time!

-Klaus

It`s your turn

Your email address will not be published. Required fields are marked *

SQLpassion

Copyright © 2017 by SQLpassion e.U. · Imprint · Offerings · Academy · Contact · Go to Top