Code: The Hidden Language of Computer Hardware and Software

by: Charles Petzold (0)

The classic guide to how computers work, updated with new chapters and interactive graphics

"For me, Code was a revelation. It was the first book about programming that spoke to me. It started with a story, and it built up, layer by layer, analogy by analogy, until I understood not just the Code, but the System. Code is a book that is as much about Systems Thinking and abstractions as it is about code and programming. Code teaches us how many unseen layers there are between the computer systems that we as users look at every day and the magical silicon rocks that we infused with lightning and taught to think."

- Scott Hanselman, Partner Program Director, Microsoft, and host of Hanselminutes

Computers are everywhere, most obviously in our laptops and smartphones, but also our cars, televisions, microwave ovens, alarm clocks, robot vacuum cleaners, and other smart appliances. Have you ever wondered what goes on inside these devices to make our lives easier but occasionally more infuriating?

For more than 20 years, readers have delighted in Charles Petzold's illuminating story of the secret inner life of computers, and now he has revised it for this new age of computing. Cleverly illustrated and easy to understand, this is the book that cracks the mystery. You'll discover what flashlights, black cats, seesaws, and the ride of Paul Revere can teach you about computing, and how human ingenuity and our compulsion to communicate have shaped every electronic device we use.

This new expanded edition explores more deeply the bit-by-bit and gate-by-gate construction of the heart of every smart device, the central processing unit that combines the simplest of basic operations to perform the most complex of feats. Petzold’s companion website,, uses animated graphics of key circuits in the book to make computers even easier to comprehend.

In addition to substantially revised and updated content, new chapters include:

  • Chapter 18:  Let’s Build a Clock!
  • Chapter 21:  The Arithmetic Logic Unit
  • Chapter 22:  Registers and Busses
  • Chapter 23:  CPU Control Signals
  • Chapter 24:  Jumps, Loops, and Calls
  • Chapter 28: The World Brain

From the simple ticking of clocks to the worldwide hum of the internet, Code reveals the essence of the digital revolution.

The Reviews

Cheap looking glasses, they are Polarized but not in a good way, even looking at the phone screen it looks bad (no, good polarized googles don’t have this problem, like my reading glasses)… I’ll will not buy this again, it’s a cheap 5 dólar glasses you can’t find at a conveniences store

They are ok.. unfortunately we’ve had for less than two weeks and the outer lining is already coming off :(( the blue polarized part. Disappointing.

Broke easily

Lenses keep popping out but they are pretty cool

How did this happen?? How did a second version of one of the most amazing books on computers slip into print and kindle without me knowing!C.O.D.E has been a staple in my home for over two decades; i've purchased it as gifts, and gushed undying gratitude to anyone who would listen on both the simple and complex treatment of topics of circuitry and computing from the ground up, in an accessible way.Did I need a second edition? No... I still have my hardcover first edition sitting in a coveted spot of my book shelf, and to me, it is perfect and complete.Did I want a second edition.. heck yes! I wanted to have it, and share it, and tell people about it, and most importantly support the author.Do yourself and those you care about a favor... grab a copy of this exceptional book.Signed, #1 Fanboy.

I originally read and fell in love with the 1st edition of this book 15 years ago... it gives you a very deep knowledge of what's going on in your computer, but makes it understandable and accessible.This edition improves and adds to areas that were left out (or now need updating for the web and JavaScript).The really amazing surprised is the accompanying website to the book that allows you to interact with the concepts (circuits and design) in a web browser... so you can switch things on and off and see how they respond in the computer.Highly recommend for anyone really trying to understand at the lowest level of how a computer works.

Over the last twenty years I've purchased many copies of this book for family, friends, and students. It's by far the best text to read for those who wish to understand what makes computers "tick" on a fundamental level. It's the perfect book to read before taking any college level operating systems course, assembly, or computer organization/architecture courses.

This book teaches things we may never paid attention to. It’s captivating and educating. You don’t need to be a programmer to read this book. It’s just explains why things can be called code and how things work.

This is very informative. It makes understanding a computer’s communication with its self a lot easier

starts with very simple and easy to understand examples,

It start from beginning and slowly takes you to how really computers works.Very helpful information to me as a software developer.

As an ardent reader of the past 1st edition, I was fairly excited to get the latest version. That is, until I encountered the history chapter of the new edition.For one thing, what I do NOT understand in this second edition is the newly added description of August Ada Byron (countless of Lovelace). The author claims it was Babbage who was the first programmer to design the engines, not Ada. I am not trying to start a futile argument here about who has more or fewer contributions, etc.What I am trying to assert here is that it is undisputed that Ada (unless the new evidence arises) left *the very first demonstration* of what this seemingly imaginary machine, which didn't even physically exist, was capable of through her program. Because Babbage designed the engine itself, that doesn't automatically put him in the position of a programmer (despite Babbage being a brilliant engineer/scientist and may have had a simple or detailed program in his mind). However, it was Ada who gave a definite touch to programming concepts that ultimately led to modern-day programming. Ada deserves more recognition than a mere "tutorial writer," and she is certainly entitled to the title she deserves.Other than that, like the previous edition, this book is a must-read for people who are from related/unrelated fields. I always loved the 1st edition, and I would do too with the 2nd. Still, I think history should always be approached with more care, particularly if matters have potential controversies.

I never read the first edition of Code, but this seems to be an improvement. I'm only 100 pages in, but it is quite readable and I like the author's pace - though there's alot of material that's covered, the pace is relaxed and the reader usually won't feel overwhelmed. A minor flaw that I've noticed is that the physics underlying some of the engineering wasn't explained in detail, and that would've helped with regards to be being able to understand the circuits. On the whole, this book seems to be great, and I'd highly recommend it to programmers trying to understand the software-hardware interface.

It start from beginning and slowly takes you to how really computers works.Very helpful information to me as a software developer.

Disclaimer: I owned the first edition for years and read it a dozen times, mainly for pleasure since it’s not only informative but also just enjoyable to read. I’m a professional software architect and have dozens of textbooks on computer science and engineering so I’ve been around the block.This is the kind of book I would buy all for all my friends (if I had more than a couple) and family members (if they were even slightly into computers, which they aren’t sadly). Petzold does an exceptional job at describing digital logic and guides you through building a conceptual CPU from very first principles.I think his bottom up approach is the way to go and has helped me understand complex topics in an extremely simple way. When I’m not reading fiction, this is my go to bedtime reading.The second edition has about 100 more pages than the first and some content has been completely reworked and it’s great.If you ever had even a passing interest in knowing how computers work at a very fundamental level, get this book!

Code: The Hidden Language of Computer Hardware and Software
⭐ 4.9 💛 170
kindle: $23.99
paperback: $27.67
Buy the Book