Home - Algorithms

Product Details

Binding:

Paperback

EAN:

9780735611313

Label:

Microsoft Press

Feature:
Publisher:

Microsoft Press

Studio:

Microsoft Press

Editorial Reviews

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.

Customer Reviews

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.

The average person who uses a computer to surf the web or type letters has so little knowledge of the underlying technology he or she is using that it may as well be magic. Even programmers, who typically spend their days solving problems with the high-end abstractedness of object-orientation, may be more than a little unclear about what's actually going on inside the box when their compiled code is running.

Petzold attempts, and largely succeeds at, writing a book that leaves the reasonably intelligent layperson with a thorough comprehension of each layer that comprises a modern electronic computer (binary coding -> electronic representation -> transistors -> logic gates -> integrated circuits -> microprocessors -> opcodes -> assembly language -> high-level language -> applications). At times, the reader must follow along carefully, but Petzold tries to avoid needless complication.

Code is a well written and very entertaining explanation of the digital electronic technology that has become an integral part of our daily lives. Short of getting a degree in electrical engineering, this book is your best bet to understand how it works.

Charles Petzold a does an outstanding job of explaining the basic workings of a computer. His story begins with a description of various ways of coding information including Braille, Morse code, and binary code. He then describes the development of hardware beginning with a description of the development of telegraph and relays. This leads into the development of transistors and logic gates and switches. Boolean logic is described and numerous electrical circuits are diagramed showing the electrical implementation of Boolean logic. The book describes circuits to add and subtract binary numbers. The development of hexadecimal code is described. Memory circuits are assembled by stringing logic gates together. Two basic microprocessors are described - the Intel 8080 and the Motorola 6800. Machine language, assembly language, and some higher level software languages are covered. There is a chapter on operating systems. This book provides a very nice historical perspective on the development of computers. It is entertaining and only rarely bogs down in technical detail.
The book starts out very solid, describing all the building blocks of a computer. The beginning is the best book I've seen so far describings everything from the binary system to electrical circuits, to gates to simple calculators, to memory, to a complete machine with a "control panel". But after that, the book started getting a LOT more broad (not necessarily a bad thing). It seems almost as if Petzold wanted to tell you everything about the world of computers, but couldn't fit it in a book such as this; so he dabbed a little here and there of a few terms, history, etc... (allowing you the option to look up anything you wanted if you had the interest).

My oppinion is that the book is _great_ up to about the middle of the book, after which he just condenced all the rest of the information which would otherwise takes thousands of pages to describe in as much details as he described how to build a physical logic machine... I think that if someone isn't a "techie" or isn't in the computer field, they may have some hard time understanding a few minor points... but overall, this is a GREAT book.. one of a kind.

Greatly recommended for everyone's library... I can honestly say, I always told people "a computer is nothing more than zero's and one's"... but until I read this book, I couldn't BUILD one... now I can (given time! :).

P.S. This book is perfect for those who didn't necessarily go to college and learned everything on their own... it covers some CS, CE, and EE. Those who went to college with either of those majors probably learned the greatest part of this book... but it's a great review.

Have you ever opened up the case of your PC, only to find that there are seemingly millions of lego-esque pieces stuck together? Have you ever wondered how computing went from the abacus to the Palm IV? Have you ever asked how the engineers are able to do the things they do?

Well, ask no more. Instead, read this book. Charles Petzold is able to describe the workings of a simple computer, starting from the ground floor. He begins with descriptions of a simple circuit, and slowly works his way to more and more complex structures. You learn about flashlights, Morse code, and the early computers, and how each has impacted modern computing.

Will this book teach you how to program? No. But if you were not a computer science major or electrical engineer in college, this book will lay some of the foundations for understanding this technology. The technical aspects get a little dense at times, but this did not detract from the impact of this book.

If you have been curious about what goes on in that beige box, now is your time to investigate. This is the place to start.

This book cleared up some fuzzy areas that I have always been interested in but never really had the time to pursue. I have been developing software since 1980, and got this book because of the sample chapter that I read from the MS website. Now that I have read the book, I am able to better understand the electrical system on my plane (a surprise side effect of reading the book, I expected it to be more high level)

I would recommend this book to all software developers, and also anyone that has any technical hobbies. It has much technical information, but is also very easy to read.

Steve

