Hacker News new | ask | show | jobs
by 3pt14159 3142 days ago
Someone whose name I no longer remember was a teacher of mine in highschool. Even though I knew how to program and had a nights / summers / weekends job programming I treated the CPU / motherboard as "magic". As if there was this dividing wall between the pure mathematical construct of a software program and the physicality of the bits moving through the motherboard.

The teacher taught us how to use NPN and PNP transistors to create very simple calculators.

Though I never went into hardware, that small demonstration was enough for me to see through the illusion and made it clear to me that the world was generally understandable if you just put in the time.

Even scary magical things like CPUs.

3 comments

I'm going to have to chime in for the book/course Nand2Tetris - Building a Modern Computer from First Principles (http://nand2tetris.org/) which has been posted back and forth here on HN for quite a few years and is of course where I discovered it as well.

It was really eye opening to me (being a web programmer) to see how you can actually build a real computer with a C-like programming language and compiler just by starting out with simple logic gates. I mean, the damn thing eventually ends up running Tetris! All by essentially combining logic gates for computation and flip-flops for memory. How amazing is that, really?

I used to think the same way about the CPU, even after getting a masters in Computer Science! About a year ago I read the book Code by Charles Petzold and watched some lectures about Computer Science by Robert Sedgewick which really opened up my mind.
I am partway through Code (can't seem to get through some of the heavy combinatorial math just by reading...it's somewhat of a slog), but it oddly enough made me think of coding as even more magical.

We harness mana (electricity) to run it through circuits (runes), and craft spells (code) that generate effects (magic).

Just reading the start of it is humbling because it makes you realize that people had to come up with these principles in the first place, and figure out the initial abstraction layers that let everything else click into place.

Are those lectures in the public domain? If so, could you pls link to them? Thx.
In the case of the Computer Science course from Sedgwick, I have only been able to find it on Safari Books and InformIT (30$) http://www.informit.com/title/9780134493831

If you happen to be a member of ACM, you actually get free access to Safari Books through http://learning.acm.org

I had a very similar experience when I took a processor design class in college. At first in the class we started learning the binary codes for each instruction, which bits were the registers, instruction bits etc. It seemed so pointless at the time. When we finally got to the end and it clicked that those bits were physically turning on and off gates, it blew my mind.
In my class, circa 2001, we were taught about an adder, then used cheap chips in a breadboard with wires and bulbs to show it, then used Logicworks to create a simple version in software. Rinse and repeat for other components, and the final project was to copy and paste those components into a larger logicworks project and hook them up together into a simple 4 bit CPU with a few dozen bytes of RAM. It could understand four instructions if I recall correctly, so very simple programs could run from that RAM.

I don't really remember how to do any of it anymore (but I have no doubt I could research it without much trouble) but it certainly was a good way to demystify a CPU, given you had fully simulated one at the gate level by the end.

My world was opened up when in my college Computer Architecture class I learned the relationship between microcode and an instruction set. It gave me confidence. The final in that class had a question on it where I had to apply the general principles I learned to draw a new conclusion--the first time I'd ever taken a test where the test itself actually taught me something I hadn't fully internalized or learned before. What a feeling--it was like magic.