Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What would it take to build a cpu from scratch
39 points by valine on Oct 5, 2016 | hide | past | favorite | 14 comments
Lets say you had unlimited money and motivation, what would it take to build a modern cpu from scratch? Is the knowledge and techniques needed to manufacture a cpu widely available, or are there trade secrets and things you would need to reinvent? What about building something simpler like the Intel 4004, what sort of equipment would be needed?

Regarding the transistor one, great comment by Tachikoma that really gets to the key issues:

"Hydrofluoric acid... 1000 degree oven... a child can do it..."

Lol. Yeah, I encourage using 3rd-party fabs on visually-inspectable processes for the individual components for a reason. Doing it by hand at transistor level can friggin kill you. Still neat stuff to learn, though.

It's actually a combination of public knowledge and trade secrets. The public knowledge comes from what the chip-makers themselves describe in conferences, trade journals, etc. Those would get you really far in design, implementation, and verification. There are also trade secrets for optimizing both digital and analog components. They stay trade secrets for the obvious reason of slowing competition but also to reduce odds of patent suits given about everything you can think of will get patented in this field. Especially micro-architecture tricks within CPU's.

You can get much of the knowledge you need from books, CPU specs, academic papers, open-source CPU's in industry, and so on. The standard cell model is the easiest with the highest performers being full-custom designs. There are plenty of successful designs in former with good performance, though. So, that's you're best bet.

Here's a GPL one used in embedded (esp space) applications for you to start with that has good performance and extremely-high configurability:


Recent one for open ISA:


Lots of interesting things might be done with asynchronous logic that's not as explored and patented compared to synchronous techniques. The cutting-edge stuff is using it more and more. Whole chips have been done that way that were easier to fab right the first time plus with energy and performance benefits.




Define scratch.

Are you starting from beach sand, or do you have a fab and raw materials? There was an interesting video that showed what you had to do to make a pencil "from scratch".

The essay "I, Pencil" is what you're referring to. http://www.econlib.org/library/Essays/rdPncl1.html

The big surprise line is that there's no one on earth who knows how to make a pencil. (It therefore serves as testimony in favor of free enterprise and against the idea of a centrally planned economy.)

Petzold's book "Code" explains how to build a simple CPU using macroscopic parts.

You could build a CPU with a copy of the book and a big box of transistors, wires, breadboards etc.

The basics would be a very good start. Here's an educational book that helps you along in creating a computer out of NAND gates: http://www.nand2tetris.org/book.php

I'm still working through the book, but I've learned a ton.

If you did EE you had to write an entire CPU. It was implemented on an FPGA. It does not take too long. You can do it overnight or a few all nighters. It wasn't do complicated: a 2 or 3 stage pipeline, front end decoder, an PC counter, Registers etc. I don't think we did a MMU. Obviously it was trivial, but a good learning experience.

I can't speak to modern CPU design (Define modern!), but a 4004 would take more persistence than skill. When I was in school for EE, designing/building parts of a CPU like memory or adders was part of the lab and not considered a big deal. I actually had a friend who built his own CPU from logic gates when he was still in high school.

What would it take to build the 4004 at the size Intel first built it (Small)?

Assloads of cash

Buy an FPGA and have loads of fun :)

Implement your own hardware, make a compiler for your own CPU , memory controller, and so on...

VHDL/Verilog and KIT goes a long way. I would vouch for de0 nano from altera.

As part of a computer engineering degree, I made a fairly complex CPU (and also a GPU) on an FPGA. Also made a CPU out of NAND gates.

I have heard a large amount of the cost would be in testing.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact