Code
Charles Petzold

Code

supplementals

20 highlights

The thicker a wire, the lower the resistance it has. This may be somewhat counterintuitive. You might imagine that a thick wire requires much more electricity to “fill it up.” But actually the thickness of the wire makes available many more electrons to move through the wire.

Current is related to the number of electrons actually zipping around the circuit. Current is measured in amperes, named after André Marie Ampère (1775–1836), but everybody calls them amps, as in “a 10-amp fuse.” To get one amp of current, you need 6,240,000,000,000,000,000 electrons flowing past a particular point per second.

The key word here is two. Two types of blinks, two vowel sounds, two different anything, really, can with suitable combinations convey all types of information.

The earth is to electrons as an ocean is to drops of water. The earth is a virtually limitless source of electrons and also a giant sink for electrons.

Voltage refers to a potential for doing work. Voltage exists whether or not something is hooked up to a battery.

During storms, the bottoms of clouds accumulate electrons while the tops of clouds lose electrons; eventually, the imbalance is evened out with a stroke of lightning. Lightning is a lot of electrons moving very quickly from one spot to another.

In this book, the word code usually means a system for transferring information among people and machines. In other words, a code lets you communicate. Sometimes we think of codes as secret. But most codes are not. Indeed, most codes must be well understood because they’re the basis of human communication.

Morse code is said to be a binary (literally meaning two by two) code because the components of the code consist of only two things—a dot and a dash.

What might have helped Babbage, we know now, was the realization that perhaps instead of gears and levers to perform calculations, a computer might better be built out of telegraph relays. Yes, telegraph relays.

In the computer age, the bit has come to be regarded as the basic building block of information.

The + symbol in Boolean algebra means a union of two classes. A union of two classes is everything in the first class combined with everything in the second class. For example, B + W represents the class of all cats that are either black or white.

The relay is a remarkable device. It’s a switch, surely, but a switch that’s turned on and off not by human hands but by a current. You could do amazing things with such devices. You could actually assemble much of a computer with them.

These codes alter the meaning of the codes that follow them—from letters to numbers and from numbers back to letters. Codes such as these are often called precedence, or shift, codes. They alter the meaning of all subsequent codes until the shift is undone.

The number of electrons in an atom is usually the same as the number of protons. But in certain circumstances, electrons can be dislodged from atoms. That’s how electricity happens.

Hydrogen, oxygen, sodium, and chlorine are all elements. Water and salt are called compounds. Salt water, however, is a mixture rather than a compound because the water and the salt maintain their own properties.

As long as the switch is closed, the metal contact goes back and forth—alternately closing the circuit and opening it—most likely making a sound. If the contact makes a rasping sound, it’s a buzzer. If you attach a hammer to it and provide a metal gong, you’ll have the makings of an electric bell.

The prevailing scientific wisdom regarding the workings of electricity is called the electron theory, which says that electricity derives from the movement of electrons.

The number system we use today is known as the Hindu-Arabic or Indo-Arabic. It’s of Indian origin but was brought to Europe by Arab mathematicians.

The chemicals in batteries are chosen so that the reactions between them generate spare electrons on the side of the battery marked with a minus sign (called the negative terminal, or anode) and demand extra electrons on the other side of the battery (the positive terminal, or cathode). In this way, chemical energy is converted to electrical energy.

Sometime around 1948, the American mathematician John Wilder Tukey (born 1915) realized that the words binary digit were likely to assume a much greater importance in the years ahead as computers became more prevalent. He decided to coin a new, shorter word to replace the unwieldy five syllables of binary digit. He considered bigit and binit but settled instead on the short, simple, elegant, and perfectly lovely word bit.