15 September How Computers Work: Other Forms of Data
Dec 22, 2015
15 September
How Computers Work:Other Forms of Data
Current events
Court Rules Against Pennsylvania Law That Curbs Child-Pornography Sites
law forced Internet service providers to block customers' access to Web sites thought to be distributing child pornography
http://www.nytimes.com/2004/09/11/technology/11filter.html?th
Review: Integers
Binary Stored in words (32 bits) or half-
words (16 bits) Two’s complement used to store
negative numbers Max positive integer = 2n-1 - 1
Questions?
Using Integers
Not always whole numbers Invisible decimal points
Can be used to represent fractional units
1 = 1 cent 1 = 1 ml
Using integers avoids rounding errors
Floating Point Numbers Represent much larger number Scientific notation
1.452 x 1017
Mantissa exponent
Three Parts Sign Bit Exponent Mantissa
From Microsoft Calculator Understanding Extended
Precision: Extended Precision, a feature of
Calculator, means that all operations are accurate to at least 32 digits.
Calculator also stores rational numbers as fractions to retain accuracy. For example, 1/3 is stored as 1/3, rather than .333.
However, errors accumulate during repeated operations on irrational numbers.
Dates
Lots of formats for dates Some store month, day, year Some store a day and year Some store a single number
Different origins Different amount of space to store
Lots of Calendars
Excel Microsoft Excel stores dates as
sequential numbers. January 1, 1900 is 1 January 1, 2008 is 39448 (39,448 days after
January 1, 1900) Stores times as decimal fractions because
time is considered a portion of a day. Except, on the Macintosh, 1 = January
1, 1904! Rules on interpreting 2 digit years …
Y2K
What was the problem? What caused the problem?
Was the problem limited to our calendar?
How did people solve the problem? How would you have solved the
problem?
Text Need to represent characters
All data in the computer is stored as _____ Letter a question of interpretation Also includes some control: new line, tab, … Not font: the appearance is referred to as a
glyph Representations
ASCII, EBCDIC, UNICODE, … ASCII simplest Most applications moving to UNICODE
Valuable Characteristics
Collating sequence Simple upper/lower case Support of all languages Other?
ASCII
Some encodings Space: X’20’ (2016) 2: X’32’ … 9: X’39’ A: X’41’ … Z: X’5A’ a: X’61’ … z: X’7A’
http://www.webopedia.com/quick_ref/asciicode.asp
ASCII collating Space: X’20’, 2: X’32’, A: X’41’, a: X’61’ … z:
X’7A’
For collating sequence, where should punctuation be?
General rule: space < punctuation < number < letter
Most common punctuation X’21’ – X’2F’
How to deal with case? Collating sequence is case insensitive
Need to force to uppercase
Uppercase algorithm
A (4116) 0100 0001 a (6116) 0110 0001 Z (5A16) 0101 1010 z (7A16)
0111 1010 To uppercase a letter, simply turn
off the bit xx0x xxxx
Multiple languages
Used to have complete different set of encodings for each language, called code pages
Unicode is fundamentally 2-bytes Preserves the ASCII values Doubles the size of files
www.unicode.org
Formatted Documents Not all formatting information is included
in the character information We already mentioned font
Two ways to handle formatting WYSIWYG (What You See Is What You Get)
Word DOC PDF (Adobe)
Formatting language HTML used for web
Graphics Two fundamental methods of storing data
Bit maps – individual dots to be displayed Vector graphics – lines to be displayed
When using bit graphics, need intelligent way to store Compression techniques
Long strings of the same value Minor changes from picture to picture
JPEG, MPEG, …
Coming Attractions Next week we start talking about how
computers have affected society Assignment
Scan references (94, 95, 00) See course home page
Identify key impacts at different levels (for discussion not handing in)
Personal Community National Global Future
Take Home Quiz
When? Handed out on the 20th
Due the 22nd Will have time for questions on
Monday Intended to be a 30 minute test
Not timed