– Part 2 Ch. 1 Data Storage ASCII-7

advertisement
Ch. 1 Data Storage – Part 2
ASCII-7
•
In the early days, a _________________ was used, with _________________ of 0’s
and 1’s, enough for a typical keyboard.
•
The standard was developed by _________________ (American Standard Code for
Information Interchange)
Each group of 7 bits was mapped to a single keyboard character.
•
Byte = _________________________________________________________________
• More common: 8 bits = 1 byte
•
Abbreviation: ____
1 byte (B)
Kilobyte (KB) = 1,024 bytes (210)
• “one __________________ bytes”
1,024 = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2
Megabyte (MB) = 1,048,576 bytes (220)
•
“one __________________ bytes”
Gigabyte (GB) = 1,073,741,824 bytes (230)
•
“one __________________ bytes”
ASCII-8
•
IBM later extended the standard, using 8 _____________________________
•
This was known as ______________________________________________
•
This gave __________unique combinations of 0’s and 1’s.
1
Unicode
•
•
•
•
Although ASCII works fine for English, many other languages need more than 256
characters, including numbers and punctuation.
Unicode uses a 16 bit representation, with 65,536 possible symbols.
Unicode can handle all languages.
www.unicode.org
Non-text Files:
Representing Images and Sound
Pixels
•
A monitors screen is divided into a grid of small unit called picture elements or pixels.
•
Each Color intensity of red, green and blue represented as a quantity from 0 through
255.
Higher the number the more intense the color.
Black has no intensity or no color and has the value (0, 0, 0)
White is full intensity and has the value (255, 255, 255)
Between these extremes is a whole range of colors and intensities.
Grey is somewhere in between (127, 127, 127)
•
•
•
•
•
2
First a word about Pixels Per Inch
•
PPI stands for pixels per inch.
•
PPI is a measurement of image resolution that defines the
______________________________________________________________.
An image that is 1600 by 1200 pixels at 300ppi will print at a size of 5.3 by 4 inches.
Or it could be printed at 180 ppi for a printed size of 8.89 by 6.67 inches.
•
•
•
The ______________________________________________________________. you
will get--but only up to a point.
•
_______________ is generally considered the
_________________________________________ when it comes to ink jet printing of
digital photos.
•
The higher the PPI value, the better quality print you will get--but only up to a point.
•
•
“True color” systems require 3 bytes or 24 bits per pixel.
There is 8 bit and 16 bit color, which gives you less of a color palette.
•
An 8 inch by 10 inch image scanned in at 300 pixels per inch:
– 8 x 300 = 2,400 pixels 10 x 300 = 3,000 pixels
– 2,400 pixels by 3,000 pixels = 7,200,000 pixels or 7.2 megapixels
–
At 24 bits per pixel (7,200,000 x 24)
• = 172,800,000 bits or 21,600,000 bytes (21.6 megabytes)
• RAM memory, video memory, disk space, bandwidth,…
File Compression
•
•
Typical computer screen only has about 100 pixels per inch, not 300.
Images still require a lot of memory and disk space, not to mention transferring images
over the network or Internet.
•
______________________________ – A means to change the representation to use
fewer bits to store or transmit information.
Information sent via a fax is either black or white, long strings of 0’s or long strings of 1’s.
•
Run-length encoding
•
Many fax machines use run-length encoding.
•
______________________________ uses binary numbers to specify how long the first
sequence (run) of 0’s is, then how long the following sequence of 1’s is, then how long
the following sequence of 0’s is, and so on.
0-100 1-373 0-96 etc.
Fewer bits needed than sending 100 0’s, then 373 1’s etc.
•
•
•
Run-length encoding is a ______________________________, meaning that the
original representation of 0’s and 1’s can be reconstructed exactly.
3
JPEG Compression
•
JPEG – Joint Photographic Experts Group
•
•
JPEG is a _______________________________________________________
Our eyes are not very sensitive to small changes in hue (chrominance), but we are
sensitive to brightness (luminance).
This means we can store less accurate description of the hue of the picture (fewer bits)
and our eyes will not notice it.
This is a lossy compression scheme, because we have lost some the original
representation of the image and it cannot be reconstructed exactly.
•
•
•
With JPEG we can get ____________________________________________ or more,
without being able to see a difference.
•
There are ____________________________________________ in pictures that can
be lumped together without our noticing.
Because of this, when Run-length compression is used there is more compression
because there is less variations in the hue.
•
MPEG Compression Scheme
•
•
MPEG (Motion Pictures Experts Group)
MPEG compression is similar to JPEG, but applied to movies.
– JPEG compression is applied to each frame.
– Then interframe coherency is used, which only records and transmits the
“differences” between frames.
Hexadecimal Number System
•
With web applications like HTML (Hypertext Markup Language), colors are sometime
described using their RGB color specification in ____________________________.
•
•
•
•
All digits ________________________
A Base-n number system has n number of digits:
– Decimal: Base-10 has 10 digits
– Binary: Base-2 has 2 digits
– Hexadecimal: Base-16 has ________________
The first column is always the number of 1’s
Each of the following columns is n times the previous column (n = Base-n)
– Base 10: 10,000 1,000 100 10 1
– Base 2:
16
8 4 2 1
– Base 16: 65,536 4,096 256 16 1
4
Why Hexadecimal?
•
•
Hexadecimal is perfect for matching 4 bits.
Every combination of 4 bits can be matched with one hex number.
•
____________ can be represented by ____________
•
____________ can be represented by ____________
5
6
Decimal
Red
Green
Blue
0
0
255
Hexadecimal
______________
______________
___________
Binary
______________
______________
___________
Decimal
Red
Green
Blue
200
48
127
Hexadecimal
______________
______________
___________
Binary
______________
______________
___________
Decimal
Red
Green
Blue
74
132
40
Hexadecimal
______________
______________
___________
Binary
______________
______________
___________
Decimal
Red
Green
Blue
255
255
255
Hexadecimal
______________
______________
___________
Binary
______________
______________
___________
Decimal
Red
Green
Blue
50
128
60
Hexadecimal
______________
______________
___________
Binary
______________
______________
___________
7
Digitizing Sound
•
Many definitions of analog.
•
•
(Our definition) _____________________ is a wave form analogous to the human voice.
The telephone systems uses an analog wave to transmit your voice over the telephone
line to their Central Office.
•
Two parts of the wave:
–
Amplitude – ___________________ of the wave which equates to volume.
–
•
Frequency – ____________________ per second, which equates to pitch.
Computers are digital devices, so the analog wave needs to be converted to a digital
format.
•
Converting Analog to Digital requires three steps:
1. _____________________
2. _____________________
3. _____________________
•
•
Sampling – ___________________________________________________.
The more samples you take, the more accurately you represent the original wave, and
the more accurately you can reproduce the original wave.
•
•
Quantifying – This is the process of giving a value to each of the samples taken.
The larger the range of numbers, the more detailed or specific you can be in your
quantifying.
8
•
Coding – This is the process taking the value quantified and representing it as a binary
number.
•
Audio CDs use ___________________ for coding.
•
•
•
16 bits gives a range from ___________________.
Actually:
– 15 bits are used for the range of numbers
– 1 bit is used for + (positive) or – (negative)
32,768 positive values and 32,768 negative values
•
How many bits does it take to record one minute of digital audio?
•
1 minute = _____________________________
•
____________________ samples per second
•
This equals _____________________________.
•
Each sample requires ________ bits.
•
2,646,000 samples times 16 bits per sample equals _____________________ bits.
•
42,336,000 bits times 2 for stereo equals _____________________________ for 1
minute of audio.
•
84,672,000 bits divided by 8 bits per byte equals 10,584,000 bytes for _____________
of audio.
(More than _____________________________)
•
_________ of audio equals 635,040,000 bytes or _________ (megabytes)!
MP3 Compression
•
•
•
•
Compressing digital audio means to reduce the number of bits needed to represent the
information.
There are many sounds, frequencies, that the human ear cannot hear, some too high,
some too low.
These waves can be removed without impacting the quality of the audio.
MP3 uses this sort of compression for a typical compression ratio of 10:1, so a one
minute of ______ music takes ______________________ instead of 10 megabytes.
•
A key advantage to digital representation of information, images and sounds, is that the
it can be _________________________________ without losing a “bit” of the quality.
9
Download