cse120wi11lec06[1] encoding bits bytes letters

Upload: dee-can

Post on 08-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    1/19

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    2/19

    Howsitgoing? AfterImageSurveytodayby5:00 Thethreadsofthisclass

    1/14/11 2010 Larry Snyder, CSE 2

    0s and 1s Glories

    lab3: binary & hex -- numbers

    today lecture -- letters

    Lightbot 2.0

    functional abstraction

    lab 1: symbolic lightbotlab 2: functions with lightbot

    Processing

    lab 4: practice w/Processing

    Social Network

    FactsAbilities Computing World

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    3/19

    WehavewrittentwokindsofProcessingprograms

    static,whichonlydrawapicture

    dynamic,whichkeepdrawingapicture

    1/14/11 2010 Larry Snyder, CSE 3

    click

    Whats The Difference?

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    4/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    TheDivingBellandtheButterflyJeanDominiqueBauby

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    5/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    AprotocolforYes/Noquestions Oneblink==Yes Twoblinks==No

    PandAimpliesthatthisisnotthefewestnumberofblinksreally?

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    6/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    InEnglishETAOINSHRDLU

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    7/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    Howmanyquestionstoencode: Plusachange,plusc'estlammechose?

    AskinginFrequencyOrder:ESARINTULOMDPCFBVHGJQZYXKW

    129

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    8/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    Howmanyquestionstoencode: Plusachange,plusc'estlammechose?

    AskinginFrequencyOrder:ESARINTULOMDPCFBVHGJQZYXKW

    AskinginAlphabeticalOrder:ABCDEFGHIJKLMNOPQRSTUVWXYZ

    1612

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    9/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    Howmanyquestionstoencode: Plusachange,plusc'estlammechose?

    AskinginFrequencyOrder:247ESARINTULOMDPCFBVHGJQZYXKW

    AskinginAlphabeticalOrder:324ABCDEFGHIJKLMNOPQRSTUVWXYZ

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    10/19

    Spellingbygoingthroughthelettersisanalgorithm

    Goingthroughthelettersinfrequencyorderisaprogram(also,analgorithmbutwiththeorderspecifiedtoaparticularcase,i.e.FR)

    Thenursesdidntlookthisupinabooktheyinventedittomaketheirworkeasier;

    theywerethinkingcomputationally,thoughtheyprobablydidntknowit

    1/14/11 2010 Larry Snyder, CSE 10

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    11/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    PandAisabinaryrepresentationbecauseituses2patterns

    Bititsacontractionforbinarydigit

    apositioninspace/timecapableofbeingsetanddetectedin2patterns

    Sherlock Holmess Mystery of Silver Blaze --a popular example where absent gives

    information the dog didnt bark, that isthe phenomenon wasnt detected

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    12/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    Abyteiseightbitstreatedasaunit AdoptedbyIBMin1960s Astandardmeasureeversince BytesencodetheLatinalphabetusingASCIIthe

    AmericanStandardCodeforInformation

    Interchange

    01010101

    01010111

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    13/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    01000011

    01010011

    01010000

    0100 1000|0111 0101|0111 0011|0110 1011|0110 1001|0110 0101|0111 0011|0010 0001

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    14/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    UniformTransformation

    Formatforbytes

    (UTF8)isuniversalallcharactershaveaplace:1,2,3,4B

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    15/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    UniformTransformation

    Formatforbytes

    (UTF8)isuniversalallcharactershaveaplace:1,2,3,4B

    spnou

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    16/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    Bitsandbytesencodetheinformation,butthatsnotall

    Tagsencodeformatandsomestructureinwordprocessors

    TagsencodeformatandsomestructureinHTML IntheOxfordEnglishDictionarytagsencode

    structureandsomeformatting

    Tagsareoneformofmetadata:metadataisinformationaboutinformation

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    17/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    byte (baIt). Computers. [Arbitrary, prob. influenced by bit sb.4 and bite sb.] A group of eight

    consecutive bits operated on as a unit in a computer. 1964Blaauw& Brooks in IBM Systems

    Jrnl. III. 122 An 8-bit unit of information is fundamental to most of the formats [of the System/360]. A consecutive group ofn such units constitutes a field of length n. Fixed-length fields of

    length one, two, four, and eight are termed bytes, halfwords, words, and double words

    respectively. 1964IBM Jrnl. Res. & Developm. VIII. 97/1 When a byte of data appears from an

    I/O device, the CPU is seized, dumped, used and restored. 1967P. A. StarkDigital Computer

    Programmingxix. 351 The normal operations in fixed point are done on four bytes at a time.1968Dataweek24 Jan. 1/1 Tape reading and writing is at from 34,160 to 192,000 bytes per

    second.

    byte baIt. Computers.Arbitrary, prob. influenced by bit n.4andbite n. A group of eight consecutive bitsoperated on as a unit in a computer. 1964Blaauw &amp.Brooks in IBM Systems Jrnl. III. 122 An 8-bit unit of information is fundamental to most of the formats of the System/

    360.&es.A consecutive group of n such units constitutes a field oflength n.&es.Fixed-length fields of length one, two, four, and eight aretermed bytes, halfwords, words, and double words respectively. 1964 IBM Jrnl. Res. &amp. Developm. VIII. 97/1When a byte of data appears from an I/O device, the CPU is seized, dumped,used and restored. 1967 P. A. Stark DigitalComputer Programming xix. 351 The normal operations in fixedpoint are done on four bytes at a time.1968 Dataweek24 Jan. 1/1 Tape reading and writing is at from 34,160 to 192,000bytes per second.

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    18/19

    Thisweekwehaveseen Bitsencodenumbersusingthebinary

    representation1111100111

    BitsencodelettersusingASCIIforNorthAmericanandWesternEuropeanlanguages

    Thissuggestsanprinciplewewillsoonargue: Allinformationcanberepresentedwithbits

    1/14/11 2010 Larry Snyder, CSE 18

  • 8/6/2019 Cse120wi11lec06[1] Encoding Bits Bytes Letters

    19/19

    1/14/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    Computersjoinphysical&logicaldomainssophysicaldevicesdoourlogicalwork

    Symbolsrepresentthings1to1:0,1 Createsymbolsbygroupingpatterns:01010111 PandArepresentationisfundamental:present? Bit,aplacewhere2patternsset/detect

    ASCIIisabyteencodingofLatin

    bet Inadditiontocontent,encodestructure:meta