This edition of this title is not available for purchase in your country. Choose an available edition from the options above
You've subscribed to ! We will preorder your items within 24 hours of when they become available. When new books are released, we'll charge your default payment method for the lowest price available during the pre-order period.
Update your device or payment method, cancel individual pre-orders or your subscription at
Your Memberships & Subscriptions
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Something went wrong. Please try your request again later.

Code: The Hidden Language of Computer Hardware and Software Kindle Edition

4.6 out of 5 stars 2,775 ratings

What do flashlights, the British invasion, black cats, and seesaws have to do with computers? 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.

Due to its large file size, this book may take longer to download

Shop this series

 See full series
There are 23 books in this series.
1 unreleased or unavailable book is excluded.
  • Kindle Price:
    $244.88
    By placing your order, you're purchasing a license to the content and you agree to the Kindle Store Terms of Use.
Popular Highlights in this book

Editorial Reviews

Amazon.com Review

Charles Petzold's latest book, Code: The Hidden Language of Computer Hardware and Software, crosses over into general-interest nonfiction from his usual programming genre. It's a carefully written, carefully researched gem that will appeal to anyone who wants to understand computer technology at its essence. Readers learn about number systems (decimal, octal, binary, and all that) through Petzold's patient (and frequently entertaining) prose and then discover the logical systems that are used to process them. There's loads of historical information too. From Louis Braille's development of his eponymous raised-dot code to Intel Corporation's release of its early microprocessors, Petzold presents stories of people trying to communicate with (and by means of) mechanical and electrical devices. It's a fascinating progression of technologies, and Petzold presents a clear statement of how they fit together.

The real value of Code is in its explanation of technologies that have been obscured for years behind fancy user interfaces and programming environments, which, in the name of rapid application development, insulate the programmer from the machine. In a section on machine language, Petzold dissects the instruction sets of the genre-defining Intel 8080 and Motorola 6800 processors. He walks the reader through the process of performing various operations with each chip, explaining which opcodes poke which values into which registers along the way. Petzold knows that the hidden language of computers exhibits real beauty. In Code, he helps readers appreciate it. --David Wall

Topics covered: Mechanical and electrical representations of words and numbers, number systems, logic gates, performing mathematical operations with logic gates, microprocessors, machine code, memory and programming languages.

About the Author

Charles Petzold has been writing about Windows programming for 25 years. A Windows Pioneer Award winner, Petzold is author of the classic Programming Windows, the widely acclaimed Code: The Hidden Language of Computer Hardware and Software, Programming Windows Phone 7, and more than a dozen other books.

Product details

  • ASIN ‏ : ‎ B00JDMPOK2
  • Publisher ‏ : ‎ Microsoft Press
  • Accessibility ‏ : ‎ Learn more
  • Publication date ‏ : ‎ October 11, 2000
  • Edition ‏ : ‎ 1st
  • Language ‏ : ‎ English
  • File size ‏ : ‎ 10.2 MB
  • Simultaneous device usage ‏ : ‎ Up to 5 simultaneous devices, per publisher limits
  • Enhanced typesetting ‏ : ‎ Enabled
  • X-Ray ‏ : ‎ Enabled
  • Word Wise ‏ : ‎ Enabled
  • Print length ‏ : ‎ 400 pages
  • ISBN-13 ‏ : ‎ 978-0735638723
  • Page Flip ‏ : ‎ Enabled
  • Part of series ‏ : ‎ Developer Best Practices
  • Customer Reviews:
    4.6 out of 5 stars 2,775 ratings

About the author

Follow authors to get new release updates, plus improved recommendations.
Charles Petzold
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Charles Petzold has been writing about Windows programming for 25 years. A Windows Pioneer Award winner, Petzold is author of the classic Programming Windows, the widely acclaimed Code: The Hidden Language of Computer Hardware and Software, Programming Windows Phone 7, and more than a dozen other books.

Customer reviews

4.6 out of 5 stars
2,775 global ratings

Review this product

Share your thoughts with other customers

Customers say

Customers find the book an excellent introduction to computer architecture, explaining complex subjects clearly and breaking down programming into understandable sections. Moreover, they appreciate its readability, logical structure, and simple language, while also praising its enlightening content as an invaluable history lesson. Additionally, the book receives positive feedback for its design, with one customer noting it takes a journey through communication history. However, the pacing receives mixed reviews, with some finding it too fast in the middle, and customers note that the content is somewhat outdated.

