1
COMS 161Introduction to Computing
Title: The Digital Domain
Date: September 1, 2004
Lecture Number: 4
2
Announcements
• Homework Assignment 2 Due on Friday
• Questions
• Comments
• Concerns
• Criticism
• Jokes
3
Review
• Digital Domain
• Discrete
• Digital
• Analog (continuous) information
4
Outline
• Analog (continuous) Information
• Digital information– Advantages
– Disadvantages
5
Analog Information
• Natural form of representing information– Sound is analog information
• Continuous over some dimension(s)– Time is a natural dimension for sound
– Sound is composed of variations in air pressure• A pressure measurement can be made at any
and all times during the sound• Temperature is also continuous
6
Analog information
Amplitude,intensity, orvolume
Time
• Signal or waveform– Amplitude: how far up and down
– Frequency: how many times per sec
7
Frequency
1 second time
8
Analog information
• Continuous– At every instant in time there is an amplitude
– There is an infinite amount of information in an analog signal or waveform
9
• Discrete and finite–Amplitude is measured at distinct time
intervals
Digital information
Time
Amplitude,intensity, orvolume
10
– Finite sequence of instantaneous pulses, which we call samples• Finite sequence
– We can count and label the samples
• Instantaneous pulses– The amplitude, intensity, or volume at one specific
instant in time
Digital information
t t*2 t*3Time
Amplitude
11
Digital information
• No measurements are made between the instantaneous pulses (samples)
• Digital representations contain a finite amount of information
• Digital information– Not exact as analog
– More precise (repeatable)
– More compact
12
Digital information
• The number of samples is fundamentally important when accurately representing an analog signal– Appropriate sampling allows digital
information to replace analog information• For example
– CD’s, MP3’s, DVD’s– Digital telephones– …
13
Digital advantages
• Electronic1. Fast
• Operating speeds measured in billionths of a second
2. Precise• Numbers are distinct and unambiguous
– Precise manipulation (cloning)
3. Ordinal• Ordered numbers
– Simple alphabetical sorting
14
Digital advantages
4. Efficient storage• Practical to store large amounts of data
in a small amount of area– iPod: 10,000 songs! How many CD’s
would you need?
5. Fast Transfer• Compare downloading a paper from
the internet to:– Going to the library– Determining what you need is not there
15
Digital advantages
6. Absolute replication• Cloning
– No loss or degradation of information when making a copy
– Copies of downloaded papers are just as clear as the original» Photocopying adds noise and loses
information in the process» Copies of copies become unintelligible
– Music for prosperity» Compare to my old LP’s
16
Digital advantages
7. Resolution independence• Resolution: amount of detail
– Higher resolution means more detail and therefore higher fidelity
• Downloaded information can be scaled to match you system– Either higher or lower resolution
» Music is resampled to match the resolution of your system
• Resolution is machine independent
17
Digital advantages
8. Random Access• Direct access to digital data, provided
we know where to look for it
• Random access– All accesses take the same amount of
time (latency) regardless of where the data resides
18
Digital advantages
8. Random Access (Cont.)• Sequential access
– Analog information– Must pass information that comes before
what you wish to find
9. Selective Access• Searched by content (selective)
• Find occurrences of a given word in a document
19
Digital advantages
10.Compression• Useful information is not totally
redundant or totally random
• Redundant– Repeating
• Random– Nothing in common– TV snow– This lecture?
20
Redundant
–How many times does this message have to be transmitted, heard, or seen before it is not necessary to continue
» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C» COMS 161 is the best of the best classes at the H-S-C
21
Redundant
–Redundancy permits data compression• Remove some of the redundancy
• Keep enough–Reconstruct the original exactly–Reconstruct a reasonable approximation of
the original
• Example of compression–Repeat the following phrase nine times
» COMS 161 is the best of the best classes at the H-S-C
22
Random
–Can you guess what this picture is?
23
Digital advantages
11.Content Analysis and Synthesis• Digital data can be processed,
combined, and analyzed
• Ordered based on content
• Cookies– Allow web sites to taylor to you
12.Broad usefulness• Many different forms of information can
be represented this way
24
Digital Domain
• Analog information– The natural form for many different types of
information
– Continuous in at least one dimension
• Digital information– Language of the computer
– Analog information must be converted into a discrete (digital) form
– Multimedia is all digital information
25
Digital Domain
• Converting analog to digital information– We need a digital representation of the
information
– Recall, digital is a discrete system• Where symbols are numbers• The digital advantages
– Therefore, we need a numerical encoding of the data• Numerical means numbers
26
Numbers
• Two types of notion used to represent numbers– Non-positional notation
• No special significance is given to order– Counting numbers on your fingers– Tick mark counting method
» The number of items is important, not the order
– My honey do list» Not important which task I do first, just so I get them all
done
27
Numbers
–Positional notation• Significance is given to order the digits
appear in the number
• The decimal numbering system uses positional notation
–This is the system we use–365 is not the same a 653
» These are completely different numbers» They use the same digits
28
Positional notation
• 365 means– Three hundreds
– Six tens
– Five ones
• Each digit is multiplied by a power of 10
1*510*6100*3365 012 10*510*610*3
29
Decimal number system
• Synonyms– Decimal number system
– Decimal notation
– Base-10 system
• Both digits and their location in the number are important
• Ten unique symbols (digits)– 0, 1, 2, …, 9
30
Octal number system
• Decimal is not the only positional number system available– Octal
• Positional,base-8 system• Each digit is multiplied by a power of 8• Eight unique symbols (digits)
– 0, 1, 2, …, 7
0128 8*58*68*3365
10245548192
31
Binary number system
–Binary• Positional, base-2 system
• Each digit is multiplied by a power of 2
• Two unique symbols (digits), 0 and 1
102 4514832101101
012345 2*12*02*12*12*02*1101101
1*12*04*18*116*032*11011012
32
Binary number system
• Digital and binary relationship– The language of computers use binary digits
– Only 2 possible values• 0 and 1
– Much simpler to make electronics that distinguish between one of two values• Distinguishing between more than two values is
very difficult
33
Binary number system
• Since binary digits have two possible values
• Binary digits are called bits– They only contain a little “bit” of information
– Numbers represented in binary form will (most likely) require more digits (bits) than the decimal form
210 10110146
34
Binary number system
• To represent more information– Lump together multiple bits called strings
• One bit: 2 values• Two bits: 4 values (00, 01, 10, 11)• Three bits: 8 values (000, 001, …, 111)• Four bits: 16 values (0000, …, 1111)• Five bits: 32 values• Six bits: 64 values• Seven bits: 128 values• Eight bits: 256 values
35
Binary number system
• In general
number of values = 2number of bits
– 1 = 20
– 2 = 21
– 4 = 22
– 8 = 23
– 16 = 24
– 32 = 25
– 64 = 26
– 128 = 27
– 256 = 28
36
Binary number system
• Common grouping– 4 bits: nibble
– 8 bits: byte
• One byte represents 256 different values or items
37
Binary number system
– Letters in the English language• A = 6510 = 0100 00012
• B = 6610 = 0100 00102
• …
• Z = 9010 = 0101 10102
• …
• a = 9710 = 0110 00012
• …
• Z = 12210 = 0111 10102
• Numbers are still left over for punctuation
38
Binary number system
• Precision– The number of bits used to represent an
item• Letter: precision of 8 bits• Integer (whole number): precision of 32 or 64
bits
– Always finite• Computers have finite precision
– Presents some limitations
39
Hexadecimal number system
• Sometimes called hex– Positional,base-16 system
– Each digit is multiplied by a power of 16
– Sixteen unique symbols (digits)• 0, 1, 2, …, 15
• Symbol a or A for 10• Symbol b or B for 11 Symbol e or E for 14• Symbol c or C for 12 Symbol f or F for 15• Symbol d or D for 13
40
Hexadecimal number system
• A hex number can represent 16 different items– Equivalent to 4 bits
– Makes it easy to convert between binary and hex• Group bits by 4’s from the left end• Substitute the hex symbol
– 9010 = 0101 10102 = 5A16
» Is the base 16 really needed?
– 6610 = 0100 00102 = 4216
41
Hexadecimal number system
• Use the backwards conversion to convert hex to binary– One hex digit is equivalent to 4 bits
– Substitute the binary nibble• Always start at the right end• Add zeros to the left end as necessary to fill in 4
bits
42
Hexadecimal number system
HEX DEC BIN
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
43
Digitization
• The process of converting analog information into binary– Discrete forms are unambiguous
• Text and numbers are discrete
– Conversion of discrete to digital• Come up with a mapping
– As we did with the letters
44
Binary Coded Decimal
• Integers (whole numbers)– One mapping is to use its binary equivalent
• Binary Coded Decimal (BCD)– 010 = 00002
– 110 = 00012
– …
– 910 = 10012
• Need a minimum of 4 bits to represent 10 different values
– Some 4 bit quantities are wasted
45
Binary Coded Decimal
• String of decimal digits– Each decimal digit is represented by 4 bits
– The number of bits needed to represent different numbers vary
– Performing arithmetic is complicated