Title: LSP 121
1LSP 121
- Number Systems
- andLogarithms
2Binary 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?
3Counting in binary
4The Pattern (think isomorphism)
Given a base B
Example for Base 2, binary
5Binary 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
6Binary 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.
7Convert 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
8scribble here
9Binary Addition
Note that 1 1 1 0, write 0, carry 1Also
note that 1 1 1 1 1, write 1 carry 1.
10Binary 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.
11scribble here
12ASCII 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
13ASCII 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
14Its true
- There are 10 kinds of people in the world
- Those that know binary and those that dont
15What 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
16Real 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)
17Constructing a logarithmic spiral
Start with symmetric spokes, draw perpendicular
to next spoke
As spokes increase, smooth curve starts to take
shape
18Logarithms and Geometry
A logarithmic spiral
19Logarithms in nature
20the Nautilus
21Example 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
22Inverse-square law
This is true for all energy, such as, sound or
light intensities.
23Sounds
- 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
24Decibel
- 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)
25Remember 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
26Dangerous 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
27Log 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
28Log 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?
29Log 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
30Example 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
31Example 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
32Sound 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)
33LOG 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
34inverse 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
35scribble here