Live data from Hacker News

Building a Modern Computer from First Principles

nand2tetris.org

21–30 of 84 posts

Re: Building a Modern Computer from First Principles

#21
post #20

Earlier quoted context omitted.

If you built it from real hardware, you'd be going to the store to buy a couple thousand NAND chips, like this: http://www.digikey.com/product-detail/en/SN7400N/296-14641-5... And a giant honking breadboard.

It might be beyond the scope of a normal hobbyist project, but writing Verilog or VHDL to drive an FPGA might bring interested people half of the way there. You mentioned Altera design software in another post; I don't know if Xilinx's is any better (I'm guessing not really), but Digilent sells FPGA boards intended for the educational market at a pretty reasonable cost. Powerful enough, I'd reckon, to allow for somet…

I actually considered something like this; there are good dev boards for $150 that can drive a VGA monitor and use USB peripherals. The manufacturer provides stock blocks for you to integrate, so you can inspect them but you don't have to build them from scratch (which is super hard).

Doing it on an FPGA, without extensive handholding and in real-world languages, would be about a year of work in my estimate. This is assuming you build your own CPU (in procedural VHDL, not at a gate level) to implement an existing instruction set, and use the manufacturer's provided memory blocks, video blocks, etc. For reference, an experienced FPGA programmer would take about 2-4 months full-time to emulate something like an NES.

It would be a really good experience, and it's the kind of thing a comp. eng. degree prepares you for (we do a capstone project at my school which is like this). As a bonus, you'll also cover analog electronics (which are infuriating) and as much comp sci. and math as you're willing to take on.

Re: Building a Modern Computer from First Principles

#23
An excellent book, one that I can't recommend highly enough.

A friend at Caltech took this a step further and came up with his own crude SoC that took input from basic switches, did calculations based on code taken from a small off the shelf EEPROM, and displayed the output to segment LEDs. Took him like three years but he was eventually able to make a chip with a 20 micron process using a microscope and a UV DMD development board [1]. He did have access to wire bonders, IC debugging equipment, professors, etc though.

[1] http://ajp.aapt.org/resource/1/ajpias/v73/i10/p980_s1

Re: Building a Modern Computer from First Principles

#24

I going to come across as defensive here, but I'm actually in a Computer Engineering program (not Computer Science). This book purports to cover as much material as 8 undergrad courses, I feel like it must skimp on depth to (for example) condense all of 'compilers' into two weeks. Compilers are a very large topic, a single undergrad course isn't even sufficient to really understand a real world project like GCC. Like…

The hardware content in this book is not sufficiently detailed for computer engineering. It's really for CS students who want to understand roughly how computers are made. (This is evident by counting pages in the book: the first 5 chapters are the hardware chapters and they span only 100 pages. The remaining 200 pages cover the software stack from assembly up.)

For example, one of the assignments is to design a 16-bit adder in their toy HDL, but they never cover carry lookahead adders. The only thing that matters is that your circuit passes the tests, so ripple carry is considered okay.

Similar efficiency/performance issues are glossed over throughout. Propagation delay is never covered, and the sequential circuits use idealized clocks (instant transition between low and high). They also don't describe how to build up flip flops from latches: the D-Flip Flop is given as a primitive and you build up other elements from there.

K-maps are not covered either. Caches are ignored as well.

Still, the book is amazing for its intended purpose. If you don't already know this stuff, this is an easy way to get a somewhat detailed (though abstract) view of how computers work without getting mired in all the concerns that accompany the engineering of actual computers.

Re: Building a Modern Computer from First Principles

#25

It's an amazing book and doing all the projects is really fun. However keep in mind that the computer you build is really simple and in my opinion maybe a little bit too simple. In particular there is no decent IO model and reading from the keyboard is simply done by busy waiting and writing to the screen is done by writing to a special region in memory. This is ok, as the book covers many topics, but I would enjoy f…

I would love to see a book or interactive course that started fairly simple like this, but also had progressively more advanced "second passes" that would go through most or all the abstraction layers of the first project, but with the goal of extending the entire system for some specific advanced feature (like a nice IO model).

Re: Building a Modern Computer from First Principles

#26

I going to come across as defensive here, but I'm actually in a Computer Engineering program (not Computer Science). This book purports to cover as much material as 8 undergrad courses, I feel like it must skimp on depth to (for example) condense all of 'compilers' into two weeks. Compilers are a very large topic, a single undergrad course isn't even sufficient to really understand a real world project like GCC. Like…

I think the advantage this has is you have one continuous path from NAND gate to Tetris. Whereas in my experience attempting CS at Cal Poly, we did all these steps but they were disconnected. The output of one course was not used as input to the next.

I don't know if there is any pedagogical benefit from being able to say "I built this whole thing from scratch". But it sure is cool.

Re: Building a Modern Computer from First Principles

#27

An excellent book, one that I can't recommend highly enough. A friend at Caltech took this a step further and came up with his own crude SoC that took input from basic switches, did calculations based on code taken from a small off the shelf EEPROM, and displayed the output to segment LEDs. Took him like three years but he was eventually able to make a chip with a 20 micron process using a microscope and a UV DMD dev…

This is awesome. Been thinking of doing the same with an electron gun (hijacked from an old crt) and vacuum chamber.

Re: Building a Modern Computer from First Principles

#29

I going to come across as defensive here, but I'm actually in a Computer Engineering program (not Computer Science). This book purports to cover as much material as 8 undergrad courses, I feel like it must skimp on depth to (for example) condense all of 'compilers' into two weeks. Compilers are a very large topic, a single undergrad course isn't even sufficient to really understand a real world project like GCC. Like…

I think the advantage this has is you have one continuous path from NAND gate to Tetris. Whereas in my experience attempting CS at Cal Poly, we did all these steps but they were disconnected. The output of one course was not used as input to the next. I don't know if there is any pedagogical benefit from being able to say "I built this whole thing from scratch". But it sure is cool.

It's really hard to go from NAND to Tetris, because there's a logical jump when you get to VLSI. This is the whole notion of quantity being a qualitative property: when you get enough gates together, you really start abstracting them and thinking about higher-order components. There's no smooth zoom out, there's just a sudden discontinuity when you stop using individual gates and start using MUXes, flip-flops, etc as your primitives instead. I suspect there's another layer, but I'm not there yet ;)

