Code: The Hidden Language of Computer Hardware and Software

Author: Charles Petzold
All Stack Overflow 20
This Year Reddit 69
This Month Reddit 5

About This Book

In CODE, they show us the ingenious ways we manipulate language and invent new means of communicating with each other. And through CODE, we see how this ingenuity and our very human compulsion to communicate have driven the technological innovations of the past two centuries.

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.

It’s a cleverly illustrated and eminently comprehensible story—and along the way, you’ll discover you’ve gained a real context for understanding today’s world of PCs, digital media, and the Internet. No matter what your level of technical savvy, CODE will charm you—and perhaps even awaken the technophile within.


by HeterosexualMail   2019-01-13

We did something similar as well. The labs were tons of fun. I remember having to run a couple dozen lines of code through the CPU cache on a test once, including some sneakery of using code as data at one point. I do appreciate having done it, but I'm not sure how much practical lasting value that really contributed.

That said, for those who are interested in this there is The Elements of Computing Systems: Building a Modern Computer from First Principles , more commonly known as "NAND to Tetris".

Petzold's Code is excellent as well.

Edit: Actually, while I've suggested those two let me throw Computer Systems: A Programmer's Perspective into the mix. It's a book we used across two courses and I really enjoyed it. We used the 2nd edition (and I have no issue recommending people get a cheaper, used copy of that), but there is a 3rd edition now. Being a proper text book it's stupidly priced (you can get Knuth's 4 book box set for $30 more), but it's a good book.

Anyone have suggestions similar to that Computer Systems's text? I've always wanted to revisit/re-read it, but could always used a different perspective.

by gilmi   2019-01-13
by indrora   2019-01-13

I think one of the most profound articles I read about just what makes a computer "work" is Brian Kernighan's article, "What an educated person should know about computers" . (Amazon link)

Another was sitting down and reading Code: the hidden language of computing (Amazon link) and actually walking through it. The book is coming up on 20 years old, but Petzold (who has taught many a developer how to do fancy tricks with their silicon) really sat down and wrote a book that anyone could understand and come away from feeling better off and more knowledgeable about the way our world works. This is the book I refer new programmers and old knitting circle nannies to read when they ask how a computer works.

by userbinator   2018-11-27
If you would like to start at a slightly lower level, Charles Petzold has written a great book on the subject:

by haberman   2018-11-15
> I'm not really sure such a thing exists (or can exist). Verilog isn't "programming" in any way most developers are familiar with, it's a way of describing how logic gates are interconnected.

I've just finished reading Code ( that builds up a RAM array and 8-bit CPU starting from relays. I'm familiar with the concepts. I'm just looking for something that explains how to express these concepts using Verilog.

by berniesanders45   2018-11-10

I don't understand what you are asking, but I will try to answer by giving you several books.

by ryanplant-au   2018-11-10

A few that are only relevant to specific languages or niches:

by unknowngp   2018-11-10

>I want to be able to understand how computers work

Code: The Hidden Language of Computer Hardware and Software

I was on the search for the same as you a couple of weeks ago and people recommended the book above. I just recently started reading it but hopefully someone who has read it can chime in with their opinion.

by 0x7E3   2018-11-10

This book is a great place to start.

by fernandotakai   2018-11-10

a book i would recommend if you want to learn more is Code: The Hidden Language of Computer Hardware and Software

it really explains all the small concepts and where all this "computer magic" came from.

by KKrakens   2018-11-10

Code: The Hidden Language of Computer Hardware and Software

by se7ensquared   2018-11-10

This book is excellent for exactly the kind of thing you're talking about. I own it and read it. It teaches the concepts in a way that anyone can understand and keeps you interested throughout! Great resource!

Code: The Hidden Language of Computer Hardware and Software

by numinit   2018-11-10

Would recommend The Code Book and Code: The Hidden Language of Computer Hardware and Software . Two books I've read cover to cover, both are incredibly worth it.

by BiblicalFlood   2018-11-10

/r/learnprogramming as /u/Young_Torso said, and there may be free alternatives. But for hardware, Code: The Hidden Language of Computer Hardware and Software is a really good read that goes from discussing a how a Morse code telegraph machine works through relays to transistors and works up to how a von neumann architecture works. It doesn't assume any prior knowledge, and isn't very long or too technical.

by CSHunter33   2018-11-10

Congrats! I'm on such a programme at the University of Bath in the UK right now. Bath's programme teaches C and Java, with a little Python in some elective modules. There are also theory of computation modules with a bunch of discrete maths in.

If you let me know which specific course you're attending, what your undergrad was, and how technical a career you might want I can give more tailored advice.

I did the following for prep, after researching what modules I'd be taking:

  • MITx's Intro to CS MOOC (amazing)
  • Read and did all exercises from several relevant chapters from a "Discrete Maths for Computing" textbook I got second hand for a fiver (helped a lot in a maths-heavy module)
  • read the oft-recommended book Code (useful for awareness, but not essential, especially since we do no Comp Arch at Bath)
  • did some algorithm challenges at places like and once I had done the Intro to CS MOOC

Conversion masters are generally very intense so doing prep now and over summer is a great idea. The stuff I listed helped immensely and I would do the same again - perhaps I would switch the MITx MOOC to Harvard's CS50 instead since CS50 has a bigger spread of languages. If I had had more time on my hands, proceeding from here to do a Java MOOC would have been really useful also.

Working on the Leetcode/Firecode challenges helped a lot for general programming practice, and will also be helpful prep for job hunting later.

by Nasty_Nate93   2018-11-10

Computer Science as a whole is going to be hard to digest. I have heard good things about This book as a starting point, to give you a basic feel for it all (and determine if it's the right career path for you). You will need to choose your first language to start studying as well. Python or Java are not bad options.

by -___I---I-___   2018-11-10
  1. topic name: Fundementals, discrete math, algorithms, a good book to start with , there are tons of free courses and lectures on the internet, but you will have to type in the specific search terms

  2. idk

  3. idk

by wal9000   2018-11-10

I don't know anything in particular about MIDI files, but if you want a ground-up look at how computers go from 0 and 1 to doing the crazy things we do with them, Code: The Hidden Language of Computer Hardware and Software is supposed to be a good book.

by -EE-   2018-11-10

Code: The Hidden Language of Computer Hardware and Software

This book does a fantastic job of talking about digital circuit design (computer engineering) and software. I read this before taking courses, and it was helpful and insightful.

by anossov   2018-11-10

Time for another book! Try Code by Petzold . It goes the other way, from relays/transistors to logic gates, to building a simple CPU, to running machine code on it, to assembly, to high-level languages.