What’s a Code?
-
Upload
emily-decker -
Category
Documents
-
view
39 -
download
4
description
Transcript of What’s a Code?
![Page 1: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/1.jpg)
What’s a Code?
1. A system of signals used to represent letters and numbers in transmitting messages.
2. A system of symbols, letters, or words given certain arbitrary meanings, used for transmitting messages requiring secrecy and brevity.
-- American Heritage Dictionary
![Page 2: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/2.jpg)
Who are these people?
![Page 3: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/3.jpg)
Sending messages using Clicks and Clacks:
Telegraph KeyWestern Electric Morse CodeTelegraph Sounder
![Page 4: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/4.jpg)
How does this work?When a current flows through the induction coil, the resulting magnetic field attracts an armature that is held up against a metal arm. When the current is switched off, the armature is drops to its resting position, resulting in a "click". When the current returns, the armature is raised back to the upper arm resulting in a "clack." http://www.answers.com
![Page 5: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/5.jpg)
What can you do with “Clicks” and “Clacks”?
Morse Code:
A fast click-clack is a dot.
A slow click-clack is a dash.
Morse code is comprised on only two symbols.
Morse code is a binary code (two symbols).
![Page 6: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/6.jpg)
Famous Morse Codes
SOS – An easy to remember distress call, similar to 911 today.
SOS = . . . _ _ _ . . .
‘V’ for Victory – Beethoven’s 5th Symphony
Dah Dah Dah Daaahhhmmmm = . . . _
![Page 7: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/7.jpg)
Samuel MorseArtist/Inventor1830’s
Note not all letters have the same length code
![Page 8: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/8.jpg)
Not all codes are the same length:
Number of Dots and/or Dashes (length of code)
Number of Possible Codes
1 21 = 2
2 22 = 4
3 23 = 8
4 24 = 16
![Page 9: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/9.jpg)
Reasons for using codes of varying lengths
• Most commonly occurring characters are given short codes
• This is a form of file compression
![Page 10: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/10.jpg)
Spies can break simple codes that replace each letter with another symbol – just by counting the frequency of the symbols.
Frequency Table for the English Language
![Page 11: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/11.jpg)
Zip File Compression
• Eliminate Redundancy
• Replace common words with short codes.
• A table is created indicating short codes for common words.
![Page 12: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/12.jpg)
More Binary Coding Schemes:
• Braille uses raised or flat dots with six dot locations.
• 26 or 64 unique codes are possible.
Braille
![Page 13: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/13.jpg)
Translating Braille
![Page 14: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/14.jpg)
What about the humans?
![Page 15: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/15.jpg)
We have ten fingers…
Therefore we tend to use ten symbols for constructing numbers:
0 1 2 3 4 5 6 7 8 9
![Page 16: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/16.jpg)
Our numbering System is Arabic
Indo-Arabic – of Indian Origin, introduced into the west around 1000 A.D.
1. Positional - number depends on digit’s position.
2. No Special symbol for the number ten.
3. Need for ZERO Hindu Numerals from 100 A. D.
![Page 17: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/17.jpg)
How many apples are:
3,674.5 (in base-10)
This is:3 X 103 + 6 X 102 + 7 X 101 + 4 X 100 + 5 X 10-1
3000 X 600 + 70 + 4 + 5/10
![Page 18: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/18.jpg)
How many apples are:
3,524.5 if you happen
to be a bird with six digits?(base-6)
This is:3 X 63 + 5 X 62 + 2 X 61 + 4 X 60
+ 5 X 6-1
= 3*216 X 5*36 + 12 + 4 + 5/6
= 648 + 180 + 12 + 4 + 5/6 = 844.83
![Page 19: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/19.jpg)
The Mayans used a base-20 numbering system
![Page 20: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/20.jpg)
Computers have tiny electrical switches (transistors) that are controlled by two voltages
• 28 = 256• 216 = 65,536• 232 = 4,294,967,296
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
A 32-bit microprocessor can access 4 billion memory addresses – or 4GBytes
![Page 21: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/21.jpg)
Be a secret agent!
• Using tic-tacs of multiple colors, devise a coding scheme for coding a sentence of about 15-20 characters.
• A sentence may have numbers and letters.
• Determine how you will transport this code.
• Keep codes as small as possible.• Can you memorize your codes?
![Page 22: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/22.jpg)
Competition
• Half of your team will code the message.
• One person will transport the code to another room.
• The other half of the team will decode the first message and code a response.
• The first team to decode the 2nd message has to eat all the tic-tacs!
![Page 23: What’s a Code?](https://reader035.fdocuments.us/reader035/viewer/2022062308/5681332b550346895d9a1ebb/html5/thumbnails/23.jpg)
How to construct numbers:
The Roman Way
I - one V - five X – tenL - fifty C - 100 (cento in Italian)D – 500 (diecicento)M – 1000 (mille)
• 1945 = MCMXLVor
MCMXXXXV ?or MCMVL ?
• 1907 = MCMVII• 1909 = MCMIX
Cumbersome to add, confusing to subtract.Very hard to multiply and divide.