I think I may have benefited from going to a smaller school, in this respect: I've had the same professor for every core 'Computer Architecture' class I've taken across 3 years (apparently there's one other guy, but they teach the same content). The courses are numbered, and they pick up exactly where the last one left off. I think the problem with trying to fit this stuff into a CS program is that it's so broad and deep, and it's not your primary focus. For me all of those classes were tightly scheduled requirements, so I took them at the right time, back to back.

It's definitely cool, and I encourage anyone who works primarily in software to check it out and get a better understanding of hardware design in an abstract way.

Re: Building a Modern Computer from First Principles

#30

An excellent book, one that I can't recommend highly enough. A friend at Caltech took this a step further and came up with his own crude SoC that took input from basic switches, did calculations based on code taken from a small off the shelf EEPROM, and displayed the output to segment LEDs. Took him like three years but he was eventually able to make a chip with a 20 micron process using a microscope and a UV DMD dev…

This is awesome. Been thinking of doing the same with an electron gun (hijacked from an old crt) and vacuum chamber.

See if you can get a plasma window for that vacuum chamber, which will allow you to do e-beam etching down to about 100nm with the wafer outside of the chamber. Combine it with a DIY 80/20 class 100 cleanroom (if you can make it small enough to be able to manipulate it with isolated gloves then it will be relatively cheap), some precise X-Y linear stages (you can probably get away with +-10nm precision at 100nm), supersonic bath with etching fluid, and a high quality blender for applying the resist and VOILA you have a simple little fab. You can probably adopt some stuff from an SEM to scan the electron beam across the resist but you're probably better off trying to come up with a way of etching through a die long term (much more difficult and slow).
Post reply on HN