Yes, that's right! CODE is the greatest book on the face of the earth!
Why? Here's my story, and go judge for yourself.
I'm using computers for around four years. My question was always "How is this thing doing it's stuff?". Although I have no idea how other electronic stuff work, the computer did bothered me more then anything else because the computer seems to do some kind of THINKING, that's why it triggered my THINKING. This question kept on staying in my head until two weeks ago. It really bothered me. All along this four years I was looking for an answer to my question. I bought books, went to the library a thousand times, but nothing helped me. I learned a few programming languages along my journey, but it did not clarify how it really works. So I decided to learn Assembly Language because I taught that that's where I'm going to find the answer to my question. I must admit that it did helped me out quite a bit, but not to the extent I expected. I used a great book called "Assembly Language Step-by-Step" by Jeff Duntemann, which is a great book, but since the subject of the book is not to teach you how computers work, it didn't helped me enough to satisfy my desire for the answer to my question. I contacted Jeff Duntemann, the author of the book and I told him my problem. He referred me to this book CODE. So I rushed and bought this book. The rest of the story is self-understood, the book made my day and my life. And that's why I'm restating "This is the greatest book on the face of the earth".
It's not often that you come across a book that deals with complex topics in language that the layman can understand.

The organisation is excellent - Petzold explores one topic at a time, giving you the chance to absorb one concept before moving on to the next. And each chapter builds on what you have read before.

If you are just curious about what goes on inside your PC, or if you are involved in IT but lack an understanding of the actual box that does all the work, then this book is for you.

This is a fascinating book on many levels. Extremely well written. For anybody who uses computers in their work and always wondered what goes on under the covers, this book touches on just about every area and goes into great detail in some areas.

On the other hand, don't buy this book if you want practical information about how to be a better programmer or whatever. This book is definetely suited to an enthusiast who is honestly interested in learning arcane details. It isn't going to help anyone get a higher salary or a promotion.

That's what I really liked about this book. It was truly different from any other book you will ever buy from Microsoft Press or like publishers.

My only real critiscism is that it seems to run out of steam at the end. Chapter after chapter is devoted to the inner workings of logic gates, memory, and so on, but almost nothing is said about operating systems.

I am a computer programmer by trade and sincerely wish I had this book 7 years back when I started formal education. During my 4+ years in the higher education system, and even after, I and my classmates (later colleagues) were taught how to program computers (in various languages) and many of the higher level ideas in programming (Data Structures, Algorithms, Program Structure, Etcetera, Etcetera, Etcetera) but we never really learned how the computers worked inside. Even to many trained programmers, or at least me:), these beige boxes can be something of a magical black box which we don't really understand at a fundamental beyond the point of it processing the instructions we give it in our chosen programming language. In school I recieved perhaps one single semester course that attempted to teach how these things worked inside, yet that course still skimmed on the inner workings, the teacher instead spent his time on how monitors drew pixels on the screen and how laser printers worked.....

Looking back on it, I would blame the ignorance of the inner workings of computers that some programmers have on the decline of having to learn Assembly language (starting in the early nineties?), the lowest level programming language sans actual Machine Code, where one would be forced to deal with the raw inner workings of a computer naturally. I myself hope to learn it one day after reading this book :D Instead, I was taught the C programming language and what we learned in school became only more abstract in regards to the actual hardware...

This is where this wonderful book came into play. Since I recieved it half-a-year ago, it must have been read/devoured by me a dozen times or more - it goes from teaching the make-up of various codes (morse, braille, etcetera) to showing how some simple to understand concepts can be combined until a working computer, calculator, etcetera, can be built....... it gives one a great foundation for learning what Computer Science is all about or gives a newer-generation Programmer, like me, much needed knowledge on how that beige box basically works, on a hardware level!

The best thing is that those computer analogies can be finally thrown out the window - we all heard them before - like how "ram is like a table, or workspace. The bigger it is, the more things you can have ready and available at one time. The hard drive is like your drawers and cabinets. You can store more stuff there, but to use it, you have to take it out first and put it either on the table (RAM) or hold it in your hand (cache)." Petzold also uses analogies when he introdues topics but quickly moves beyond them, giving his audiences real understanding of the subject - which is very welcoming since analogies tend to explain function well but break down quickly when one is determined to learn more about a topic.

It is probably one of the few computer books on my shelf that can't get outdated and that's good, because it still will be there in 20 years.
If you are a geek you will love this book! As a programmer I found this book to be very interesting. I've read other reviews complaining that this book is for novice computer users, I completely disagree! Most developers work in a world of high level languages that completely abstract the inner workings of the computer's CPU and memory. This book manages to teach the reader the most basic elements of how a computer works starting with an intriging look at the basic physics of electricty and building up all the way to Assembly language. This book should be mandatory reading for all CS majors.
As a hobbyist programmer, I had wondered for years how a computer worked at its most internal level. I had even had a couple of unsuccessful encounters with other "How Computers Work"-type books that left me mainly with the dissatisfied impression that the machine was an impenetrable black box.

