280 likes | 353 Views
Harvard University CSCI E-2a Life, Liberty, and Happiness After the Digital Explosion. 3A: Data Representation. Representation. How do you represent “things” with bits Anything Text Documents Pictures Sounds. Representation. How do you represent “things” with bits
E N D
Harvard UniversityCSCI E-2aLife, Liberty, and HappinessAfter the Digital Explosion 3A: Data Representation
Representation • How do you represent “things” with bits • Anything • Text • Documents • Pictures • Sounds
Representation • How do you represent “things” with bits • Why does representation matter? • Power • Money
Bits (“Binary digITs”) • There are two bits: 0 and 1 • Everything else is a sequence of bits • I.e. a “bit string” • 0010101, 111100010100101011
Digital representations are, by definition, approximations. They leave out a lot.
How many bits for “n” things • Each bit doubles the number • 1 bit = 2, 2 bits = 4, 3 bits = 8 • N bits = 2n things • 10 bits = 1024 etc. Another example of exponential growth
How many bits does it take to represent the 2007 Red Sox Season?
Red Sox 2007 • 162 games = 162 bits (96 “1”s and 66 “0”s • Add 4 bits / game for opponent • Add Inning results • Add at-bat results • Add pitch details • Stop when you’ve had enough
Representing Text • 8 bits per character • “A” = 01000001 • “(” = 00101000 • How many combinations of 8 bits? 2· 2· 2· 2· 2· 2· 2· 2 = 28 = 256
ASCIIAmerican Standard Code for Information InterchangeCharacter represented by Hex xy, e.g. 4B is “K”
ASCII Underneath • Emails • Web pages
What if you need more than 256 characters? • Unicode • 32 bits per character (roughly 4 billion different characters)
What about documents? Representation + Interpretation
Word Processors • DisplayWrite • Document Editor • EasyWriter • FullWrite Professional • geoWrite • Gypsy • lexicon • LocoScript • MacWrite • Magic Wand • MindWrite • MultiMate • PaperClip • pfs:Write • Protext • SpeedScript • Sprint • Taste • TJ-2 [3] • Transwrite • WordMARC • WordStar • Wordsworth • WriteNow • XyWrite 602PC Suite AppleWorks Applix Word - Atlantis Ocean Mind EasyWord FrameMaker Han/Gul Lotus Word Pro Mellel Microsoft Word - Nisus Writer - Pages - Papyrus – PolyEdit StarOffice TextMaker WordExpress WordPerfect Hieroglyph Jarte Madhyam Amí AtariWriter Bravo Bank Street Writer DeskMate
Why representation matters • Loss of data and the inability to exchange is the primary deterrent to switching vendors. • Control the representation and your control what can be seen and what can be done.