LSP 121 - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

LSP 121

Description:

Computers are based on the binary number system (on/off or 1/0) ... Binary numbers are the same, except there are only 2 digits (0 and 1), and the base is 2 ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 36
Provided by: sgu4
Category:
Tags: lsp | base | binary

less

Transcript and Presenter's Notes

Title: LSP 121


1
LSP 121
  • Number Systems
  • andLogarithms

2
Binary Numbers
  • Why should anyone learn binary?
  • Computers are based on the binary number system
    (on/off or 1/0)
  • All music, video, data, and computer programs are
    stored in binary in computer memory/storage
  • If your iPod / computer / flash drive has x
    storage capacity, what does that mean?

3
Counting in binary
4
The Pattern (think isomorphism)
Given a base B
Example for Base 2, binary
5
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
6
Binary Numbersconvert binary to decimal
  • What is the decimal value of binary 10010101?
  • This can be done using a grid with the successive
    powers of 2 written right to left.

7
Convert decimal to binary
  • What is the binary value of decimal 83?
  • This can be done is two ways
  • fill in the powers of 2 that add up to 83, or
  • successively divide by 2, write remainder
    collect remainders beginning with last

8
scribble here
9
Binary Addition
Note that 1 1 1 0, write 0, carry 1Also
note that 1 1 1 1 1, write 1 carry 1.
10
Binary Arithmetic
  • Add the following two binary values
  • 10011100
  • 01011010
  • So when a computer does arithmetic, it converts
    it to binary.
  • When you type the letter n on the keyboard, it
    converts it to an 8-bit binary value.

11
scribble here
12
ASCII code
  • Every character (keystroke) has a numeric
    equivalent, e.g., A, B, C, D is (in decimal) 65,
    66, 67, 68.
  • The computer uses the binary value for each
    keystroke (including punctuation and the
    space).
  • This is HELLO in ASCII code (binary)1001000
    1000101 1001100 1001100 1001111

13
ASCII codes
  • There are many sources (online) that indicate the
    ASCII codes for all keyboard characters as well
    as graphic, numeric and control characters.
  • A good place to start ishttp//ascii-table.com

14
Its true
  • There are 10 kinds of people in the world
  • Those that know binary and those that dont

15
What is a Logarithm?
  • A logarithm (or log) is a number that represents
    a power or exponent
  • Why use logs?
  • A simpler way to express large values
  • Some things grow or shrink exponentially, so the
    log is a perfect numbering system

16
Real numbers or logs?
  • would you rather see 108,243,578 or8.03 (since
    108.03 108,243,578)
  • would you rather say that an earthquake had the
    energy equivalent to423,427,834 or 8.6 Richter
    value
  • The big number is the same as the small number if
    you use logs (logarithms)

17
Constructing a logarithmic spiral
Start with symmetric spokes, draw perpendicular
to next spoke
As spokes increase, smooth curve starts to take
shape
18
Logarithms and Geometry
A logarithmic spiral
19
Logarithms in nature
20
the Nautilus
21
Example Sound
  • Sound is a form of energy which obeys the Inverse
    Square Law
  • This law states that sound decreases by 1/d2 as
    you get farther from the sound source,(d
    distance from sound source)
  • The sound energy decreases inversely to the
    square of the distance from the source
  • For example, if at 1 meter, the sound energy is 1
    unit, then, at 2 meters, it is ΒΌ units, at 3
    meters, it is 1/9 units

22
Inverse-square law
This is true for all energy, such as, sound or
light intensities.
23
Sounds
  • The threshold of human hearing is considered 1
    (100)
  • The rustle of leaves is 10 times louder than the
    threshold of hearing (101)
  • A whisper is 100 times louder than the threshold
    of hearing (102)
  • Busy street traffic is 108 times louder than the
    threshold of hearing

24
Decibel
  • These 10n values are clumsy to work with, so they
    created the term decibel (one tenth of a bel,
    remember Alexander Graham Bell?)
  • A sound 108 is actually 80 decibels (dB)
  • A sound 101 is 10 dB
  • Or loudness in dB 10 log10 (intensity of sound
    intensity of softest audible sound)

25
Remember this formula
  • The most common approach to sound intensity
    measurement is to use the decibel scale

I/Io is the ratio of the intensities (no units
with this)its a pure number, such as, 10,000,000
26
Dangerous Sounds
  • A rock concert is typically around 100 - 120 dB
    (depends on where you sit/stand)
  • The threshold of pain for the human ear is around
    120 dB
  • Immediate perforation of the eardrum is 160 dB

27
Log Base 10
  • The log base 10 (written log10) is a very common
    log
  • log10 x is the power to which 10 must be raised
    to obtain x
  • Or better yet, 10 to what power equals x?
  • log10 1000 ? (10 to what power 1000?) 3
  • log10 10,000,000 7
  • log10 0.1 -1
  • log10 30 1.4777

28
Log Base 2
  • The log base 2 (written log2) is a very common
    log when dealing with computers (since computers
    use the binary number system which is base 2
    arithmetic)
  • log2 x is read log base 2 of x it is the power
    to which 2 must be raised to obtain x
  • Or simply, 2 to what power equals x?

29
Log Base 2
  • Log2 32 5, since 25 32
  • Log2 1024 10
  • Log2 40 5.32
  • Dont have Log2 on your calculator? Take Log10
    of the same value and then divide by 0.301

30
Example 1 Richter scale
  • Richter value is given as R log(I) where I is
    the intensity of the earthquake
  • E.g., if the intensity of an earthquake is given
    as 124,056 then the Richter value is
  • R log(124056) 5.1 (use Excel or calculator)
  • Conversely, if you know the Richter scale number
    you can find the intensity
  • I 10R so if R 8.5 then
  • I 108.5 316,227,766

31
Example 2 sound levels
  • Intensity ratio (I/Io) and sound level (L in
    decibels) are related by the following
  • L 10 log(I/Io) where
  • I intensity of the sound and
  • Io intensity of threshold of sound (to humans)
  • note also, dB decibel 1/10 of a Bel
  • E.g., if the ratio is 100,000,000 find L (in dBs)
  • L 10log(100000000) 80 dB
  • dB and db are the same by the way

32
Sound levels, part 2
  • Also, if you are given the decibel value you can
    determine the ratio (I/Io)
  • an average radio is rated at 70 dB, what is the
    ratio?
  • use, I/Io 10(L/10) then
  • I/Io 1070/10 107 10,000,000
  • Jot it down I/Io 10(L/10)

33
LOG expressions in Excel
  • LOG(n)
  • this will return the log base 10 of n
  • 10y
  • this will return n, if y LOG(n)
  • LOG(128,2)
  • this will return log base 2 of 128 (try it)
  • LOG(a)/LOG(b)
  • this also will return LOG a BASE b

34
inverse of log functions
  • Know the inverse of LOG functions
  • if x log(n), how do you find n given x
  • simply take 10x and you will get n
  • Also,
  • if x 10 log(y), how do you find y given x
  • y 10(x/10)
  • use this for Loudness logarithms which uses
  • Loudness (in dB) 10 log(intensity ratio), and
    Intensity 10(L/10) where L loudness

35
scribble here
Write a Comment
User Comments (0)
About PowerShow.com