My Nand to Tetris Journey

3 minutes read •



Introduction

In March 2025, I signed up for the Coursera course From Nand to Tetris: Building a Modern Computer by Shimon Schocken and Noam Nisan. I thought “Why not learn how computers work from the basics?” Spoiler:- It’s not as easy as it sounds. The course promised to turn me into a computer-building wizard, and I got pretty far completing four out of six projects.

Logic Gates from NAND

The course starts with a simple idea: using only the elementary NAND gate, you can construct all other logic gates necessary for a modern computer. This concept blew my mind, the idea that complex systems ultimately reduce to this simple building block.

I started by implementing basic logic gates in the NAND2Tetris Hardware Simulator using hdl:

 CHIP Not {
    IN in;
    OUT out;

    PARTS:
    Nand (a = in, b = in, out = out);
 }
CHIP And {
    IN a, b;
    OUT out;

    PARTS:
    Nand (a = a, b = b, out = aNandb);
    Not (in = aNandb, out = out);
}
CHIP Or {
    IN a, b;
    OUT out;

    PARTS:
    Not (in = a, out = nota);
    Not (in = b, out = notb);
    And (a = nota, b = notb, out = and);
    Not (in = and, out = out);
}
CHIP Xor {
    IN a, b;
    OUT out;

    PARTS:
    Not (in = a, out = nota);
    Not (in = b, out = notb);
    And (a = a, b = notb, out = temp1);
    And (a = nota, b = b, out = temp2);
    Or (a = temp1, b = temp2, out = out);
}

Pro Tip: Use NAND Game! to understand how theses gates are formed using NAND.

As It transforms theoretical concepts into visuals that make implementation much easier than it seems.

From Gates to Chips

Once I had a grip on basic gates, it was time to get serious and build some chips. Enter the realm of multiplexers and demultiplexers. These allow you to:

I thought the difficulty would skyrocket when I started with the 16-bit and multi-way chips, but once I built the first 16-bit chip, the rest were a breeze, just a bit of grunt work, really.

Arithmetic Components

Next came the exciting part which is creating chips that can actually compute! I implemented:

From Bits to Storage

The next phase took me into the realm of computer memory, where I designed:

This hierarchy of memory components taught me how computers are organized.

Challenges and Limitations

While I successfully completed four projects, the two modules focused on assembly language programming were… let’s just say, less successful. I realized I’m a visual learner who prefers tools like simulators. Still, the struggle was part of the fun. Sort of.

Resources That Helped Me

Conclusion

While I didn’t complete all six projects, the four I finished gave me a solid foundation in computer architecture that I’ll build upon.

If you’re curious about how computers really work from the ground up, I highly recommend this course. It’s tough, but incredibly rewarding. After all, who wouldn’t want to say, “I built a computer from scratch with just a NAND gate”?