CSCI E2 Section 21109 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

CSCI E2 Section 21109

Description:

Computers just understand 0 and 1. We are used to looking at numbers in base 10 ... The Mythbusters (on the Discovery channel) showed that in normal situations, 7 ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 15
Provided by: debora89
Category:

less

Transcript and Presenter's Notes

Title: CSCI E2 Section 21109


1
CSCI E-2 Section 2/11/09
  • Binary representation
  • Character encoding
  • Exponential growth

2
Binary Representation
  • Computers just understand 0 and 1
  • We are used to looking at numbers in base 10
  • Can easily convert between decimal and binary by
    dividing by 2 repeatedly

3
Convert 43 to binary
  • 43/2 21 remainder 1
  • 21/2 10 remainder 1
  • 10/2 5 remainder 0
  • 5/2 2 remainder 1
  • 2/2 1 remainder 0
  • 1/2 0 remainder 1
  • 43 101011 in binary (read from bottom up)

4
Binary representation
  • How do we check our result?
  • Start with the binary 101011
  • 125 024 123 022 121 120
  • 32 0 8 0 2 1 43
  • We can do a similar process if we wanted to
    convert to base 5 or base 17 or whatever

5
Character Encoding
  • Machines store everything in binary, so how do we
    represent things like text?
  • We have to agree on a code that maps characters
    to binary
  • One common code ASCII
  • Standard ASCII 7 bits
  • Extended ASCII 8 bits

6
Some ASCII examples
7
Limitations of ASCII
  • How many characters can we represent in 7- and
    8-bit ASCII?
  • What about 16-bit Unicode?
  • For some character sets, that isnt even enough
  • What does doubling the number of bits per
    character do to the number of characters that can
    be represented?

8
Character Sets
  • Why are character sets such a big deal in the
    real world?
  • Data comes in all sorts of formats and alphabets
    ASCII, Greek, Cyrillic, EBCDIC, Shift_JIS,
  • What happens if my computer tries to interpret
    your message using the wrong character set?

9
Exponential Growth
  • y kx
  • Every time you increase x by 1, y gets multiplied
    by k
  • Adding 1 character to the number of characters on
    a license plate allows the state to issue 36
    times more license plates as before

10
Paper Folding
  • Start with a sheet of paper .1mm thick and 10
    inches square
  • Fold it in half once, and its .2mm thick and
    5x10 inches
  • Fold it in half again, and its .4mm thick and
    either 5x10 inches or 2.5x10 inches
  • What happens if we keep folding it?

11
Paper Folding, continued
  • If we fold it n times, its thickness is 0.1mm
    2n
  • If n50, then its 0.1mm250, or about 113
    million km
  • Earth to sun is about 150 million km

12
Paper Folding, continued
  • If you alternate directions of the fold to keep
    it square after even numbered folds, then the
    resulting paper is 10in 2(n/2)
  • If n50, then the paper is about 7nm square
  • Thickness of a carbon atom is .22nm, so this is
    the thickness of 35 carbon atoms

13
Solving when x is in the exponent
  • I started with paper .1mm thick and folded until
    it was 16.68 miles thick
  • How many times did I fold it?
  • 16.68 miles 1.61 km/mile 1000000 mm/km
    26,854,800 mm
  • .12x 26,854,800
  • x lg(26854800 mm/0.1mm) 28 times

14
Mythbusters
  • The Mythbusters (on the Discovery channel) showed
    that in normal situations, 7 folds is the limit
  • Specially-shaped and super-thin paper can maybe
    get 8 folds
  • Ridiculously huge paper in a hangar with a
    steamroller and forklift got 11 folds
Write a Comment
User Comments (0)
About PowerShow.com