225 customers mention "Readability"214 positive11 negative

Customers find the book highly readable, describing it as a delight and an absolute joy to read, with one customer noting it takes the reader on a great journey.

"...So I recommend this book to everyone. It is a true joy to read. And I at least could feel my mind expanding as I read it." Read more

"Amazing book. Everything is explained so well and I really enjoyed reading it...." Read more

"...since then read numerous books on computing that I found to be extremely interesting, but without the spark provided by this book I would still be..." Read more

"...This is where this wonderful book came into play...." Read more

96 customers mention "Writing quality"79 positive17 negative

Customers praise the writing quality of the book, finding it extremely well written, easy to read, and amazingly clear, with one customer noting it's not written as a dry textbook.

"...It is extremely well written...." Read more

"...Petzold takes us on a journey in short, easy-to-read, and occasionally humorous chapters, staring from two young children passing messages to each..." Read more

"...software including operating systems, computer languages from Assembly to high level languages and some input output device analysis...." Read more

"...book is fantastic, it's entertaining yes, but more importantly it's very clear, concise, and really appeals to my aforementioned learning style...." Read more

45 customers mention "Enlightened content"41 positive4 negative

Customers find the book enlightening, describing it as an illuminating narrative that serves as an invaluable history lesson. One customer notes how it takes readers on a journey through the history of communication.

"...The chapters on memory, automation and microprocessors is simply brilliant and the detailed sketches of the varying states of these components makes..." Read more

"...Petzold takes us on a journey in short, easy-to-read, and occasionally humorous chapters, staring from two young children passing messages to each..." Read more

"...level computer languages compile into machine code, this book will be truly enlightening as you will then understand what happens (mostly) from when..." Read more

"...take terabytes of hard drive space for granted, this is an invaluable history lesson that will aid your understanding of everything a computer does." Read more

15 customers mention "Design"15 positive0 negative

Customers appreciate the design of the book, describing it as beautiful and thoughtful, with one customer noting how it encourages readers to think.

"...information encoding, electricity, computer hardware, computer architecture, software including operating systems, computer languages from..." Read more

"...etc.--and how all these components interact--in a way that is personable and understandable, but without dumbing it down...." Read more

"...book tells how it explains computers and technology; it does that beautifully, creatively...." Read more

"...That being said it really is a good quality book, both in subject and in substance...." Read more

13 customers mention "Computer work"13 positive0 negative

Customers appreciate the book's coverage of computer systems, with one customer highlighting its detailed explanation of microprocessors and another noting its progression from basic to modern systems.

"...The chapters on memory, automation and microprocessors is simply brilliant and the detailed sketches of the varying states of these components makes..." Read more

"...Petzold wrote this book so that anyone could understand code and how computers work...." Read more

"...the only novel thing that is going on is the miniaturization, performance improvements and power consumption benefits...." Read more

"...From that chapter onward, it is about the relatively detailed working of a modern computer - e.g. how integrated circuits (chips) work, what..." Read more

13 customers mention "Pacing"7 positive6 negative

Customers have mixed opinions about the pacing of the book, with some noting that it starts off slowly but doesn't move too fast, while others find the middle sections too fast-paced.

"...The books starts off slowly, using metaphors to explain the basics of encoding and basic calculation...." Read more

"...The pacing, in my opinion, was too slow in the beginning and too fast in the middle. You'll want to take your time with this book...." Read more

"...the tone of the book is very informal and easy to read, and moves at just the right pace...." Read more

"...It felt rushed & tacked on...." Read more

9 customers mention "Dated content"0 positive9 negative

Customers find the content of the book outdated.

"...The book is also extremely outdated. It was published when Jeff Bezos still had hair." Read more

"...It is a little dated, the book was printed in 1999, so some of the examples are a little old..." Read more

"...parts get very heavy into assembly language, and the final couple chapters are dated...." Read more

"...It is not a new book, but its concepts will be valid for as loong as electrity is used to build and operate computers...." Read more

A classic
5 out of 5 stars
A classic
I have just finished this very well written and informative book. Much has been said about it so I won't repeat the good points. One thing however is that if you are somewhat uninitiated reader(which is basically the main target audience of this book) you need to have patience and grit to finish it. I understand the subject is not very easy , and even though material is explained well, expect to get stuck at several points. Some knowledge of math(mainly basic probability) will help and repeat reading of problematic parts will likely clear all doubts that you might have. I am impressed by the practicality and scope of this book, so I ordered second, newer edition.
Thank you for your feedback
Sorry, there was an error
Sorry we couldn't load the review