Petzold's book was not like this. While other books started with flashy graphics of internal designs all flowcharts with little in the way of explanation, Code starts off simply, with two flashlights and the goal of communicating at night. This problem, of course, would be easy solved by anyone who knows of Morse code. Yet, from Petzold's pen it becomes an illuminating and amusing journey with attempts to deal with similar scenarios of every increasing complexity until I realized two-thirds of the way through that given a sufficient time and space, I could, at least in theory, build a computer. This is the greatest success of Code, in my opinion. Rather than attempting to peel away the mysteries of the system a layer at a time like an onion, it delves directly to the core and builds upon its ideas in a fashion like that of the original computer designers, until everything forms into a cohesive whole. Petzold does an excellent job of capturing his excitement for the material, making the progressive developments a joy to read about.

With my uneven background knowledge, there were a few sections that I felt that I could skim through, but also many a passage that I had to carefully scrutinize. Overall, I'd recommend this book for anyone interested in computers, from beginner to expert: Petzold provides enough explanation for a determined newcomer to understand all of the concepts, but enough breadth to still entertain and educate those with more experience in the area.

It's not often I willingly give money to Microsoft, but I bought this book in hardcover. I don't care if Petzold is a hardcore Windows guy or not; this book is as deserving of immortality as the Lions book or "Godel, Escher, Bach".

Why? Because it lays it all out. Though it goes a bit light on the actual electronics, preferring to focus on the telegraph relay as its main way of understanding what's going on, this book takes the reader from square one -- sending messages to a friend with a flashlight -- to the structure of a modern microprocessor. It's an incredibly detailed yet easily accessible look at the internals of a computer system.

Flaws? A couple -- no index, and as I said it gives short shrift to what may be the single biggest invention of the 20th century, the transistor. But by and large Petzold has written the ultimate book to explain the mysteries of the computer to the layperson. This book is a must-buy.

This book reminded me of "Connections". If you are unclear about the difference between binary, hex, and decimals, or what an opcode is, and what it does for you, this is a great book. He has written it like a guidebook.

I liked this book very much and have recommended it to several of my friends.

I hold a bachelors degree in computer science, but it has been 11 years since I have studied it seriously. This book has rekindled my interests, and I am now considering returning to school to get my masters degree. Charles Petzold is a very gifted author. He made several topics in his book much clearer than any professor or lecturer ever did. I recommend that anyone with an ounce of curiosity about the inner workings of computers read this book from cover to cover. Its destined to be a home library must-have.
This book starts out by explaining how batteries produce electricity, then goes into the telegraph and the light bulb, and then based on that moves into explaining how computer logic gates work, how computer memory works, how different parts of the computer communicate over the buss. I've learned at the lowest level, all the way down to the electrons, those fundamentals that I have been seeking to understand for 12 years.

If you buy no other computer book this year, and you have the same yearning as I do to know the lowest of details without having to understand complex mathematics than you should buy this book. It is an absolute master piece of technical literature. It will teach you how electricity works and flows, how computers turn that electricity into bits and bites and running programs. It will help you to easily understand the lowest levels of computers.
After reading this book, I wrote an email to Charles Petzold. Here's an abridged version:

-=-=-=-=-=-=-=-=-=-=-=-=-
Dear Mr. Petzold,

Thank you. Thank you for writing this book! I just completed it, and am happy to say that I feel strengthened in my understanding of how computers really work. I enjoyed the examples, the humor and the simple, straightforward explanations. It is amazing to see what can be built by combining simple, tangible objects with novel ideas.

Sincerely,
Adam Monsen
-=-=-=-=-=-=-=-=-=-=-=-=-

This book is not for the easily distracted. I had to read over some of the examples many times before I felt like I really "got" them. The effort was well worth it, and I'm glad I discovered this book! If you're ready to dig in and really understand how the computer works, check it out.

This book might be thought of as a "beginner's tutorial to assembly language". Many pages are spent explaining the purpose and fuction of machine language and data.
This book is a fun overview of the evolution of computing as we know it today. Starting with basic building blocks from years past (relays, telegraph, etc.) we move to the present (transistors, ICs). With a little motivation one could build a functional logic computer from the knowledge gained by this book.

