Live data from Hacker News

From Nand to Tetris: Building a Modern Computer from First Principles

nand2tetris.org

31–40 of 49 posts

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#31
post #10

I made a small game inspired by the first lessons in the course: http://nandgame.com/

Just played through it and really liked it! I think this is just the right level of abstraction for a beginning CS student. Makes it easy to grasp the compositional nature of computers without having to deal with all the details that make circuit design hard, like the non-instantaneous response of real components.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#32
post #21
post #11

Earlier quoted context omitted.

Thanks, that page is nice, but it too emphasizes that you also need a clock. That's essential and it was the point I was trying to make. For example, a thing that is usually glossed over in OS courses (in favor of, let's say, scheduling algorithms and such) is that you simply can't make preemptive multitasking out of pure code - and later when you ask yourself how is it that such a phenomenon is possible in the first…

Couldn't you in theory build a clock purely from nand gates? You create a cycle of nand gates where the output of one is tied to both inputs of the next. If the cycle have an uneven number of nand gates, each nand will oscillate with a period depending on the length of the cycle.

https://en.wikipedia.org/wiki/Ring_oscillator

You can use NAND to make NOT.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#33
post #8

The title of the course is misleading, as it suggests that NAND gates are the only required primitive, whereas the course later introduces DFF gates, without which you cannot escape the parallelism of chips.

And one thing that is said even less is why NAND? You can do it all with NOR gates as well if you want. The reason for NAND has to do with the switching speed, pMOS switches quicker in parallel (either transistor can get the current flowing) and nMOS switches quicker in series (either transistor can stop the current flowing); this is how a NAND gate is wired. NOR gates on the other hand have the worst of both. The fa…

You can do it all with NOR gates as well if you want.

The Apollo computer, which used bipolar instead of CMOS, indeed did use all NOR gates:

http://klabs.org/history/ech/agc_schematics/

http://mikestewart.hcoop.net/2015/09/21/interpreting-the-sch...

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#35
post #8

The title of the course is misleading, as it suggests that NAND gates are the only required primitive, whereas the course later introduces DFF gates, without which you cannot escape the parallelism of chips.

And one thing that is said even less is why NAND? You can do it all with NOR gates as well if you want. The reason for NAND has to do with the switching speed, pMOS switches quicker in parallel (either transistor can get the current flowing) and nMOS switches quicker in series (either transistor can stop the current flowing); this is how a NAND gate is wired. NOR gates on the other hand have the worst of both. The fa…

Don’t NAND take up less room too? It took a CMOS course several years ago, and laid out a 16x16 shift register. The NAND was simple, orthogonal strips of gate metal and channel. The NOR required a parallel structure with more area.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#36
post #21

Earlier quoted context omitted.

Couldn't you in theory build a clock purely from nand gates? You create a cycle of nand gates where the output of one is tied to both inputs of the next. If the cycle have an uneven number of nand gates, each nand will oscillate with a period depending on the length of the cycle.

https://en.wikipedia.org/wiki/Ring_oscillator You can use NAND to make NOT.

That's quite unexpected. Thanks.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#38
post #24

Earlier quoted context omitted.

And one thing that is said even less is why NAND? You can do it all with NOR gates as well if you want. The reason for NAND has to do with the switching speed, pMOS switches quicker in parallel (either transistor can get the current flowing) and nMOS switches quicker in series (either transistor can stop the current flowing); this is how a NAND gate is wired. NOR gates on the other hand have the worst of both. The fa…

During my intro to computer engineering course, lectures touched on why NAND gates, and the conclusion was that you can build anything you need in a basic computer using NAND gates. It boils down to expense. A BOM (bill of materials) with fewer line items tends to be cheaper. This doesn't really hold in today's world of silicon prints, but at the start I think it was price that drove the decision.

Actually if you take an XOR gate with a naive translation into NAND gates you would use 20 transistors, but if you don't need a large fan out from the output you can actually do it with 6 transistors using a pass gate layout (which is neither NAND nor NOR). So typically you don't use NAND vs NOR because of transistor count.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#39

If you would like to start at a slightly lower level, Charles Petzold has written a great book on the subject: https://www.amazon.com/Code-Language-Computer-Hardware-Softw...

Thank you. Going to see if I can get it from my local library.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#40

If you would like to start at a slightly lower level, Charles Petzold has written a great book on the subject: https://www.amazon.com/Code-Language-Computer-Hardware-Softw...

Using everyday objects and familiar language systems such as Braille and Morse code, author Charles Petzold weaves an illuminating narrative for anyone who’s ever wondered about the secret inner life of computers and other smart machines.

... cleverly illustrated and eminently comprehensible story ... No matter what your level of technical savvy, CODE will charm you—and perhaps even awaken the technophile within.

Code doesn’t sound “slightly lower level”.

Post reply on HN