Chapter One
You’re 10 years old. Your best friend lives across the street. The windows of your bedrooms actually face each other. Every night, after your parents have declared bedtime at the usual indecently early hour, you still need to exchange thoughts, observations, secrets, gossip, jokes, and dreams. No one can blame you. The impulse to communicate is, after all, one of the most human of traits.
While the lights are still on in your bedrooms, you and your best friend can wave to each other from the windows and, using broad gestures and rudimentary body language, convey a thought or two. But more sophisticated exchanges seem difficult, and once the parents have decreed “Lights out!” stealthier solutions are necessary.
How to communicate? If you’re lucky enough to have a cell phone at the age of 10, perhaps a secret call or silent texting might work. But what if your parents have a habit of confiscating cell phones at bedtime, and even shutting down the Wi-Fi? A bedroom without electronic communication is a very isolated room indeed.
What you and your best friend do own, however, are flashlights. Everyone knows that flashlights were invented to let kids read books under the bed covers; flashlights also seem perfect for the job of communicating after dark. They’re certainly quiet enough, and the light is highly directional and probably won’t seep out under the bedroom door to alert your suspicious folks.
Can flashlights be made to speak? It’s certainly worth a try. You learned how to write letters and words on paper in first grade, so transferring that knowledge to the flashlight seems reasonable. All you have to do is stand at your window and draw the letters with light. For an O, you turn on the flashlight, sweep a circle in the air, and turn off the switch. For an I, you make a vertical stroke. But, as you quickly discover, this method is a disaster. As you watch your friend’s flashlight making swoops and lines in the air, you find that it’s too hard to assemble the multiple strokes together in your head. These swirls and slashes of light are just not precise enough.
Perhaps you once saw a movie in which a couple of sailors signaled to each other across the sea with blinking lights. In another movie, a spy wiggled a mirror to reflect the sunlight into a room where another spy lay captive. Maybe that’s the solution. So you first devise a simple technique: Each letter of the alphabet corresponds to a series of flashlight blinks. An A is 1 blink, a B is 2 blinks, a C is 3 blinks, and so on to 26 blinks for Z. The word BAD is 2 blinks, 1 blink, and 4 blinks with little pauses between the letters so you won’t mistake the 7 blinks for a G. You’ll pause a bit longer between words.
This seems promising. The good news is that you no longer have to wave the flashlight in the air; all you need do is point and click. The bad news is that one of the first messages you try to send (“How are you?”) turns out to require a grand total of 131 blinks of light! Moreover, you forgot about punctuation, so you don’t know how many blinks correspond to a question mark.
But you’re close. Surely, you think, somebody must have faced this problem before, and you’re absolutely right. With a trip to the library or an internet search, you discover a marvelous invention known as Morse code. It’s exactly what you’ve been looking for, even though you must now relearn how to “write” all the letters of the alphabet.
Here’s the difference: In the system you invented, every letter of the alphabet is a certain number of blinks, from 1 blink for A to 26 blinks for Z. In Morse code, you have two kinds of blinks—short blinks and long blinks. This makes Morse code more complicated, of course, but in actual use it turns out to be much more efficient. The sentence “How are you?” now requires only 32 blinks (some short, some long) rather than 131, and that’s including a code for the question mark.
When discussing how Morse code works, people don’t talk about “short blinks” and “long blinks.” Instead, they refer to “dots” and “dashes” because that’s a convenient way of showing the codes on the printed page. In Morse code, every letter of the alphabet corresponds to a short series of dots and dashes, as you can see in the following table.
Although Morse code has absolutely nothing to do with computers, becoming familiar with the nature of codes is an essential preliminary to achieving a deep understanding of the hidden languages and inner structures of computer hardware and software.
In this book, the word code usually means a system for transferring information among people, between people and computers, or within computers themselves.
A code lets you communicate. Sometimes codes are secret, but most codes are not. Indeed, most codes must be well understood because they’re the basis of human communication.
The sounds we make with our mouths to form words constitute a code that is intelligible to anyone who can hear our voices and understands the language that we speak. We call this code “the spoken word” or “speech.”
Within deaf communities, various sign languages employ the hands and arms to form movements and gestures that convey individual letters of words or whole words and concepts. The two systems most common in North America are American Sign Language (ASL), which was developed in the early 19th century at the American School for the Deaf, and Langue des signes Québécoise (LSQ), which is a variation of French sign language.
We use another code for words on paper or other media, called “the written word” or “text.” Text can be written or keyed by hand and then printed in newspapers, magazines, and books or displayed digitally on a range of devices. In many languages, a strong correspondence exists between speech and text. In English, for example, letters and groups of letters correspond (more or less) to spoken sounds.
For people who are visually impaired, the written word can be replaced with Braille, which uses a system of raised dots that correspond to letters, groups of letters, and whole words. (I discuss Braille in more detail in Chapter 3.)
When spoken words must be transcribed into text very quickly, stenography or shorthand is useful. In courts of law or for generating real-time closed captioning for televised news or sports programs, stenographers use a stenotype machine with a simplified keyboard incorporating its own codes corresponding to text.
We use a variety of different codes for communicating among ourselves because some codes are more convenient than others. The code of the spoken word can’t be stored on paper, so the code of the written word is used instead. Silently exchanging information across a distance in the dark isn’t possible with speech or paper. Hence, Morse code is a convenient alternative. A code is useful if it serves a purpose that no other code can.
As we shall see, various types of codes are also used in computers to store and communicate text, numbers, sounds, music, pictures, and movies, as well as instructions within the computer itself. Computers can’t easily deal with human codes because computers can’t precisely duplicate the ways in which human beings use their eyes, ears, mouths, and fingers. Teaching computers to speak is hard, and persuading them to understand speech is even harder.
But much progress has been made. Computers have now been enabled to capture, store, manipulate, and render many types of information used in human communication, including the visual (text and pictures), the aural (spoken words, sounds, and music), or a combination of both (animations and movies). All of these types of information require their own codes.
Even the table of Morse code you just saw is itself a code of sorts. The table shows that each letter is represented by a series of dots and dashes. Yet we can’t actually send dots and dashes. When sending Morse code with a flashlight, the dots and dashes correspond to blinks.
Sending Morse code with a flashlight requires turning the flashlight switch on and off quickly for a dot, and somewhat longer for a dash. To send an A, for example, you turn the flashlight on and off quickly and then on and off not quite as quickly, followed by a pause before the next character. By convention, the length of a dash should be about three times that of a dot. The person on the receiving end sees the short blink and the long blink and knows that it’s an A.
Pauses between the dots and dashes of Morse code are crucial. When you send an A, for example, the flashlight should be off between the dot and the dash for a period of time equal to about one dot. Letters in the same word are separated by longer pauses equal to about the length of one dash. For example, here’s the Morse code for “hello,” illustrating the pauses between the letters:
Words are separated by an off period of about two dashes. Here’s the code for “hi there”:
The lengths of time that the flashlight remains on and off aren’t fixed. They’re all relative to the length of a dot, which depends on how fast the flashlight switch can be triggered and also how quickly a Morse code sender can remember the code for a particular letter. A fast sender’s dash might be the same length as a slow sender’s dot. This little problem could make reading a Morse code message tough, but after a letter or two, the person on the receiving end can usually figure out what’s a dot and what’s a dash.
At first, the definition of Morse code—and by definition I mean the correspondence of various sequences of dots and dashes to the letters of the alphabet—appears as random as the layout of a computer keyboard. On closer inspection, however, this is not entirely so. The simpler and shorter codes are assigned to the more frequently used letters of the alphabet, such as E and T. Scrabble players and Wheel of Fortune fans might notice this right away. The less common letters, such as Q and Z (which get you 10 points in Scrabble and rarely appear in Wheel of Fortune puzzles), have longer codes.
Almost everyone knows a little Morse code. Three dots, three dashes, and three dots represent SOS, the international distress signal. SOS isn’t an abbreviation for anything—it’s simply an easy-to-remember Morse code sequence. During the Second World War, the British Broadcasting Corporation prefaced some radio broadcasts with the beginning of Beethoven’s Fifth Symphony—BAH, BAH, BAH, BAHMMMMM—which Beethoven didn’t know at the time he composed the music would someday be the Morse code for V, for Victory.
One drawback of Morse code is that it doesn’t differentiate between uppercase and lowercase letters. But in addition to representing letters, Morse code also includes codes for numbers by using a series of five dots and dashes:
These number codes, at least, are a little more orderly than the letter codes. Most punctuation marks use five, six, or seven dots and dashes:
Additional codes are defined for accented letters of some European languages and as shorthand sequences for special purposes. The SOS code is one such shorthand sequence: It’s supposed to be sent continuously with only a one-dot pause between the three letters.
You’ll find that it’s much easier for you and your friend to send Morse code if you have a flashlight made specially for this purpose. In addition to the normal on-off slider switch, these flashlights also include a pushbutton switch that you simply press and release to turn the flashlight on and off. With some practice, you might be able to achieve a sending and receiving speed of 5 or 10 words per minute—still much slower than speech (which is somewhere in the 100-words-per-minute range), but surely adequate.
When finally you and your best friend memorize Morse code (for that’s the only way you can become proficient at sending and receiving it), you can also use it vocally as a substitute for normal speech. For maximum speed, you pronounce a dot as dih (or dit for the last dot of a letter) and a dash as dah, for example dih-dih-dih-dah for V. In the same way that Morse code reduces written language to dots and dashes, the spoken version of the code reduces speech to just two vowel sounds.
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.