The book is written in a very accessible manner, I would recommend it highly to a high school graduate considering pursuing a college career in any electronic engineering discipline.
The readers who've already written reviews have said it all: this book has style and sophistication in textual presentation, as well as visual excellence. From the perspective of a tech writer and one fascinated by the guts of computers-- hardware and software-- you would be doing anyone a favor if you give this book as a gift. If you work through Petzold's circuitry with a child or grandchild, you've given twice.
I am a general reader with 'some' interest in computer programming. I also have 'some' knowledge and interest about almost anything in this world. I found this book when I was looking for a programming related book in our local bookstore. I picked it up since it interested me initially due to its reference to morse code etc. I used to be intrigued by morse code (which I had found in one of my dad's telegraphy books) and used to even use it with a friend while keeping our language a secret.

I must say that I found the book really amazing which is why I am writing the review. I also feel that it should be classified in more of general interest books (the bookstore had it under the software books as I mentioned earlier). I believe there might be other readers with general non-fiction interest who might miss this excellent opportunity just because they were not looking for some software book.

Finally, I want to put a note of appreciation here for whoever designed the cover (I tried looking on the inside jacket). It is amazing while being strikingly simple. That is actually the first thing that caught my attention. Seems like a summary of all the design theories you ever read about. Highest degree of simplicity achieved by conscious thought and effort. Very intellectually provoking.

As a self-taught programmer, I have only ever understood how to make a computer do something with a new-fangled modern high-level language. I sought out a book to help me understand what is going on underneath, and Code does exactly that. The book begins by introducing yesteryear methods for encoding data before the electronic age such as Morse Code and Braille, and walks you through the technological leaps that have occurred since. Telegraph-era hardware is built on the page wire-by-wire until a functional model of a modern computer has been fully constructed. The tedious pains of coding directly into the machine with actual binary input is introduced, and then the advancements of assembly languages, low-level abstract languages, and finally high-level compiled languages. In addition you'll learn how to count and do basic arithmetic in binary and hexadecimal, the history of character encoding, and take your imaginary computer from switch controlled calculator to text operated number cruncher and finally modern GUI operated home computer.

The book is not written as a dry textbook, but rather as if your really smart friend were to sit down and explain the history of computing to your really smart teenager. There are charts of boolean logic gate outputs, binary math tables, and electronic schematics which will likely scare off anyone who isn't seriously interested in learning the details, but the tone of the book is very informal and easy to read, and moves at just the right pace. It doesn't just throw new concepts at you without fully introducing the underpinnings, but it also doesn't spoon-feed the information to you and dwell on any one area too long. Written in 1999, the book dates itself when referring to benchmarks in computing at that point in time, but for those of us who have never seen an IBM punchcard, weren't alive when the Altair 8800 was introduced, and take terabytes of hard drive space for granted, this is an invaluable history lesson that will aid your understanding of everything a computer does.
For years i have been searching for information on how computers really work under the hood. Many text just skimp over the whole process and leave you unfullfilled, but this book, will not let you down. It starts off from the basic or foundation, like the light bulb situation,bits and bytes and develops furthur into stuff like logic- AND and Or Gates and so forth, right down to programming languages and how the translation is made. after reading this book you will look at computers in a different way.
As a CS-major, I learned discrete math, boolean algebra, algorithm, electronics, OS, compiler and many other subjects. All of them are the fundmental and useful knowledge in CS field. In Petzold's book, I was able to build the connections for all of these subjects, and realized the revolution of computer enginnering. After reading it, I'm able to rethink what I've learned before, and got inspirations in problem solving for my current projects.
This book starts at the most basic levels and in clear, understandable fashion explains the inner workings of computers. It's easy to understand but not dumbed-down. Readers should be aware that most of this book focuses on basic computer architecture (e.g. logic gates, bits/bytes, microchips) and how programs work at the machine/assembly language level. After reading it, I feel this was the correct approach -- I'd always wanted a book that explained "how computers work" and to me, this was the ideal introduction.
As the author states, this is not another book of how computers work. I had been looking for a book that explained how a microprocessor does what it does. And with this book I got that and much more. I should also say that this book is good only if you love computers, because otherwise, it would be a little bored, especially because it goes beyond software into hardware and talks a lot about digital electronics and logic gates. But to me, it is very very good and I recommend it to everyone who has a real interest in computers.
Before you take a class on computers, read "CODE". Easy reading considering the underlying complexity of the computer technology. Should be required reading and study in the 21st century high school and for a GED. Concepts flow from Morse code, braille, telegraphy, relay logic, binary logic, one's complement, CPUs, Harvard architecture, Operating Systems, and computer languages.
Wow. Before I read this book, I already knew about logic gates, but I did not know (1) how electric and electonic devices can in the real world perform the function of logic gates and (2) how by arranging logic gates wisely one can perform addition and subtraction and (3) more complicated mathematical operations can be performed by doing "a lot of" additions and subtractions. Now I (kind of) know.

All these are gratifying.

Starting from Chapter 17, however, the speed and depth of the book changes gear quite a bit (at least to me). From that chapter onward, it is about the relatively detailed working of a modern computer - e.g. how integrated circuits (chips) work, what microprocessors are, etc. In Chapter 18, for instance, the author answered the question in the preface: "why can't you run Macintosh programs under Windows?". It is quite rewarding to understand why.

Different readers will have different views towards this book. By profession I am a physician and have no experience in serious computing, so I myself find Chapters 21 and 22 particularly difficult. But overall I think I have learned a lot from this book. Five stars.
This book has a special place in my heart. I started my career working for one of the big box software service companies and the work I was exposed to was of a pretty boring nature i.e. repetitive work with no room for any thought; the focus was on doing things mechanically without understanding what the thing is all about. Moreover, my educational background was mechanical/industrial engg and hence I entered the field without knowing much about the field of computing. So that was my introduction to the field of computing and the combination of these factors was disastrous; soon I lost my interest in the field and I was terribly depressed. Later on I moved to other functional areas (product mgnt, project mgnt, prod mktng etc) thinking that my salvation would be there since I thought I would be able to get a broader view of the problem we are trying to solve (as opposed what I was exposed in the engineering side). After making a few trips along that route I realized my salvation is not going to come from that side either. Along the way I tried to figure it out myself and after going through a lot of introductory books (with explanations in a piecemeal manner which I found to be unsatisfactory) I somehow stumbled on this book...and this is the book that kindled my interest. I have 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 in the dark.

The nice thing about this book is the approach of moving forward in time from 1850's or so onwards to the end of 20th century, starting from simpler technologies and progressively moving to complicated ones. The author starts with an explanation about morse code, braille system, telegraphs (and even a primer on electricity), number system, boolean logic before moving onto to logic gates, half adders, full adders, doing subtraction, edge triggered flip flops and more. All the components and ideas that form part of the hierarchical abstraction of the machine is explained in minute details. I remember spending a lot of time thinking up many circuits using the concept of logic gates described here. The chapters on memory, automation and microprocessors is simply brilliant and the detailed sketches of the varying states of these components makes it very easy to comprehend. Towards the end of the book the author seem to increase the pace a bit and the final chapters such as operating system and graphical revolution does not seem to have the same kind of magic that the middle ones had. I suspect the author was wary of making the book too huge and thereby losing the interest of the reader.

This book is targeted at someone who truly wants to have an understanding of computers, i.e. if you believe that software, hardware, processors, network, high level, low level, etc etc cannot be looked upon as isolated silos, then this book is for you.






Want to know how computers work -- like, really? Petzold's book explains it all, tracing the evolution of computer circuitry from the telegraph to the machines we know today, in intricate detail. Heavy on electrical engineering (which was great for me, with my relative ignorance of it), and a fun, if somewhat thick, read -- Mr. Wizard for computer nerds, you might say.

I've heard the words "labor of love" used to describe this book. The description fits perfectly. Highly recommended.
This is a great read for anyone who, like myself, is involved with computers, but never took computer science classes.

Parts of the book were very detailed, and I ended up skimming over them (a few parts from chapter 17 on). This is no fault of the author, but the nature of the subject is very complex. This didn't impair my overall comprehension of the concepts in the book...I'll re-read the difficult parts in time.

Overall, I highly recommend this book. My goal was to fill in the gaps in my computer science knowledge, and the book met that goal to my satisfaction.

I debated whether to give this 4 or 5 stars...I'd probably have gone with 4.5 if that option was available. The book gets off to a bit of a slow start, and I thought it could have used some more information on networking and modern computing. But for the price of the book and the clarity of the information, I'll give it 5 stars. Outstanding value.

Saying it's about "how a computer works" is an understatement. The most interesting computer science/engineering book I've ever read. I was completely hooked by about the time the author spent a few chapters teaching me how to count. Wonderful.
This is the best introduction to the fundamental concepts behind computer science that I've ever read. That said, I'm not talking about a textbook for a Master's level Comp Sci treatment - but this IS the most complete, well-written, and accessible treatment of the subject that I know of. If I were trying to introduce a reasonably intelligent individual to these concepts, I'd not hesitate to direct them to this volume.
There are plenty of reviews extolling the virtues of this book. Instead of repeating what has been said, I just want to say that even though Code was published in 1999, it is not at all out of date.

Sure, there are a few places where Petzold mentions specific numbers such as the current price of RAM, typical hard drive sizes etc. Of course those numbers are out of date 12 years later. But those numbers are not at all essential to the story. Even though computers have become faster, smaller, and more ubiquitous since 1999, they still work the same way.

If you want to understand computers, this book is just as relevant now as it was in 1999.
This is probably the most useful book on computing I've ever read. Yes books on assembly language and higher level languages such as C/Perl/Python are more immediately practical but working through this book will completely demystify concepts such as memory segments, integer arithmetic, pointers, so forth and so on that have to be accepted "at face value" if you only deal with them at more abstract levels. Which, considering that the book begins with a discussion of circuits at the electron level, is pretty much machine code on up.

One suggestion: use a simulator such as LogiSim and take the time to work through the circuits the author presents in the text. As well as the discussion - I found it added to the interest of the book to work out, as exercises, modifications to circuits the author describes in words but does not depict fully in the form of circuits. It's also gratifying to use LogiSim to catch the author occasionally oversimplifying matters as with his discussion of the simplified adder (kindle location 4836), which does not work correctly as the author presents it - but the reader CAN make it work with a bit of time and thought.:)

Good stuff.
This book gives a bottom-up, in depth explanation of how an electromechanical computer might work. It explains what a relay is and how it can be used to implement the logic circuitry of a digital computer. Beginning with AND and OR gates, it ends with a Turing complete computer. Beautiful!

The remaining two thirds of the book I was just skimming through. From countless other books I already know about number bases and ASCII, for instance.

In the last chapters the author tries to cram just about everything else that could be mentioned about computers. This leads to a few errors (like "Unicode is 16 bits", a widely held misconception) [edit: I since discovered that this was actually true back in the early 90's when this book was written. Sorry, Mr. Petzold!] and several explanations way too short to convey significant content. On two pages (376 and 377) Petzold covers compression, (lossy and reversible), something called "metafiles" (dunno what that is), OCR, digitized sound and CDs, microphones, ADCs, DACs...

Instead if this, I would have liked the gory details on how vacuum tubes, transistors and integrated chips actually work. What exactly in the CPU in my laptop does the same work as the relays in the early chapters? How can current from one circuit block or amplify current from another?

I still don't know how my computer works, but after reading this book, at least I know how an electromechanical computer might work.
When I first got this book it was required reading for an entry level computer science course, we learned everything that this book talks about but I didn't quite get "why" we were being taught all these things. I made it about half-way through the book and felt it was pretty silly and boring. It was talking about logic gates and using them to buy a cat from the pet store, neutered, female, gray, and all this other stuff that in my mind had nothing to do with computers.

It wasn't until about a year later I picked up this book again and began reading more and more computer science and programming related books. Once I started reading this again I wanted to find out what happens towards the end. And realize why I was taught different number systems and logic gates back in that entry level course. It wasn't until about chapter 17 where I realized what all of it had been leading up to and it was pretty awesome. The following chapters were quite interesting but I felt too short. It felt like all the good stuff was in the last 100 pages or so.

I think Petzold wrote this book so that anyone could understand code and how computers work. So if you're already a computer science person the early stuff might seem a bit boring and repetitive, but once you get to the end it will all make sense. I'm glad I did go back and read it again, because the first time through I never got that far. I think it was mainly because I was focused on passing all my classes and this book was more of an extension of the class and not a requirement to read it. I'd recommend this book to anyone vaguely interested in how computers work, or anyone in the computer science or programming fields. It's really useful to understand exactly what's going on when you are programming. And this book essentially explains how you could build your own computer and know exactly how it works.
I recall the book being split into three parts:

The first third of this book is a crash-course in various "codes" used for communicating -- Morse code, Braille, and eventually Binary/Octal/Decimal/Hexadecimal. The author simply explains how to communicate messages using only 2 signals (on/off). This

The second third of the book delves into the history of computing, automated machinery, using electrical signals to convey messages (starting with the telegraph), and eventually working up to "Switches" -- the basic building block of a computers. From there, the author explains, very slowly and clearly, how to build a rudimentary computer. Even if you are not interested in the logical diagrams of circuits, you could easily skip past these sections and still find a wealth of information in the book.

In the third part of the book, after building our basic computer, the author goes into Processors: when they were popular and mass-produced, how people programmed with them, what each chip does, etc. The author explains how newer computers had different processors, and how the x86 chip is still commonly used in PCs today. The author also explains how advances in technology are trending.

The book is a little dated -- my edition was only current up to the year 2000. However, not much has changed in how a computer is made and powers itself on since 2000. This is a must-read for anyone interested in being a programmer or computer electrical engineer. It's also vital for anyone who really wants to know how a computer works.
I wanted to write a review for this book for the past few weeks, but held off until I finished reading it completely, in case there was some disappointment at the end. Thankfully that is not the case - the book is excellent from start to finish.

You can see the amount of love and care that the author has put into this work. From the easy to read font, thought-out diagram and image layouts that never make you flip-back the pages - to the excellent teaching-like style with which the author gradually tackles the topic. It is amazing. I found myself holding off reading too much of the book at once, because I wanted to prolong the pleasure!

I recommend this book to anyone. The first seven or eight chapters should be accessible to anyone, regardless of their technical background, and are alone worth the price of the book. This book should be enjoyed from start to finish, just like a novel. Unlike a novel this book not only provides the reader with the pleasing reading experience, but also with some very useful lessons and fundamentals.

I like the author's approach so much that I have purchased his next book "The Annotated Turing". I will post my impressions of that when I am done.
How come I never read this book when I was an undergraduate in electrical engineering major during 1999-2001? Just beat me! I took the liberty to write the review specifically for students majoring in computer science and electrical engineering.

Now a day, the computers are so prevalent and seem so complex that we think it is a complicated machine, but it's quite the opposite. This book beautifully explains it and keeps a perfect balance with historical perspective.

Most textbooks on logic design and electronics do not teach the historical motivation why things in computer came into beings as such, but this book does. For example, it explains why the binary system was such an essential idea for computer revolution. At the time people were still trying to use decimal system to create the computing machines.

Not only you get the historical motivation why computer came into being, but you also get the thought process. On the way you learn how UPC code works? How relay works? How digital electronics work? How logic gates work? How logic gates are combined to form more complex subsystem such as Multiplexor, Decoder, Adder, Subtractor, RAM. And ultimately, how computers hardware and software works? All this is done in a clear and lucid manner and just the right tone.

You continue your journey through how computer represent computer graphics, floating point arithmetic and operating system. This book also touches on why high-level languages are required.

In conclusion, you get basic essential engineering concepts that are required in future and more advanced courses in an absolute clear manner which, in my opinion, is unmatched by any other book on computer fundamentals.
I found this book very well written. Easy to understand descriptions of fairly complex concepts. So many of us use computers today and we have no idea how we got here. If you'd like a concise walk through history and an undersntanding of what a computer is doing under the keyboard, this is a great read.
This book was recommended to me by Steve Gibson in the Security Now! podcast during listener feedback episode 242 ([...]). This book is absolutly great. Petzold Starts with the bare basics of binary code explained with everyday examples such as Morse code and Braille, then goes into electricity, then Boolean logic, and slowly takes you into Logic gates and beyond. The book is easy to follow with lots of diagrams that are easy to understand. Anyone with a high school education who has taken Algebra and physical science (and passed)should be able to follow along. Be warned, you may have to read some sections twice, some of the information is pretty heavy, but don't get discouraged. It is a little dated, the book was printed in 1999, so some of the examples are a little old (like movies and music on magnetic tape, 32 Megs of ram on a computer) but the principles remain the same. This book is an excellent introduction into the inner workings of a computer and is a must read for anyone going into computer science, computer programing, or IT as it give the underlying fundamentals to understanding how these machines work in a world that takes them for granted.
A talented computer programmer I crossed paths with said, "My dad is an electrical engineer, but I never really understood electricity. After I read this book, I called him and said, 'Dad, I finally understand what you've been saying about electricity all these years.' "
Intrigued, I bought this book for myself and for my teenage son, and halfway through the first chapter I knew it was the book I've been looking for for more than a decade. Actually, it is two in one. All the promotional material about the book tells how it explains computers and technology; it does that beautifully, creatively. But more than that, it explains what my 13-year-old engineer-in-the-making son calls the "invisible magic," which is electricity.
I am an editor, and I would go on record as saying this is one of the best written, most inventively written books that I have ever come across. The night I gave it to my son (at 10 p.m.), he began devouring it. At 8 a.m. the next morning, he was already on Chapter 3, and he took it to school with him.
I give my thanks to the author for going to the effort to write the book and get it published.

Even though this book was published almost a decade ago, it is a wonderful, fascinating read. If you have ever wondered about the codes (broadly speaking) that make computer hardware and software work the way they do, how the many inventions of mankind that have made our lives more productive work, read this book. The fact that it was printed in 2000 did not stop me from buying it. I was initially intrigued by the title and after reading a few pages, I decided it is a book I MUST have for my personal library. Three chapters caught my eyes particularly: Chapter 3 - Braille and Binary Codes. You could not find a better chapter/book on Braille and how it came about. Chapter 18 - From Abaci to Chips. Here you will find a great account of the evolution of the calculating machine, from abacus to the modern calculator. (being Chinese, I learned how to use abacus from my dad/and in school) Finally, the last chapter. Chapter 25 - The Graphical Revolution. As someone who is not a technie but someone into art/photography, this chapter is priceless, it takes the reader from the very beginning of computing, the evolution of how graphical information is presented, CRT, TV, GUI, Vector and Raster graphics, jpegs, gifs. I am so pleased to have bought the book. Highly recommended.
I'm currently a hobbyist programmer and computer enthusiast who plans to move to professional. I play mostly with C, and Python but have recently been dipping into Assembly.

This book provided me with the underlying foundation of how and why a computer works. If I had one phrase to describe this book it would be "de-black magic computers". The knowledge it provided has been fundamental in my diving into deeper parts of assembly, C and computers in general.

I absolutely loved this book and would recommend it to anyone who wished to understand what is actually happening inside of a computer. If you have a geeky or semi-geeky teenager this book provides a great method of letting them truly understand computers.
This is one of the best books I have ever read!! This author is absolutely brilliant!! I would suggest any person going into electrical engineering or computer engineering, more for electrical engineers who want to understand digital systems this book is it. In every book there is always a couple pages explaining what is happening intuitively. This entire book is that. He explains exactly how computers got to be, and really electronics and digital systems. He exlpains flip flops, relays, and how to go from boolean algebra to digital logic better than anything I have ever read, even better than dare I say Mims and Malvino. This is so good it is scary. Please read!!!! He also explains the entire computer history, and you really get a good appreciation of how brilliant some people really are. This author also has two other books that are really best sellers. He ties in so many different ideas and explains things so simply. His starting off with the telegraph and moving from there is amazing. This author is extremely gifted in writing. One of the best books I have ever read.
From turning on a flash light to coding, this book covers all history in programming in a very interesting way. This is not a book tell you how computer works. It is a story about how we get there. This one is a must-read for people interested in computer science and computer engineering.
As a merchant marine officer for many years I always enjoyed using a sextant and calculating some formulas to determine my position on the face of the earth to within a half mile. It just seemed like magic until one day I sat down and really thought about what was happening when I used a sextant and calculated these formulas, and finally it all made sense. I could see how there was a logical method to what initially seemed like magic. This book will reveal a similar enlightenment to the reader who feels that computers are magic (as I did). My only beef is that the book did not have a comprehensive index. That would have certainly been a big plus because I can see myself referring to this book in the future. Also, I kept waiting for an explanation of how a million transistors can fit onto a single silicon chip and it never came. Guess I'll have to find another book to explain that bit of "magic". But I recommend the book for anyone, neophyte or professional.
This book was absolutely excellent. It is quite possibly the only book of its kind, as it combines an easily understandable style with a highly technical subject. Petzold explains not only the workings of a simple processor, but also the history of its design and the theory behind it. For anyone who wants to learn how a microprocessor works without buying a college text, this is the book to buy.
"Code" is a well-written, easy to follow and compelling book on technology in general. The book focuses on how, over time, the manner in which technology has changed how data and information are processed.

Through highly illustrative examples and well-crafted illustrations, Charles Petzold has written an excellent book that should appeal to anyone with an interest in technology.
This book is a page-turner. You literally can't put it down. Which is utterly amazing considering it is non-fiction! I am a master's candidate in Computer Science and I learned a great many things. Yet, the language and approach are so accesible that anyone who's graduated high school has more than enough technical background to comprehend the information presented. If you are at all interested in computers or digital media, you simply have to buy this book.
 
Share your thoughts with other customers
Create your own review