Power of Numbers by dffhrtcv3

VIEWS: 0 PAGES: 18

• pg 1
```									     LSP 121

The Power of Numbers
Conversions
• Convert 23 feet to inches
– We all know there are 12 inches to a foot, so
12 * 23 = 276 inches
– But what did we really do?

12 inches
23 feet x
1 foot
Conversions
• At a French department store, the price for a
pair of Levi jeans is 45 euros. What is that in
U.S. dollars?

\$1.37
45 euros x            = \$61.65
1 euro
Chain of Conversion

• How many seconds in one day?
24 hours        60 min       60 sec
1 day x               x            x            = 86,400 sec
1 day          1 hour       1 min

• You want to carpet your bedroom. It is 23 feet x 18
feet. How many square yards is that?
1 yd2
23 ft x 18 ft = 414 ft2                 414 ft2 x           = 46 yd2
9 ft2
Chain of Conversion
• To connect a computer to the Internet, the
computer needs an IP address. Currently
IP addresses are 32 bits in length. How
IP addresses are binary, so raise 2 to the 32nd power

Or 232 = 4,294,967,296

• If they assign 1000 addresses a day, how
long would those addresses last (in years)?
Chain of Conversion

4,294,967.296 days * 1 year/365 days = 11767.03 years

Standardized Units
Weights
• In the U.S., we still use:                              Grain (0.0648 gram)
Ounce
Pound
Ton
Long ton (2240 pounds)
Lengths                         Liquid measures
Inch                            Teaspoon                            Dry measures
Foot                            Tablespoon (3 t)                    Dry pint
Yard                            Fluid ounce (2 T)                   Dry quart
Rod (5.5 yards)                 Cup (8 fluid ounces)                Peck (8 dry quarts)
Fathom (6 feet)                 Pint (16 fluid ounces)              Bushel (4 pecks)
Furlong (1/8 mile)              Quart (2 pints)                     Cord (128 cubic feet)
Mile                            Gallon (4 quarts)
Nautical mile (6076.1 feet)     Barrel of petroleum (42 gals)
Classic College of Engineering “expression”: Units of measure will always be stated
in least likely terms. Example: Furlongs per fortnight.
Standardized Units
• Most of the rest of the world uses the metric
system:        Small Values
deci    d        10-1 one-tenth
meter – length        centi   c        10-2 one-hundredth
gram – mass           milli   m        10-3 one-thousandth
second – time         micro   µ        10-6 one-millionth
liter - volume        nano    n        10-9 one-billionth
pico    p        10-12 one-trillionth

Note: 2.3E+06 = 2.3 x 106
Large Values
deca    da     101 (ten)         4.6E-04 = 0.00046
hecto   h      102 (hundred)
kilo    k      103 (thousand) (such as 200 kbps transfer speed)
mega    M      106 (million)
giga    G      109 (billion)
tera    T      1012 (trillion)  unless………………..
Standardized Units?
 Note: memory is based on binary so we use base 2
K = kilo (kilobytes) = 210 = 1024
M = mega (megabytes) = 220 = 1,048,576
G = giga (gigabytes) = 230 = 1,073,741,824
T = tera (terabytes) = 240 = 1,099,511,627,776
followed by peta, exa, zetta, yotta

• Some groups suggested we should call
these kibi, mebi, gibi, tebi, pebi, exbi (and
yes, zebi and yobi)
Binary Numbers
• Why should anyone learn binary?
• All music, video, data, and computer programs
are stored in computer memory/storage
• Computers are based on the binary number
system (on/off or 1/0)
• If your iPod / computer / flash drive has x
storage capacity, what does that mean?
Binary Numbers
• Before we discuss binary arithmetic, do you
really understand decimal arithmetic?

1024 = 1 x 103 + 0 x 102 + 2 x 101 + 4 x 100

• Binary numbers are the same, except
there are only 2 digits (0 and 1), and the
base is 2
10010 = 1 x 24 + 0 x 23 + 0 x 22 + 1 x 21 + 0 x 20
Binary Numbers
• Let’s play a game. You are a cashier at your
favorite store. How do you make \$0.86 in
change?
• What if you only have dimes, nickels and
pennies?
• A good cashier always tries to use the biggest
coins possible.
Binary Numbers
• You are now working in a foreign country.
They don’t have quarters, dimes, or nickels;
they have 16 cent pieces, 8 cent pieces, 4 cent
pieces, 2 cent pieces, and pennies, and you
can only give out at most one of each coin!
• How do you make change for \$0.14? \$0.29?
• Let’s list these coins in order from highest on
the left to lowest on the right.
Binary Numbers
• What is the decimal value of binary
10010101?

• What is the binary value of decimal 83?

• Use a calculator?
Binary Arithmetic
• Let’s add the following two binary values

10011100
01011010

• When a computer does arithmetic, it converts
all values to binary.
• This takes a little bit of time, which is why we
say “if you aren’t doing arithmetic with the
data, don’t declare it as type numeric”
Binary Representation
 When you type the letter “n” on the keyboard, it
converts it to an 8-bit binary value, based on the
ASCII character set.
 So all Word documents are stored sequences of 8-bit
ASCII characters (called bytes)
 All color images are composed of teeny-tiny dots
(pixels). Each pixel is composed of so much red, so
much green, and so much blue (RGB)
Binary Representation
 Music on iPods and such are stored in binary
 Music is an analog waveform
   the waveform is sampled at regular intervals
   each sample is converted to a binary value (such as 8-bits)
   the binary values are stored in memory
   Talking on a cellphone/telephone is also binary
   all voice is converted to binary in the same way that music
is converted to binary
Binary Representation
   So pretty much everything we do technology-wise is
binary
   Computer work
   Music
   Television
   Photography/video
   Telephones/cellphones
   Is there any major at DePaul that does not use
computers or binary numbers?

```
To top