Top reviews from the United States

  • Reviewed in the United States on November 27, 1999
    Format: HardcoverVerified Purchase
    I think that this is the best book that I have read all year. In some sense this is the book that I have been looking for for twenty-five years--the book that will enable me to understand how a computer does what it does. And--given the centrality of computers in our age--it has been a long wait. But now it is over. Charles Petzold (1999), Code: The Hidden Language of Computer Hardware and Software does a much better job than anything else I have ever seen in explaining computers--what they really are, and how they really work.
    Have you ever wondered just how your computers really work? I mean, really, really work. Not as in "an electrical signal from memory tells the processor the number to be added," but what the electrical signal is, and how it accomplishes the magic of switching on the circuits that add while switching off the other circuits that would do other things with the number. I have. I have wondered this a lot over the past decades.
    Yet somehow over the past several decades my hunger for an explanation has never been properly met. I have listened to people explain how two switches wired in series are an "AND"--only if both switches are closed will the lightbulb light. I have listened to people explain how IP is a packet-based communications protocol and TCP is a connection-based protocol yet the connection-based protocal can ride on top of the packet-based protocol. Somehow these explanations did not satisfy. One seemed like answering "how does a car work?" by telling how in the presence of oxygen carbon-hydrogen bonds are broken and carbon dioxide and water are created. The other seemed like anwering "how does a car work" by telling how if you step on the accelerator the car moves forward.
    Charles Petzold is different. He has hit the sweet spot exactly. Enough detail to satisfy anyone. Yet the detail is quickly built up as he ascends to higher and higher levels of explanation. It remains satisfying, but it also hangs together in a big picture.
    In fact, my only complaint is that the book isn't long enough. It is mostly a hardware book (unless you want to count Morse Code and the interpretation of flashing light bulbs as "software." By my count there are twenty chapters on hardware, and five on software. In my view only five chapters on software--one on ASCII, one on operating systems, one on floating-point arithmetic, one on high-level languages, and one on GUIs--is about ten too few. (Moreover, at one key place in his explanation (but only one) he waves his hands. He argues that it is possible to use the operation codes stored in memory to control which circuits in the processor are active. But he doesn't show how it is done.)
    Charles Petzold's explanatory strategy is to start with the telegraph: with how opening and closing a switch can send an electrical signal down a wire. And he wants to build up, step by step, from that point to end with our modern computers. At the end he hopes that the reader can look back--from the graphical user interface to the high-level language software constructions that generate it, from the high-level language software constructions to the machine-language code that underlies it, from the machine-language code to the electrical signals that load, store, and add bits into the computer's processor and into the computer's memory.
    But it doesn't stop there. It goes further down into how to construct an accumulator or a memory bank from logic gates. And then it goes down to how to build logic gates--either out of transistors or telegraph relays. And then deeper down, into how the electrons actually move through a transistor or through a relay and a wire.
    And at the end I could look back and say, yes, I understand how this machine works in a way that I didn't understand it before. Before I understood electricity and maybe an AND gate, and I understood high level languages. But the whole vast intermediate realm was fuzzy. Now it is much clearer. I can go from the loop back to the conditional jump back to the way that what is stored in memory is fed into the processor back to the circuits that set the program counter back to the logic gates, and finally back to the doped silicon that makes up the circuit.
    So I recommend this book to everyone. It is a true joy to read. And I at least could feel my mind expanding as I read it.
    386 people found this helpful
    Report
  • Reviewed in the United States on April 27, 2025
    Format: HardcoverVerified Purchase
    Amazing book. Everything is explained so well and I really enjoyed reading it. The cover was very beat up, but I bought a "fine" condition used, so that's to be expected.
    If you have any interest in computers, computer science, or even electrical/electronics engineering, you have to read this.
  • Reviewed in the United States on March 12, 2014
    Let me revise my previous review with a few brief things to say about this.

    First, this book has a lot of pictures and diagrams and you'll want to frequently go back to them and take your time. For this reason, it's probably a pretty bad idea to buy the kindle version.

    Second, this books starts out as super-light reading (for me anyway) and then starts getting much harder and denser. For that reason I can't give it 5-stars. The preview you get for your kindle might be misleading for that reason. The pacing, in my opinion, was too slow in the beginning and too fast in the middle.

    You'll want to take your time with this book. This is very close to a Malcolm Gladwell or Freakonomics style book, but it's not quite.

    But, on the other hand, this really is a good book if you want to learn about this sort of thing. Unlike Gladwell or Freakonomics, you really are learning stuff. I see no reason why this couldn't be used in a college course, but it won't feel like you're reading a textbook. For what it is, it's extremely accessible. And I don't think there's another book quite like this, certainly not of this quality. It is extremely well written. I did wind up taking a few flashcards, though, since it is harder than other books that follow the template of: "one-syllable-word: the amazing hidden side of superlative everythingness." But it's still done in a style that is very close to that. And you'll actually learn things that are true, and not figure out a later after you read the book that studies were misrepresented and facts distorted to fit the narrative of the book.

    So that's why I revised this review. I know a bit more than I did when I first wrote it and my expectations of what the book is has changed, too. I'm going to buy whatever this guy puts out next. Four stars only because the pacing was a little off and it might not be exactly what you expect it is from the first couple of chapters. If you want to actually learn about how computers work, there has never been a book this well-written. But you do have to actually want to know how computers work.
    17 people found this helpful
    Report

