News for hackers. Stuff that matters.
Re:Nand to Tetris 1 by barking on Saturday May 23, 2015 @02:04PM (#9593731)
A great book and accompanying software imo lacks just 2 things.

1:the building of the Nand gate itself and 2: the building of a flip flop.

Both these tasks can be easily accomplished with reference to the book 'Code' by Charles Petzold (http://www.amazon.com/Code-Language-Computer-Hardware-Softwa...)

and software such as this http://logic.ly/

Re:Nand to Tetris 1 by sepeth on Saturday May 23, 2015 @03:41PM (#9594077)
I haven't read 'Code' yet, but I think starting from NAND gates is right; it has to stop at some level. I feel CMOS, MOSFETs, semiconductor physics.. are all interesting topics, but this book is already too broad.
Re:Nand to Tetris 1 by arundelo on Saturday May 23, 2015 @09:49PM (#9595056)
Code actually starts with relays.
Re:Nand to Tetris 1 by userbinator on Saturday May 23, 2015 @10:42PM (#9595142)
Code is a great book. What I think is the most powerful and interesting point is that a computer can be built from (a sufficiently large number of) any component that can perform logic functions.

I stopped reading Nand2Tetris in any great amount of detail and just skimmed the rest after I saw that it confused Harvard (separate code and data) and Von Neumann (combined) architectures.

Re:Nand to Tetris 1 by late2part on Saturday May 23, 2015 @12:10PM (#9593339)
I often imagine how smart folks would rebuild the technology of the earth from scratch. It's cool you're doing this and looking at fundamentals!
Re:Nand to Tetris 1 by agumonkey on Saturday May 23, 2015 @06:56PM (#9594689)
I often imagine how we could make average folks rediscover it :)
Re:Nand to Tetris 1 by thaumasiotes on Saturday May 23, 2015 @10:08PM (#9595082)
Rediscover it? Average folks never discovered it in the first place.
Re:Nand to Tetris 1 by agumonkey on Sunday May 24, 2015 @03:04AM (#9595554)
Good semantic point, but you get my message. I really wish we would find ways to enlighten people of any level and not rely on 'genius' and talent.
Re:Nand to Tetris 1 by thaumasiotes on Sunday May 24, 2015 @05:40AM (#9595781)
In that world, what would it mean to have talent?
Re:Nand to Tetris 1 by agumonkey on Sunday May 24, 2015 @06:17AM (#9595844)
Something not very important anymore. Do we want to stay blindly in love with those who can do things we cannot or should we try to make people able to learn how to learn ? it's a bit antisocial and un-binding but also the opposite.
Re:Nand to Tetris 1 by thaumasiotes on Sunday May 24, 2015 @07:02AM (#9595897)
I didn't mean "what would be the social significance of having talent". I meant "how would you know if one person was more talented than another person?"

Do you think what you want is achievable while humans vary in their abilities?

Re:Nand to Tetris 1 by agumonkey on Sunday May 24, 2015 @07:19AM (#9595926)
I understood, and socially insignificant words don't really have a place (aren't most words crafted from social interactions?). And thus I would know nor care to know as long as people are given ways to reach new level of understandings.

I believe something can be done, otherwise I wouldn't bother talking about it. This is only from personal experience, I experienced both feeling of being very talented as a kid, and the complete lack of it, all of a sudden, when going to college. Since then a lot of things that seemed impossible to understand started to click. It feels like experiencing both extremes of the ability spectrum. And in the end talent/innate-ability, or its absence, doesn't really matter. It's mostly desire and patience to unfold your own misconceptions.

And I strongly believe that the school system and society supports that notion that you either get something in a short timespan or you'll never because it's the way society can function; individual well being / growth jailed for this purpose.

Re:Nand to Tetris 1 by thaumasiotes on Monday May 25, 2015 @06:32AM (#9599420)
What is the social significance of positive vs negative electric charge?
Re:Nand to Tetris 1 by agumonkey on Monday May 25, 2015 @09:29AM (#9599952)
I was speaking in an hypothetical future where talent wouldn't be a discriminating concept. In that future, objective concepts like electricity would still matter, and have a very concrete effect on people and society. Compared to nowadays where people are seeking "talents" for instant profit.
Re:Nand to Tetris 1 by smoyer on Saturday May 23, 2015 @12:14PM (#9593356)
I love the boolean identity and proof that was hinted at by item #1 - namely that any truth table can be built from NAND gates. This is a case where several boolean identities build to form the equivalence. And it's these rules that let you assert #2 from the OP.

A NAND gate is defined as:

a x b = 0

So if both a and b are 1, the output will be zero. You need an inverter to form any other logic functions, but you also know that:

a x b = 0 when a = 1 and b = a

In other words, wire both inputs to one signal to get an inverter. Next we need an or gate, so we can use the identity:

!(a x b) = !a + !b

So to build the other necessary gates from a NAND gate, we simply combine these rules:

AND - invert the output of a NAND. NOT - wire both inputs to the same signal. OR - invert both inputs of the NAND gate NOR - invert both the inputs and output of the NAND gate.

One tip for the aspiring logic designer (and those who would rather calculate a result than create giant if-then-else structures in their code - learn Gray's Code and Karnaugh Maps. You can easily minimize almost any truth table into a sum-of-products form.

Re:Nand to Tetris 1 by shawndumas on Saturday May 23, 2015 @01:51PM (#9593672)

     const logicGates = {
        nand(a, b) {
          return !(a && b);
        },
        not(a) {
          return this.nand(a, a);
        },
        and(a, b) {
          return this.not(this.nand(a, b));
        },
        or(a, b) {
          return this.nand(this.not(a), this.not(b));
        },
        nor(a, b) {
          return this.not(this.or(a, b));
        },
        xor(a, b) {
          return this.and(this.nand(a, b), this.or(a, b));
        },
        xnor(a, b) {
          return this.not(this.xor(a, b));
        }
    };

    Object.keys(logicGates)
      .map(gate => {
        return [
          { gate, a: false, b: false },
          { gate, a: false, b: true },
          { gate, a: true, b: false },
          { gate, a: true, b: true },
        ];
      })
      .forEach(x => {
        x.map(y => {
          const desc = JSON.stringify(y).replace(/(gate)|:|"|\{|\}|,/g, ' ') + '=>';
          console.log(desc, (({ gate, a, b }) => logicGates[gate](a, b))(y));
        });
      });
http://blog.shawndumas.com/post/119694815258/logic-gates-es6...
Re:Nand to Tetris 1 by abecedarius on Saturday May 23, 2015 @02:58PM (#9593936)
The NAND To Tetris book requests people not post spoilers for their problem sets. (I violated this myself in putting my code on github, but with a big spoiler warning at the top, at least. I put it up there because my Python HDL might be useful to some others who didn't want to use their language.)

It's nice to start seeing ES6 code in the wild, though.

Re:Nand to Tetris 1 by ColinWright on Saturday May 23, 2015 @11:33AM (#9593194)
It appears that some people don't know about the book/course:

    From NAND
      to Tetris
So here's the link: https://news.ycombinator.com/item?id=9593189
Re:Nand to Tetris 1 by zokier on Saturday May 23, 2015 @11:57AM (#9593282)
Re:Nand to Tetris 1 by ColinWright on Saturday May 23, 2015 @12:05PM (#9593316)
There are many previous discussions, and let it still seems that people don't know of this. I'll get some cross-references shortly, but here are two searches that show some of the discussions:

https://hn.algolia.com/?query=nand2tetris&sort=byDate&prefix...

https://hn.algolia.com/?query=nand%20tetris&sort=byDate&pref...

Edit: Here are previous submissions - none have any significant discussion:

https://news.ycombinator.com/item?id=6963338

    From NAND to Tetris: The Elements of Computing Systems [repost]
    (nand2tetris.org)
https://news.ycombinator.com/item?id=7109860

    Building a Modern Computer from First Principles
    (nand2tetris.org)
https://news.ycombinator.com/item?id=8203302

    Building a Modern Computer from First Principles
    (nand2tetris.org)
https://news.ycombinator.com/item?id=9062220

    Class in building a computer from "first principles"
    (coursera.org)
https://news.ycombinator.com/item?id=9255258

    Coursera: From nand to tetris
    (coursera.org)
https://news.ycombinator.com/item?id=9256157

    From Nand to Tetris [Coursera online course starts next month]
    (coursera.org)
https://news.ycombinator.com/item?id=9288093

    From Nand to Tetris / Part I
    (coursera.org)
https://news.ycombinator.com/item?id=9362022

    From Nand to Tetris - Part 1
    (coursera.org)
https://news.ycombinator.com/item?id=9590845

    Nand to Tetris 1, with Dan Luu
    (oskarth.com)
https://news.ycombinator.com/item?id=9593114 (in progress ...)

    Nand to Tetris 1
    (oskarth.com)
Re:Nand to Tetris 1 by tantalor on Saturday May 23, 2015 @11:26AM (#9593168)
What does this have to do with Tetris?
Re:Nand to Tetris 1 by ColinWright on Saturday May 23, 2015 @11:34AM (#9593200)
Quoting:

    In the last few weeks I’ve been working my way
    through the excellent book Elements of Computing
    Systems - building a modern computer from first
    principles as part of the equally excellent Nand
    to Tetris MOOC.
       ^^^^^^
I guess you're not aware of the "From NAND to Tetris" book and series.
Re:Nand to Tetris 1 by galaktor on Saturday May 23, 2015 @11:32AM (#9593190)
There is a course [1] where you learn from basic circuits design through writing a programming language until you use that language to write tetris. It is called nand2tetris. I can only assume the author will describe that course or its contents.

A friend of mine took the course, said it was great.

[1 ]http://www.nand2tetris.org

Re:Nand to Tetris 1 by geetee on Saturday May 23, 2015 @11:29AM (#9593183)
It's referring to this book: http://www.nand2tetris.org