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 Petzolds 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. Youll discover what fl ashlights, 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, 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. Along with new chapters, Petzold has created a new website, CodeHiddenLanguage.com, that uses animated interactive graphics to make computers even easier to comprehend.

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


Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Contents
  5. Preface to the Second Edition
  6. Pearson’s Commitment to Diversity, Equity, and Inclusion
  7. About the Author
  8. Definition of Code
  9. Chapter One. Best Friends
  10. Chapter Two. Codes and Combinations
  11. Chapter Three. Braille and Binary Codes
  12. Chapter Four. Anatomy of a Flashlight
  13. Chapter Five. Communicating Around Corners
  14. Chapter Six. Logic with Switches
  15. Chapter Seven. Telegraphs and Relays
  16. Chapter Eight. Relays and Gates
  17. Chapter Nine. Our Ten Digits
  18. Chapter Ten. Alternative 10s
  19. Chapter Eleven. Bit by Bit by Bit
  20. Chapter Twelve. Bytes and Hexadecimal
  21. Chapter Thirteen. From ASCII to Unicode
  22. Chapter Fourteen. Adding with Logic Gates
  23. Chapter Fifteen. Is This for Real?
  24. Chapter Sixteen. But What About Subtraction?
  25. Chapter Seventeen. Feedback and Flip-Flops
  26. Chapter Eighteen. Let’s Build a Clock!
  27. Chapter Nineteen. An Assemblage of Memory
  28. Chapter Twenty. Automating Arithmetic
  29. Chapter Twenty-One. The Arithmetic Logic Unit
  30. Chapter Twenty-Two. Registers and Busses
  31. Chapter Twenty-Three. CPU Control Signals
  32. Chapter Twenty-Four. Loops, Jumps, and Calls
  33. Chapter Twenty-Five. Peripherals
  34. Chapter Twenty-Six. The Operating System
  35. Chapter Twenty-Seven. Coding
  36. Chapter Twenty-Eight. The World Brain
  37. Index
  38. Colophon
  39. Code Snippets