
Ask HN: What would it take to build a cpu from scratch - valine
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?
======
sharemywin
Here's a video on making your own transistor.
[http://hackaday.com/2010/05/13/transistor-fabrication-so-
sim...](http://hackaday.com/2010/05/13/transistor-fabrication-so-simple-a-
child-can-do-it/)

Here's an link on having a custom chip made:
[http://electronics.stackexchange.com/questions/7042/how-
much...](http://electronics.stackexchange.com/questions/7042/how-much-does-it-
cost-to-have-a-custom-asic-made)

getting chip done cheap:
[http://www.planetanalog.com/author.asp?section_id=526&doc_id...](http://www.planetanalog.com/author.asp?section_id=526&doc_id=559519)

computer built with transisters: [https://hackaday.io/project/665-4-bit-
computer-built-from-di...](https://hackaday.io/project/665-4-bit-computer-
built-from-discrete-transistors)

IC built from scratch: [http://hackaday.com/2010/03/10/jeri-makes-integrated-
circuit...](http://hackaday.com/2010/03/10/jeri-makes-integrated-circuits/)

or with unlimited money buy one of these:
[https://en.wikipedia.org/wiki/List_of_integrated_circuit_man...](https://en.wikipedia.org/wiki/List_of_integrated_circuit_manufacturers)

~~~
nickpsecurity
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.

------
nickpsecurity
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:

[http://www.gaisler.com/index.php/products/processors/leon3](http://www.gaisler.com/index.php/products/processors/leon3)

Recent one for open ISA:

[https://github.com/ucb-bar/rocket](https://github.com/ucb-bar/rocket)

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.

[http://vcl.ece.ucdavis.edu/asap/](http://vcl.ece.ucdavis.edu/asap/)

[http://www.achronix.com/technology/picopipe.html](http://www.achronix.com/technology/picopipe.html)

[https://en.wikipedia.org/wiki/AMULET_microprocessor](https://en.wikipedia.org/wiki/AMULET_microprocessor)

------
jimmywanger
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".

~~~
joeclark77
The essay "I, Pencil" is what you're referring to.
[http://www.econlib.org/library/Essays/rdPncl1.html](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.)

------
EliRivers
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.

------
schwede
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](http://www.nand2tetris.org/book.php)

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

------
samfisher83
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.

------
HeyLaughingBoy
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.

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

~~~
HeyLaughingBoy
Assloads of cash

------
aprdm
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.

------
psyklic
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.

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

