8 ms·
Building a Modern Computer from First Principles
- akent 13y agoThe lecture slides are in Comic Sans, ugh.
- emacsitor 13y agoGive it a chance. The value of the content highly outweighs the presentation. I promise you that.
- spacemanaki 13y agoI used to feel like this, until I saw Simon Peyton Jones use Comic Sans for a slide deck on Haskell and decided this was a such a petty, knee-jerk reaction to something as superficial as font-choice. At this point, I'd almost choose Comic Sans on purpose for my own presentations, just to weed out and troll the people who aren't paying attention to what matters. http://research.microsoft.com/en-us/um/people/simonpj/papers/haskell-retrospective/HaskellRetrospective.pdf http://research.microsoft.com/en-us/um/people/simonpj/papers... edited to add: Dug up an actual comment from SPJ on this, I hadn't realized he uses Comic Sans for all his talks: http://www.reddit.com/r/haskell/comments/1bd1ia/spj_and_comic_sans/ http://www.reddit.com/r/haskell/comments/1bd1ia/spj_and_comi...
- snogglethorpe 13y agoI've never understood the enormous enthusiasm people seem to to have for badmouthing Comic Sans. It's not particularly elegant, but it's quite readable and not particularly ugly. It more or less looks like hand-lettered dialogue in comics, and that seems quite accepted, and even respected. I suppose type designers or whoever might be particularly sensitive to whatever transgressions it commits (I dunno), but almost everybody I've seen indulge in a bit of C.S.-bashing seems to otherwise not care very much about typography at all. As far as I can figure, it's just because people love a bandwagon, especially one that's really easy to hop onto and entails few risks....
- unimpressive 13y agoMaybe I have too much faith in other people, but my personal weighting of social proof is far higher than most aesthetic details in a document.
- doctorstupid 13y agoThis is Hacker News, not Hipster News.
- auctiontheory 13y agoAmong the widely available fonts, Comic Sans is apparently the easiest for dyslexics to read.
- anoncow 13y agohttp://www.idc.ac.il/tecs http://www.idc.ac.il/tecs is down? Edit: But slides are available on http://www.nand2tetris.org/course.php http://www.nand2tetris.org/course.php A video lecture based course would have been great, but this is splendid too!
- tptacek 13y agoI've been sick in bed for the last couple days and yesterday read the first half of this book (_Elements_). It is I think the best, tightest description of how one gets from primitive gates to Adders to an ALU to memory. Extremely well written.
- eterps 13y agoWonderful book. For additional opinions also see: http://www.mail-archive.com/fonc@vpri.org/msg01614.html http://www.mail-archive.com/fonc@vpri.org/msg01614.html
- glurgh 13y agoSome of the (somewhat critical) opinions in that thread are Alan Kay's - worth a read.
- pajju 13y agoYou start with a simple Nand Gate, then build the hardware, ALU, RAM, assembler, compiler, OS and finally build the Tetris Game. Remember all this runs on your own self-designed computer — hardware + software, all your work! Awesome once in a lifetime experience project. Here's how it goes — You are just given a Nand Gate, you then construct other gates and complex logic from that Nand Gate. Then you build computer's basic processing and storage devices (ALU and RAM, respectively). Then next Stage you build an assembler and compiler for your own defined language. ;) Finally a High level language(jack) is implemented to run on your machine architecture. Then you build an OS for your machine. Jack OS. And In the last step you build your first application, Tetris Game. ;) Remember it is running on your own self-built computer. ;) This is one of the most well-thought self-learning Projects out there to build a computer from first principles. Kudos for the creators. Pure Bliss. My experience — You get the feel and appreciate the project as you move up and also later in your life. Its a life-long experience. If you are a college student, having a mentor helps a lot in understanding and appreciating concepts faster. Worth mentioning, this is one of the best gifts you can give for a curious soul who has just stepped into computers. I rate this project very high, and the best self-learning project of all time.
- emacsitor 13y agoSeriously, this book should be in all computer engineering curriculums. Hands down, there's nothing like it.
- emacsitor 13y agoThis book is amazing, simply for the fact that it really allows you to understand the major layers of a computer system in a way that can fit in your mind all at once. This is not an easy task, with each layer having the capability of being a highly specialized area of study. You can spend your life working in operating systems without ever really understanding what a compiler does, or work in compilers without ever actually understanding the digital logic that underlies computer architecture. For students and hobbyists alike, the task of understanding what a computer fundamentally does can seem like a truly uphill battle. Approaching this battle from the top down can seem never ending. The number and complexity of layers between application code and executable binaries is daunting to the newcomer to say the least. Approaching it from the bottom up is still difficult, but it allows you to see the need for each abstraction layer as the shortcomings of a lower layer present themselves. This book takes this bottom up approach to literally take you from digital logic to high level software, literally from nand to tetris. And while each layer in between is highly simplified, it allows you to understand a system as a whole rather than concentrating on the specific layers. Really, a great read. And the projects are priceless. If you make it through this book, you will understand how computers _fundamentally_ work.
- bachback 13y agoYes, good approach. It would be very cool to build this from real hardware instead of an VM, now that we have Arduinos and RPI's.
- alanctgardner2 13y agoIf 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-ND/555975 http://www.digikey.com/product-detail/en/SN7400N/296-14641-5... And a giant honking breadboard.
- austinz 13y agoIt 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 something of this scope to be built.
- alanctgardner2 13y agoI 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.
- Siecje 13y agoSo I just buy the book and use software from the site? That's all that you need?
- eterps 13y agoYes
- alanctgardner2 13y agoI 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. Likewise, 'computer architecture' makes up three classes in my curriculum: one all about building RISC processors, another about CISC, then a third about modern architectures. Only in the last one do you approach an understanding of a contemporary CPU architecture. My question for people who have done the course is: does it cover even simple design theory like K-maps? Does it make you account for propagation delay? Does it explain caching schemes and TLBs? I feel like it probably has to gloss over a lot of the 'hard stuff' to remain so dense. Likewise, it sounds like it's all done in custom languages. Half of my first year was spent struggling with industry standard, terrible software like Altera which is super powerful but terribly designed. The other half was spent actually breadboarding circuits and having them fail because of problems you never see in simulations (or which they solve for you). I'm not saying it's not an interesting project, but it really is a nice, abstract diversion for people who work on software all day. People calling for it to be included in comp. eng. programs probably don't realize the depth of what actually gets covered in comp eng. Edit: to sound a bit less whiny, if anyone is doing this course and they want to dig deeper into a particular area, I'd be happy to point them to the books/course materials we used.
- nhamann 13y agoThe 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.
- alanctgardner2 13y agoI pointed this out above, but this is really a course for CS people that glosses over a lot of computer engineering topics that you need to, say, design your own processor. It's definitely a tremendous accomplishment, but let's keep our pants on here.
- angersock 13y agoSuch as? Does it skip over K-maps or something?
- alanctgardner2 13y agoIf you control-f, there's squabbling at length below about the fact that they don't cover k-maps, k-maps aren't important, etc. Or you're being sarcastic. I'd hate to assume that, but someone did go through and downvote all of my posts.
- angersock 13y agoI was looking for more of a list of topics it omits that are absolutely required to implement a functioning processor. A sufficiently simple little register-based RISC CPU with memory-mapped IO, no interrupts, no caches or TLBs, and so on is a functioning (if gimped) computer.
- alanctgardner2 13y agoSorry about that, you can see I'm kind of getting clobbered below. I don't think the problem is that the end result isn't a computer (it certainly sounds like it is), but that the computer only runs in the provided simulator, and is written in a custom HDL designed to make this project relatively simple. The simulator itself ignores a bunch of complexities around timing that a commercial one (like ModelSim) would consider. Personally I haven't done this class, but I'd be curious to know whether the students design the control unit and data path themselves. I know that was a giant pain in the ass when I did it for a gimped RISC processor (as you described).
- helloTree 13y agoIt'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 finding a book that covers this topic in detail. E.g. the famous patterson-hennessy book about MIPS covers the implementation of a RISC processor in great detail but does not go into detail about IO stuff which is in my opinion the really hard part.
- baddox 13y agoI 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).
- kens 13y agoHistorically, writing to the screen was done by writing either ASCII or pixel values to a special region in memory (e.g. Apple II, IBM PC). I'm not sure what you're suggesting the book should do instead? Use a serial port and terminal? Implement a GPU? (I'm not being sarcastic, just looking for clarification.)
- helloTree 13y agoMy point is that after reading the book I kind of knew how I could implement a simple CPU in real HW (with ALU, memory, etc.) but it was not clear to me how the IO part (kbd, screen) would work. Is the kbd connected directly to a certain place of memory? How is this implemented? Would there be some screen/gpu HW that is directly connected to the memory region? How is the CPU clock involved? E.g. if you press a key, hold it and then release it, it is possible that this event gets missed as it was too short and the key press method did not check the memory region at the right point of time. For me their implementation enforces this bogus "I am in total control of everything that happens feeling" which often leads to bad design as it ignores the messy real world. I would have appreciated something more sophisticated and generic there which would work for different kinds of HW. Maybe I am missing some simple bus-system one might say ... Nevertheless it is a wonderful book and I had lots of fun with it! :)
- akiselev 13y agoAn 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 http://ajp.aapt.org/resource/1/ajpias/v73/i10/p980_s1
- aswanson 13y agoThis is awesome. Been thinking of doing the same with an electron gun (hijacked from an old crt) and vacuum chamber.
- akiselev 13y agoSee 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).
- kriro 13y agoI own it, I love it. It's great and should be read and worked through by everyone who is interested in computers.
- soferio 13y agoIf you don't need to go as deep or as far, you might want to consider 'Code' by Charles Petzold: http://www.charlespetzold.com/code/ http://www.charlespetzold.com/code/ I found it great read and it covers some of the ground of this course.
- angersock 13y agoI second this recommendation. Code is a really great tour through the creation of a digital computer, and helps build a fertile ground for later questioning and research into the field.
- MWil 13y agoTotal Cost?
- pizza 13y ago$0, the hardware/each chip is implemented in software. The book is about $30, but most chapters are free on the website.
- MartinMcGirk 13y agoQuestion to those that already have this book - is the book full of diagrams? I ask because I could get this on kindle instantly (but diagrams suffer) or in paperback in a week or so. Is it worth getting the physical book over the e-book for this?
- cranefly 13y agoSeveral of the chapters are available as pdfs from the site
- MartinMcGirk 13y agoThanks, I see that now. Paperback version it is.
- jared314 13y agoI actually started writing my own hardware test runner[0] to more imitate a spec/unit test runner, and because I really wanted just a folder, a NAND gate, and a DFF. I found the built-in components confusing, because I would not implement parts, and yet the tests would still pass. Also, the source (thousands of lines of decent Java) is available at the bottom of the download page[1]. [0] https://github.com/Jared314/n2trunner https://github.com/Jared314/n2trunner [1] http://www.nand2tetris.org/software.php http://www.nand2tetris.org/software.php
- abecedarius 13y agoRe the complaints about how idealized the hardware chapters are: http://www.amazon.com/Computation-Structures-Electrical-Engineering-Computer/dp/0262231395 http://www.amazon.com/Computation-Structures-Electrical-Engi... also covers the full stack from transistors to operating systems, but with much more depth on the lower levels. It's pretty old, though.
- femto 13y agoAnother book in the same space is "Understanding Digital Computers, by Forrest Mims, originally sold by Radio Shack. It's dated, written in 1978, but the basics are still relevant, taking the reader from the definition of a bit, though binary numbers, Boolean logic and eventually to a complete microcomputer and its programming. I read this book as a teenager and I remember it giving me my first "aha!" moment of understanding how computers really work. In my experience, the prerequisites for understanding the book are pretty low, but the knowledge within is sophisticated.
- bane 13y agoI don't really have the time or inclination to do all the hardware stuff with real hardware, can anybody suggest software I might use to virtually build the hardware and get the general gist?
- leoedin 13y agoRead the link again! The computer is implemented in an HDL and simulated. All the software needed is supplied.
- pjv 13y agoMIT offers a similar undergraduate class called 6.004 which most undergraduates take. The course materials are available on OCW: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-004-computation-structures-spring-2009/index.htm http://ocw.mit.edu/courses/electrical-engineering-and-comput...
- visarga 13y agoWell, that's what I call good education. Start from the scratch. Understand how it's made. Then your intuition will have something to grab on when you do more complex stuff. It doesn't feel like voodoo any more.
- stiff 13y agoThere is a somewhat similar book by nobody else but Niklaus Wirth: http://www.amazon.com/Digital-Circuit-Computer-Science-Students/dp/354058577X/ref=cm_cr_dp_asin_lnk http://www.amazon.com/Digital-Circuit-Computer-Science-Stude...