Top reviews from other countries

Translate all reviews to English
  • Zwei Drei
    5.0 out of 5 stars パソコンの電気的な仕組みを知るための本
    Reviewed in Japan on August 13, 2022
    Format: PaperbackVerified Purchase
    小学生のころから、パソコンは電気で動く、電気で計算している、2進数も電気のオン・オフで表現される、といった話は聞いていましたが、具体的な仕組みは知りませんでした。
     例えば、NOTゲートは、入力が「0」(電気が流れてこない)なら出力は「1」になる(電気が流れ出ていく)わけですが、この出ていく電気はどこから湧いたのでしょうか? 逆に、入力が「1」なら出力は「0」ですが、入ってきた電気はどこに消えたのでしょうか? こういったことは、真理値表や論理回路の記号を眺めていただけでは分かりません。

     この本、Charles Petzoldの『Code』は、小学校で習うような電気回路から、論理ゲート、メモリ、CPUなど(の実物よりかなり大きなモデル)を組み立てる方法を説明し、ブラックボックスだったコンピュータの中身を目で見えるようにしてくれます。
     NOTゲートの例についても、そこに繋がっている導線が、実は、入力用と出力用の2本以外にもあり、魔法が使われているわけではないということが分かるようになります。
     その他の疑問も、私の場合は、この本でほとんど解消しました。特に、コンピュータによる「計算」とは懸け離れているように感じられる周辺機器(ディスプレイやプリンタ)の制御方法にも簡単に触れられていて、「考えた人すごい!」と思いました。もちろん、これを分かりやすく説明してくれる著者もすごいのですが。

     というわけで、コンピュータの大体の構成は理解したうえで、それが実際にはどう実現されているのか具体的に知りたい、という方にはぜひ読んでみていただきたい本です!
     洋書ですが、平易な英語で書かれているので、コンピュータ用語になじみがあれば、すらすら読めるはずです。「試し読み」で確認してみてください。(「Preface」だけは少し難しめかもしれませんので、本文で判断されることをお勧めします。)
    Report
  • MJM
    5.0 out of 5 stars Very, very good: especially if you are a high level programmer and are interested in the fundamentals
    Reviewed in Canada on July 9, 2015
    Format: PaperbackVerified Purchase
    Simply the best introduction to fundamental computing from an electronics perspective to those without a formal Comp. Sci. degree there is in my opinion.
    As a Perl programmer - and one could say any high level programming language - I am abstracted from the hardware so have no real idea of what goes on 'in the engine' compartment. True, a lot of the information is now historic and is utterly unnecessary to know in these days of virtualised cloud computing on demand with pay-per use billing....but for those interested it is an insight to that now passing (passed?) era of 'the Before Time'.
    This book has a very smooth, swallow learning curve - more a 'learning line' - and goes from a simple on-off telegraph relay used as a transmission device all the way through how n-bit adders and '1s complement' is used to to interact with memory blocks to do subtraction through to their implications and use in assembly language with registers of modern processors.
    The section on coding of language (Braille is used as an example) is also enlightening.
    From the discussions I've had with others who have done formal Computer Science degrees (I haven't - yet) this book covers a sizable chunk of the fundamental computing topics.
    After reading this book I will never look at a division operation in one of my programs in the same way again!
  • Lucas Dias
    5.0 out of 5 stars Se você sabe inglês, um dos melhores livros para entender os conceitos base da computação.
    Reviewed in Brazil on August 29, 2022
    Format: PaperbackVerified Purchase
    É um livro que te introduz à muitos conceitos de computação de forma muito clara e lúdica. Ele não é um livro pesado que você precisa ler enquanto faz várias anotações e pesquisa vários termos. Ele é realmente um livro introdutório, se você está começando ou já trabalha com computação e quer aprender esses conhecimentos básicos, esse é provavelmente um dos melhores livros. Mesmo na UFRJ as aulas não são tão claras e tão aprofundadas como esse livro, que em seu 12º cápitulo já explica ADDER usando circuitos lógicos, algo que eu não vi cursando ciência da computação na UFRJ, com matérias que utilizavam circuitos lógicos.
  • Amit Shrivastava
    5.0 out of 5 stars Truly an amazing and detailed book
    Reviewed in India on February 28, 2021
    Format: PaperbackVerified Purchase
    This book will take you on a journey from morse code to modern day computing and how evry thing works in a computer , the contribution of legends like George Boole and Claude Shannon, how the modest AND gate , paved the way for modern day computers with the transistors making every thing compact, at the end computers operate on electric signals and perform seemingly complex operations rapidly, any one who has any interest in computer related topics must read this book , coders can learn a lot from it, the complexity is all taken care for by the legends, we merely need to provide the right instructions in friendly language of our choice ...
    Customer image
    Amit Shrivastava
    5.0 out of 5 stars
    Truly an amazing and detailed book

    Reviewed in India on February 28, 2021
    This book will take you on a journey from morse code to modern day computing and how evry thing works in a computer , the contribution of legends like George Boole and Claude Shannon, how the modest AND gate , paved the way for modern day computers with the transistors making every thing compact, at the end computers operate on electric signals and perform seemingly complex operations rapidly, any one who has any interest in computer related topics must read this book , coders can learn a lot from it, the complexity is all taken care for by the legends, we merely need to provide the right instructions in friendly language of our choice ...
    Images in this review
    Customer imageCustomer image
  • Filip Kolev
    5.0 out of 5 stars It tells a story, not mere facts
    Reviewed in the United Kingdom on December 14, 2018
    Format: PaperbackVerified Purchase
    To be honest, I did not expect much of this book. I ordered it together with The Annotated Turing, again by Petzold. It was marked as a best seller, but that doesn't mean much, especially when computer science is concerned.

    I own a great many awesome CS books. But this one went to the top of my list very quickly, perhaps just barely 20 pages in. It's not a description of who did what, or how a particular piece of technology works. It's a story of how our modern world came to be. And it's a brilliant story.

    Petzold challenges the reader right at the start - assume you're 10 years old and in your home, trying to talk to your friend on the other side of the street. Of course, you don't have a phone or anything like that. You need to use technology which is freely available and will not wake up your parents. Step by step, you discover Morse code (discarding several options prior to reaching this stage). Then you solve various challenges, like assuming your friend does not live in a direct line of sight.

    Little by little, we learn about Braille code, simple flashlights, relays, then go on to more ambitious concepts like logic gates, flip-flops and, ultimately, a fully functional computer made of relays and other simple components (which is, I should point out, purely fictional, of course). And I enjoyed every step of this journey.

    The book is written with the general reader in mind, it does not target software developers or engineers. I cannot say how someone with no prior computer knowledge would find it; it is beyond my ability to imagine myself without everything I've learned since I began my career path as a programmer. Perhaps the point where assembly is introduced would be a bit too much, or the descriptions of Intel's 8080 and Motorola's 6800. But hey, we do get from flashlights to computers within 400 pages, so it can't all be a smooth ride.
    Also, I should mention, the reader is bound to notice how old the book is :) Many technologies that were all around us at the time of writing are already gone and that was barely 20 years ago...

    All in all, I probably didn't learn much I didn't already know, but if I ever recommend a computer book to a non-programmer this would be it. Very enjoyable and informative. You will not regret buying this.
    One person found this helpful
    Report

Report an issue


Does this item contain inappropriate content?
Do you believe that this item violates a copyright?
Does this item contain quality or formatting issues?