Quick viewing(Text Mode)

Binary Codes 27

Binary Codes 27

.rrdlrtcr -Iit4,

Fortunately,we don'.have to actuaily write out ail the possibrec.des t, determinehow many therewould r". att to do is murtipry2 by itserf over and over again. -.i"r. Morse is said a-.!#at#Ft-' to be a binary (literally meaning tuo becausethe components by two) code of thecode';il;;? .,tyt.'"r iirirgr'-"-i", a dash'That' similar to a coin, ChapterThree which canland only on the headside or "ra tail side'Binary objects (such the ascoinrl rlrr"ry (such tutorr..oa.) are alwaysdescribed by powers of two."rrJ ", vl"' we're doing by,anaryzing , binarycodes is a simpleexercise in rhe branchof mathematicsknown or combinotirii' orotyr*. Tiaditionally,combinatoriar ^t1o*biiotirics analysisir oftenin ,rr. ri.il or prou- ability and statisticsbecause it involves"t. -o* Brailleand .t..-inirrg rrr. rru-u., oi*", trr", things,like coinsand dice, canbe.r-bi;;;.;ut it arsohelps us understand how codescan be put together r"t." ""a "plrr. BinaryCodes .-A{*?+ff:.

amuel Morse wasn't the first person to successfullytranslate the let- ters of written languageto an interpretablecode. Nor was he the first person to be rememberedmore as the name of his code than as him- self.That honor must go to a blind Frenchteenager born some 18 yearsafter but who made his mark much more precociously.Little is known of his life, but what is known makes a compelling story. Louis Braillewas born in 1809 in Coupvra5 ,iust 25 miles east of . His father was a harnessmaker. At the age of three-an age when young boys shouldn't be playing in their fathers' workshops-he accidentally stuck a pointed tool in his eye. The wound becamein- fected,and the infection spreadto his other eye, leaving him totally blind. Normally he would have been doomed to a life of ignorance and poverty (asmost blind people were in those days), but young Louis's intelligence and desireto learn were soon recognized.Through the intervention of the village priest and a schoolteacher,he first attended school in the village with the other children and at the age of 10 was sent to the Royal Institution for Blind Youth in Paris.

15 ( )hapter 'I'bree nrdllle dnd nrndry r,(r(fft

'l'hc one major obstaclein the educationof the brind is, of course,their in- dots withirr :r two-by-thrccccll. dotsof thc cellarc commonlynumbered a.bility to read printed books. Valentin Hany e74s-rg2z), the founder of I thror.rgh6: the Paris school, had invented a systemof raised letters on paper that could be read by touch' But this systemwas very difficult to ur., and only a few rOO+ books had been produced using this method. zOOs The sighted Haiiy was stuck in a paradigm. To him, an A was an A was an A, and the letter A.must look (or feel) like an A. (If given a flashlight to :oos communicate, he might have tried drawing letters in the air as * did be- fore we discoveredit didn't work very weil.; Hatiy probably didn't realize In modern-day use, specialtypewriters or embosserspunch the dots that a type of code quite different from the printed might be more into the paper. appropriate for sightlesspeople. Becauseembossing just a couple pagesof this book in Braillewould be The origins of an alternative type of code came from an unexpected prohibitively expensive,I've used a notation common for showing Braille source. , a captain of the French army had by 1g1,9devised on the printed page.In this notation, all six dots in the cell are shown. Large a system of writing he called 1criture nocturne, or ".,' This dots indicate the parts of the cell where the paper is raised. Small dots indi- system used a partern of raiseddots and dasheson heavy paper and was cate the parts of the cell that are flat. For example, in the Braille intended for use by soldiersin passingnotes to each other in'the dark when quiet-was necessary.The soldiers were able to poke these dots and dashes into the back of the paper using an awl-like stylui. The raiseddots could then !i be read with the fingers. The problem with Barbier's systemis that it was quite complex. Rather dots 1, 3, and 5 are raisedand dots 2,4, and 6 are not. than 'u7hat using patterns of dots and dashesthat correspondedto letters of the should be interesting to us at this point is that the dots are binary. alphabet,Barbier devisedparterns rhat corresponded'tosounds, often requir- A particular dot is either flat or raised.That meanswe can apply what we've ing many codes for a single word. The ryrt.- worked fine for shorr mes- learned about and combinatorial analysisto Braille. We know sagesin the field bur was distinctly inadequate for longer texts, let alone that there are 5 dots and that eachdot can be either flat or raised,so the total entire books. of combinations of 5 flat and raised dots is2 2 x 2 x 2 x 2 x 2, or becamefamiliar with Barbier's systemat the age of 12. He 26,or 64. liked the useof raised dots, not only becauseit pioved easyto rlad with the Thus, the system of Braille is capable of representing54 unique codes. fingers but also becauseir was easy to tarite. A student in the classroom Here they are-all 54 possible Braille codes: equipped with paper and a stylus could actually take notes and read them back. .a Louis Braille diligently tried to improve th. ,yrt.- and within three years (at :: :? the age of 15) had come up with his own, rhe basicsof which are still used today. For many years, th. ryrt.. was known only within aa ?: ?: the :: :: .a .a yh99l' but it gradually made its way to the rest of the world. In 1g35, Louis .a .a .a Braille contracted ruberculosis, which a. a. a' would eventually kill him shortiy after :? .a .a his 43rd birthday in 1852. aa aa a. aa Today, o. aa a. a' enhanced versions of the Braille system compete with tape- .a .a reco.rded_booksfor providing the blind with accessto the written word, but .a ,. Braille .a .a :? still remainsan invaluable systemand the only way to read for people a. o. a. aa who are both blind and deaf. In recent years, aa a. aa aa a. oa Brailie has becomemore fa- .a ,a .a .a miliar in the public arena as elevatorsand automatic teller machines are made ;. a. a. aa aa aa more accessibleto the blind. .a .o .a .a 's7hat a. aa aa a. aa oa we're going to do in this chapter is dissectBraille a. a. a' aa aa aa 'we code and seehow it works. don't aa a. aa aa o. oa have to actually rearn Braire or memorize anything. we a. aa ao a. aa aa o. o. a. aa aa aa just want some insight into the nature of codes. In Braille' . every used in normal written -specificallS letters,, and marks-is encoded on. or more raised "r ( .l,,tl,l(r I t,r(( llr,ttllt ,tnl lltn,trt' ( ttlts lv

If we find fewerthan 54 codcsusctl in Braille,we 'ulcl qrcsri()' why ao aa a ao oa o. .a .a :: :. .a :: :: ?: :? ?: ?: some of the 64 possiblecodes aren't being used.If we find nnrc th^n 64

codesused in Braille,we should questioneither our sanity or fundamental (rtonc ) hut eiln d0 cvery fftrnr go have (none) just truths of mathematics,such as 2 plus 2 equaling4. To begin dissectingthe code o o. ao oa a. ao aa a. 'a .o of Braille, let's look at the basiclowercase a. 'a 'a a. oa oa o. O' alphabet: o. o. a. a. a. a' a. o. a. a' knowledge likc more not (none) people quite rather so that

o. a' oo oo a. oo aa o. .o .a :: :: :: :? :: ?: :: ?: :: :: o. o. oa oa o. ao oa a. .o .a o. .o .a a' aa oa o. aa aa oa oo aa aa ao oa aa aa ao abcdefghiy us very rr you as and for of the with

a. o. ao oa a. aa ao a. .o ,o a. .a .a o. aa ao a. ao a. o. o. a' a. a. o. a. a. a. Thus, the phrase"you and me" can be written in Grade 2 Braille as this: klmnopqrsr

oa oa aa a' .a a. ,. .o a. a. oa aa a. oa oa a. . a. 'a .a oa aa aa oa oa

uvxyz So far, I've described31 codes-the no-raised-dotsspace between words and the 3 rows of 10 codesfor letters and words. We're still not closeto the For example,the phrase"you and me" in Braille looks like this: 64 codesthat are theoretically available. In Grade 2 Braille, as we shall see, nothing is wasted.

oa a' o. a. aa aa ao a. First, we can use the codesfor lettersa through combined with a raised .o .a . . .o .o .o i ao o. ao ' o. a. dot 5. These are used mostly for contractions of letters within words and also include u and another word abbreviation: Notice that the cells for each letter within a word are separatedby a little of space;a larger space(essentially a. a. aa oa o. aa oa o. .a .a a cell with no raised dots) is used o. .o .a a. aa aa a. ao between words. .a .a 'a .o .a .a .a .a .a .a This is the basisof Braille as Louis Brailledevised it, or at leastas it ap- gh sh th wh ed er ouoww plies to the letters of the . Louis Braille also devisedcodes for (or "will") letterswith accentmarks, common in French.Notice that there'sno code for , which isn't usedin classicalFrench. (Don't worry. The letter will show For example, the word "about" can be written in Grade 2 Braille this way: up eventually.)At this point, only 25 of the 54 possiblecodes have been accounted for. a. a. a. .a :: :: ?33? Upon closeexamination, you'll discoverthat the three rows of Braille illustrated above show a pattern. The first row (lettersa through i ) usesonly Second,we can take the codes for letters a through and "lower" them the top four spots in the cell-dors 1, 2, 4, and 5. The secondrow duplicates f to use only dots 2, 3, 5, and 5. Thesecodes are used for some punctuation the first row except that dot 3 is also raised. The third row is the same ex- cept that dots 3 and 6 are raised. marks and contractions, depending on context: Sincethe days of Louis Braille, the Braille code has been expandedin various ways. a. a. ao oa a. aa ao ;: :; :; currently the system used most often in published material a. 'a .o o. aa ao a. aa in English is called Grade 2 Braille. Grade 2 Braille usesmany contractions ea bb cc dis en to his in was in order to savetrees and to speedreading. CE For example,if letter codesappear ,;:.!0 by themselves,they stand for common words. The following three rows (including a "completed" third row) show theseword codes: The first four of thesecodes are the , ,, and period. Notice that the samecode is usedfor both left and right parenthesesbut that two different codes are used for open and closed quotation marks. Chapter Tbree Braille and Binary Codes 27

We'reup to 5L codesso far. The following 5 codesuse various unused In summary, we've seenhow six binary elements(the dots) yield 54 pos- combinationsof dots 3,4, 5, and 5 to representcontractions and some sible codes and no more. It iust so happens that many of these 54 codes additionalpunctuation: perform double duty depending on their context. Of particular interest is the number indicator and the letter indicator that undoesthe number indicator.

.a .a .a .a These codes alter the meaning of the codesthat follow them-from letters .a .a a. aa aa a. a. aa to numbers and from numbers back to letters. Codes such as theseare of- meaning of all subse- st ing ble ar ' com ten called precedence,or sltift, codes.They alter the t# quent codes until the shift is undone. The capital indicator means that the following letter (and only the fol- rather than lowercase.A code such as The code for "ble" is very important becausewhen it's not part of a word, lowing letter) should be uppercase Escapecodes let you "escape" from the it meansthat the codesthat follow should be interpreted as numbers. These this is known as an escapecode. humdrum, routine interpretation of a sequenceof codes and move to a new number codes are the same as those for letters a through l: interpretation. As we'll seein later chapters, shift codes and escapecodes are common when written languagesare representedby binary codes.

Thus, this sequenceof codes

.a a. o. aa .a a. .a a. aa . .

means the number 256. If you've been keeping track, we need 7 more codes to reach the maxi- mum of 64.Here they are:

.a .a .a .a .a .a .a

The first (a raised dot 4) is used as an accentindicator. The others are used as prefixes for some contractions and also for some other purposes: When dots 4 and 6 are raised (the fifth code in this row), the code is a decimal point in numbers or an emphasisindicator, depending on cohtext. !7hen dots 5 and,6 are raised, the code is a letter indicator that counterbalancesa num- ber indicator. And finally (if you've beenwondering how Braille encodescapital letters) we have dot 6-the capital indicator. This signals that the letter that follows is uppercase.For example, we can write the name of the original creator of this system as

..4. o. .a.a ..4.4. a. .a a. a. a. ..4. aa a. a. .. a. aa .. a. a. a. .a .a a. .a .. a. .a . ' a a. a. . '

This is a capital indicator, the letter l, the contraction ou, the letters i and s, a space,another capital indicator,and the lettersb, r, a, i, l, l, and e. (In actual use, the name might be abbreviated even more by eliminating the last two lctters, which aren't pronounced.)