Hardware Systems

Download Report

Transcript Hardware Systems

Chapter 2
Hardware Systems
Hardware Systems
Reading Sequence:
• 2.1 Processor and Memory
• 2.2 Peripherals
• 2.3 Storage Devices
• 2.4 Putting Together the Hardware Components
• 2.5 Improving Computer Performance
Assessments:
• Exercise 2
2
Figure 1 Component overview
3
• The chipset acts as the traffic cop (交警)
controlling the flow of data and coordinating
interactions among components in the
system. Components pass data through the
chipset, and the chipset monitors the data
flow and passes data to other components.
4
 How these components work together.
Example: the computer system completes a
request to open a file and display the opened
file on the monitor.
1. The microprocessor sends instructions to the
storage devices (via the chipset) requesting the
specified file to be loaded into main memory.
2. The storage devices send the file through the
chipset to main memory.
3. The microprocessor fetches the file contents
from main memory.
4. The microprocessor sends the display data to
the monitor via the chipset.
5
Figure 2 Data flow in a computer system
6
7
Figure 3 Components inside a computer
8
Components inside a computer
• A. Motherboard
– Provides sockets for microprocessor and memory
chips, slots for circuit boards, and the circuitry that
enable electrical signals to travel from component to
component. Most of the hardware components inside
the system unit are attached to the motherboard.
• B. Power supply
– Provides electrical power to the computer system.
• C. Microprocessor
– Processes instructions stored in main memory.
Sometimes, the microprocessor is found underneath
a cooling fan to prevent it from overheating.
9
Components inside a computer
• D. Expansion slot
– Serves as a socket on the motherboard into which an expansion
card maybe inserted.
• E. Expansion card
– Enables a computer to control peripheral devices such as the
monitor and the microphone.
• F. Chipset
– Controls data flow among components.
• G. IDE (Integrated Drive Electronics) cable
– Transfers data from storage devices to the motherboard.
• H. Disk drives
– Stores data permanently (even after the computer is turned off).
They include the floppy disk drive, the CD-ROM (compact disk
read-only-memory) drive, and the hard disk drive.
10
Hardware Systems
2.1 Processor and Memory
2.1.1 Processor Basics
• The microprocessor is referred to as the Central
Processing Unit (CPU). The job is to execute a series of
machine instructions.
• Physically, the microprocessor is a single chip known
as an integrated circuit (IC). Each chip is made out of
silicon 硅and it contains millions of transistors packed
onto a chip.
• The Intel Pentium M Processor, introduced on March 12,
2003, has 77 million transistors, and the width of the
smallest wire on the chip is 0.13 micron, or 0.00000013
meter. process the instructions
11
TECHTALK:
How a Microprocessor Executes Instructions
• There are two main components of the
CPU: CU and ALU
• The control unit: accesses instructions
stored in RAM, interprets what they mean,
and then dispatches 分派, 派遣 them.
• The Arithmetic/Logic Unit (ALU):
performs arithmetic, logic operations
needed to process the instructions.
12
TECHTALK:
How a Microprocessor Executes Instructions
• A computer accomplishes a complex task by
performing a series of very simple steps,
referred to as instructions. An instruction tells the
computer to perform a specific arithmetic, logical,
or control operation.
• Two parts: the op code and the operands.
• The list of instructions that a CPU is able to
execute is known as its instruction set.
•
13
Instruction Execution with the CPU
• Four steps
1. Fetch - The control unit gets the instruction from
memory.
2. Interpret - The control unit decodes what the
instruction means and directs the necessary
data to be moved from memory to the ALU.
3. Execute - The control unit directs the ALU to
perform the necessary arithmetic or logic
operations.
4. Store - The result of the computation is stored in
memory.
14
Figure 4 Fetch-Execute cycle
15
A basic four-stage datapath
Fetch
Interpret
Execute
Store
0
M
u
x
1
IF/ID
ID/EX
EX/MEM
MEM/WB
Add
4
Add
Add
result
Shift
left 2
PC
Address
Instruction
memory
Read
register 1
Read
data 1
Read
register 2
Registers Read
Write
data 2
register
Write
data
16
Sign
extend
Zero
0
M
u
x
1
ALU
ALU
result
Address
Data
memory
Write
data
Read
data
1
M
u
x
0
32
16
Another component of the microprocessor
-- cache, a special high-speed memory
that stores most recently used data in
order to speed up the process of
instruction execution. A cache can speed
up data retrieval because recently used
data is likely to be used again by the
computer.
17
18
• Level 1 (L1) cache memory or primary
cache memory is located on the CPU to
provide the CPU with the fastest access to
data.
• Level 2 (L2) cache memory or secondary
cache, located between the RAM and the
CPU (sometimes on the CPU).
• Relative to the physical distance between
the CPU and storage areas for data and
instructions, data is retrieved more quickly
from the L1 cache, then the L2 cache, and
then the RAM.
19
 Performance: Factors and Measures
 The rate at which instructions are processed is controlled
by an internal clock, also known as the system clock.
The internal clock sends pulses(脉冲) at a fixed rate
to synchronize(同步) all computer operations. The unit of
measure for cycles(周期) per second is the hertz (Hz).
 One Hz means one cycle per second, one kHz (kilohertz)
means one thousand cycles per second, and one MHz
means one million cycles per second. Computer clock
cycles are closely related to the execution of instructions.
So, a 3 GHz Pentium 4 machine can execute more
instructions per second than a 2 GHz Pentium 4
machine. The greater the hertz, the faster the execution
speed.
20
IPS -- instructions per second
Today's computers sometimes execute
multiple instructions in a single cycle. Thus,
the number of instructions completed is
independent of the number of cycles used.
Sometimes machines are compared on
the number of IPS.
Instructions can differ a great deal. Some
complex instructions require a lot of cycles
and take a comparatively long time to
execute. Other instructions may be very
simple and execute in very little time.
21
 bandwidth :Another measure of computer
performance
 the volume of data that can be transmitted within
a fixed amount of time between components in a
computer system (such as the transfer speed
from the disk to the motherboard) or through
connections to other computers. Bandwidth is
expressed in bits per second (bps), or
sometimes bytes per second (Bps) (recall that
8 bits equals 1 byte).
 Types of Processors
 Intel,AMD,PowerPC(Macintosh family) …
22
2.1.2 Types of Memory
23
RAM
RAM (random access memory) is a
temporary holding area for both data and
instructions. It is also referred to as main
memory
The data in RAM is lost when the computer
is turned off.
RAM is measured by its memory capacity
(the maximum number of bits or bytes that
can be stored ) and latency (access time)
DRAM(Dynamic RAM),SRAM(Static RAM)
24
Latency ( access time ) : the delay
between the time when the memory device
receives an address and the time when the
first bit of data is available from the memory
device. (ns)
通常的内存是指RAM,也称主存
25
ROM
Read-only memory (ROM) is programmed
with data hard-wired when it is manufactured.
Data and instructions on a ROM are
permanent, or nonvolatile(非易失性的),
which means they are not lost when power is
turned off.
electrically erasable programmable readonly memory (EEPROM),--flash memory
26
CMOS Memory
CMOS (complementary metal oxide
semiconductor) memory stores configuration
settings information of a computer
The CMOS chip requires very little electrical
power to hold data
It can be powered by a small battery on the
motherboard, or packaged with the chip
The battery maintains the data on the CMOS
when the computer is turned off
27
Figure 6 Memory decision tree
28
Performance: Factors and
Measures
• Lab 2-B Benchmarking
• Lab Assignments: Complete the 5 steps on
Page 109 in Textbook
• Benchmarking– comparing disparate systems
or components via a standardized set of
instructions or series of tasks.
29
Performance: Factors and
Measures
• Benchmarking can test anything from just the
processor to executing office applications. The
comparison is measured by the time it takes to
execute these instructions.
• It is important to assure that comparisons or
claims are based on the same benchmarks.
• Benchmarking results by unbiased, independent
organizations are especially useful.
30
Hardware Systems
2.2 Peripherals (Section D Chapter 2 in
textbook)
2.2.1 Connecting Peripherals
– Expansion Slots and Cards
– Ports
– USB and FireWire
– Comparing Different Ports
2.2.2 Buses
2.2.3 Input/Output Devices
31
Figure 7 Peripheral devices and their connectors
32
• Expansion Slots and Cards
33
•Graphics card- video card, transforms images
into analog data.
•A graphics card has its own memory and
processor that handles computations necessary
to convert image data to be displayed into
pixels on the monitor.
34
left is an Ethernet card used to plug into the
PCMCIA slot of a laptop computer. right is an
Ethernet card for a PCI slot in a desktop.
35
• Ports
36
• USB and FireWire
 Universal Serial Bus (USB) : support for "hot
connectivity" ; The data transfer rate for USB(1.1)
is 1.5 MBps, USB-2 is developed with a data
transfer rate of 60 MBps
 Up to 127 devices can be connected to the
system unit via a USB hub, which provides
multiple USB ports
 FireWire has a faster data transfer rate, the data
transfer rate for FireWire is 50 MBps, FireWire 2
is developed with a data transfer rate of 100
MBps and it supports up to 63 devices .
37
• Comparing Different Ports
Port
Usage
Status
Camcorder and external mass
Becoming the standard for
FireWire storage (e.g. CD-ROM, hard drive,
digital video devices
etc.)
USB
Most devices
Becoming the standard for
most peripheral devices
Parallel
Printer
Becoming obsolete
Serial
Modem
Becoming obsolete
PS/2
Keyboard, mouse
Becoming obsolete
Table 1 Comparison of ports
38
2.2.2 Buses
39
2.2.2 Buses
A bus is a pathway through which data
is transferred from one part of a computer
to another. It consists of the data bus and
the address bus.
The data bus transfers the data itself,
while the address bus transfers
information about where the data is to go.
Every bus has a width, a speed, and
a transfer rate.
40
• The width, also called the word size, of a
bus is measured in bits. An 8-bit bus has
eight transfer pathways that are one bit
wide, meaning eight bits of data may be
transferred simultaneously (同时地)
• The speed of a bus is measured in hertz
(Hz), or cycles per second.
• Transfer rate is the measure of how much
data may be moved from one device to
another in one second
41
• Data traveling through the bus can pass through
expansion slots, cards, ports, and cables. For
buses that may be X-pumped and/or Y-channeled,
the peak transfer rate is the word size (in bytes) *
speed * X * Y.
• One way to enhance data transfer rate is to
transfer data multiple times during a cycle. Xpumped indicates that data can be transmitted X
times in a cycle. Another way to increase the
amount of data transferred is to increase the
number of channels used to transfer data. Ychanneled indicates that Y data channels are used
to transfer data. Also, the closer a component is to
the chipset, the faster the data can be transferred
to the chipset.
42
• The front side bus, is the bus on the
motherboard that transfers data between the
CPU and the chipset. In modern computers,
there is a great mismatch between the
speed of the system bus and the internal
speed of the much-faster CPU. This means
that one of the major obstacles(障碍) to
faster processing is system bus transfer
rate.
• The IDE bus is the interface that transfers
data between storage devices and the
chipset.
43
• RDRAM bus and DRAM bus are examples of
memory buses. Because the CPU fetches
instructions and data from RAM, the smaller the
difference between bus speeds of CPU and RAM,
the more efficient the processing.
• There are two common types of expansion slots
found on motherboards, Peripheral Component
Interconnect (PCI) and Accelerated Graphics
Port (AGP). An expansion slot that used to be
common was the Industry Standard Architecture
(ISA). ISA was the original bus standard for data
transfers from expansion cards to the system bus.
The word size or width of the data path on the ISA
bus is 16 bits, running at a mere 8 MHz. It is now
replaced by the speedier PCI, developed by Intel.
44
2.2 Peripherals
2.2.3 Input/Output Devices
Input Devices
The most common input devices are the
mouse and the keyboard. With increased
available bandwidth and speed, and
decreased cost, other types of input devices
are becoming more widely used.
Example: Digital Camera ; Scanners ;
Digital Camcorders
45
Output Devices
CRT Monitors 、LCD Monitors 、Projectors
are typical devices to view outputs on a
screen.
There are a number of types of printers that
perform a variety of functions. Such as Ink
Printers ; Dye-Sublimation Printers ; Laser
Printers
46
• Cathode ray tube (CRT) monitors used to be the
most common type of computer monitors until LCD
monitors (discussed below) began to gain
popularity. CRT monitors use three electron beams
to create colors, red, green, and blue. To generate
the color white, all three beams are fired
simultaneously. To create the color black, all three
beams are turned off. Other colors are created
using different mixtures of these three color beams.
They are inexpensive and dependable for
displaying images on screen. Cathode ray tubes
are also found in conventional TV sets.
47
Hardware Systems
2.3 Storage Devices
• Why does a computer need to store files on a hard disk
drive? Why not keep everything in RAM memory?
• RAM memory is volatile
• hard disk drives are useful is that they have a much larger
capacity than RAM. A typical personal computer today will
have at least 128 megabytes of RAM memory and 40
gigabytes of disk storage.
• So, even though hard disk drives are slow as compared to
RAM, they are an important component of your computer
system.
Assessments:
• Multiple-Choice Quiz 6
48
2.3.1 Disk Controller Interfaces
There are many common interfaces to connect a storage
device to a computer.
Such as USB, FireWire, IDE, EIDE
 IDE Interface
An IDE is the interface that enables data to transfer
between storage devices and the chipset. IDE is
designed specifically as disk interface whereas USB and
FireWire can interface with other devices besides
storage devices such as digital cameras and printers.
An IDE interface provides a standard way for
storage devices to connect to a computer. The controller
for the IDE is usually integrated into the disk or CD-ROM
drive, and the controller directs how the hard drive stores
and accesses data.
49
50
 EIDE Master/Slave
 EIDE is Enhanced IDE, a newer version of the IDE
mass storage device interface standard.
 The EIDE interface provides a set of two IDE
ports. One is referred to as the primary port, the
other as the secondary.
 Each port attaches to a cable containing two plugs,
and each plug can connect to a device
 To distinguish between devices on the same IDE
port, one device is considered the master, the
other the slave, resulting in the following
designations: primary master, primary slave,
secondary master, and secondary slave.
51
Hardware Systems
2.3 Storage Devices
2.3.2 Mass Storage(大容量存储器)
How Mass Storage Devices Differ from RAM
•
•
•
•
•
•
slow access times and low transfer rates
located far from the processor
nonvolatile (非易失性)
huge capacities (海量)
cost per bit stored is far lower than RAM (价廉)
removable media
52
Disk Drive Reliability
• mean time between failures (MTBF)
Optical Media: CDs versus DVDs
Magnetic Media :range from some of the
smallest capacity storage devices, floppy
disks, to the largest capacity devices, hard
disk drives
53
Name
Type
Capacity
Writability
High-density floppy disk
Magnetic
1.44 MB
Unlimited
SmartMedia card
Solid state
2 - 256 MB
Many
CompactFlash card
Solid state
4 MB - 4 GB
Many
Super floppy
Magnetic
120 or 240 MB
Unlimited
USB storage device
Solid state
64, 128, 256 MB, or more
Many
CompactFlash form factor—Microdrive
Magnetic
340 MB, 1 GB, 4 GB
Unlimited
Iomega Zip disk
Magnetic
100, 250, or 750 MB
Unlimited
CD-ROM
Optical
650 or 700 MB
Read only
CD-R
Optical
650 or 700 MB
Write once
CD-RW
Optical
650 or 700 MB
Many
Iomega Jaz disk
Magnetic
1 or 2 GB
Unlimited
DVD-R
Optical
4.7 GB
Write once
DVD-RW
Optical
4.7 GB
Many
DVD-ROM (SLSS)
Optical
4.7 GB
Read only
DVD-ROM (DLSS or SLDS)
Optical
9.4 GB
Read only
DVD-ROM (DLDS)
Optical
18.8 GB
Read only
Hard disk drive
Magnetic
20 GB and up
Unlimited
HDD Desktop external hard drive
Magnetic
20, 30, 40 GB, or more
Unlimited54
Hardware Systems
2.4 Putting Together the Hardware Components
2.4.1 How Components Work Together
Learning Goal:
Knowledge of how components introduced
in this unit work with one another to enable a
computer to function
55
Overview of hardware components
56
• The CPU executes instructions stored in
memory devices. When the computer is
being booted, the CPU fetches instructions
from the permanent memory devices, ROM
and CMOS. ROM is read-only memory that
stores instructions needed to start up the
computer. CMOS contains system
configuration data. Once the computer is
booted, RAM is used to load the rest of the
instructions to be executed by the CPU.
57
• Data from storage devices such as the CD-ROM
drive and the hard drive are passed through the
disk controller. Data can also be stored on hard disk
or CD.
• Data in the hardware system passes through buses.
The buses are the communication channels among
components in the system unit.
• Peripheral devices such as the keyboard, mouse,
printer, speakers, etc. are connected to the
computer via ports typically in the back of a system
unit.
• When a computer processes requests from the user,
the CPU directs the other components to carry out
specific tasks, and data is passed among
components through buses and the chipset.
58
• Example:
• To save a file to hard disk, the CPU would pass the data to
be saved through the front bus to the chipset. The chipset
sends the file data via the PCI bus to the disk controller,
which would then send the data to the hard disk storage
device.
• To open and display an image file, the CPU would signal
the disk controller to fetch the image file on the storage
device and store it in RAM. The graphics card would then
access the image data and display the image as pixels on
the computer monitor.
• These are generalizations for how components interact.
When trying to understand a hardware system, keep in mind
the general concepts of how components work together, and
investigate the specifications of components to gain more
precise understanding of how a given hardware system
works.
59
2.4.2 Lab: Researching a Computer System
2.4.3 Lab: Online Configuration
You can research a computer system
using the Web by retrieving product
reviews and price comparisons .
60
Hardware Systems
2.5 Improving Computer Performance
• How do you measure computer performance?
• How is computer performance being improved?
• Reading Sequence:
• 2.5.1 Moore's Law.
• 2.5.2 Bottlenecks.
• Assessments:
• Multiple-Choice Quiz 7
61
2.5.1 Moore's Law
• With the exponential growth of transistor density
on microchips, many inferences can be made that
allow analysts to predict other developments in the
computer industry. Extending the scope of Moore's
Law, the following predictions can be made:
• Processing power (speed) doubles every 12-18
months.
• Storage capacity of RAM doubles every 12-18
months.
• Moore's Law, an example of exponential growth,
refers specifically to the capacity of microchips,
and the law might be stated this way: the number
of transistors that can be put on a microchip will
double every 12-18 months, until physical
limitations are reached.
62
• An interesting counter to improvements in capacity
and throughput is known as Parkinson's Law of
Data, which says that data expands to fill the
space available. In other words, as more memory
or disk space becomes available, the demand for
more memory or disk space increases accordingly.
• For example, when computers had only a few
kilobytes (KB) of memory, their simple OS fit in as
little as 4 KB. Today's microcomputers typically
have 128 MB or more of memory and, as
Parkinson's Law would predict, today's OS are
much more elaborate and require tens of
megabytes of memory for their own use.
63
2.5.2 Bottlenecks
• Bottlenecks—Slowing a Process
Wide-mouthed glasses empty their contents more
rapidly than bottles with long thin necks. To do any task,
many steps are involved. A bottleneck is a step that takes
a long time to complete, and thus reduces overall
performance. Just as in the adage “A chain is only as
strong as its weakest link,” it is true that a process‘s speed,
or throughput(吞吐量), is limited by its slowest step.
If other parts of your computer are too slow, buying a
faster processor may not speed things up at all!
64
• Typical Bottlenecks
The following are some areas of the hardware
system that may contain a bottleneck:
Cache RAM I/O Video card (particularly for 3-D
gaming)
 The cache slows the system down when there is not
enough cache. Faster processors requiring more data
input to run optimally may not receive enough data from
small caches.
 RAM loads instructions from programs on disk.
Therefore if there is not enough RAM memory,
instructions will need to be loaded frequently from disk
slowing down the execution of program instructions.
65
 I/O covers information transfer. Are the buses fast
enough? Is the hard drive fast enough? The
components may be able to send the data quickly
enough, but if the system cannot transfer the data just
as quickly, the system slows down.
 Most business users will not suffer from a slow video
card. Gamers, graphics designers, and some
engineers need high-speed video cards in order to
keep pace with the requirements of the software. The
average user does not need one of these video cards;
however, the slow 3-D rendering frame-rates
produced by slower cards may hamper(妨碍) the
performance of some applications.
66
• Eliminating Bottlenecks
– Can we speed up a computer? Actually it isn't
usually the computer that you want to speed
up, but the tasks it performs. This is an
important distinction. Speeding up the
computer suggests buying a faster processor,
installing faster memory, getting a faster bus,
or installing faster disk drives and video
controllers.
67
– The key to making effective improvements is
to understand why certain tasks take so long.
Often, you can do some simple experiments
to see whether or not a certain item is the
bottleneck. This idea is applied in a very
straightforward way by software developers,
who use profiling tools to measure how long
various sections of their programs take. That
way they can identify the bottlenecks and
most time-consuming steps, and focus their
attention on improving those portions of the
code.
68
Exercise 2
• Please answer the following question(s).
If the assessment includes multiple-choice
questions, click the "Submit Answers"
button when you have completed those
questions.
• Prerequisite: Exercise 1
• Direction: Use a word processor
(Microsoft Word) to answer the questions
in the exercise.
69
Exercise 2
• Question 1. Choosing Microprocessors
• The following processors are made by Intel:
• A. Mobile Intel® Pentium® 4 Processor with
Hyper-Threading Technology
Processor speed: 3.2GHz
Low power consumption
Level 2 cache: 512KB
System bus: 800 MHz
• B. Mobile Intel Pentium® 4 Processor-M
Processor speed: 2.8GHz
Level 2 512KB
System bus: 533 MHz
70
Exercise 2
• C. Intel Celeron®
Processor speed: 2.8 GHz
Level 2 128KB
System bus: up to 400 MHz
• You may find the following resources
useful:
• Intel Notebook Processors
• The CPU Scorecard
71
Exercise 2
• a. List the processors described above by their
price range (from the cheapest to the most
expensive).
• b. List the processors described above by their
performance (from the best to the worst).
• c. Which of the above processors would be the
fastest when used for multi-media production
and multi-tasking (running 10 or more
applications at the same time)?
72
Exercise 2
• Question 2. Computer Purchase
• Let us assume that you are purchasing a new
computer for a specific usage. You need to
choose a computer from various available
configurations.
• Listed below are four different usage cases of a
computer (a-d). For each usage case, identify
components of the computer configuration that
are most important to consider. Explain your
answers.
73
• Components to be considered include (but are not
limited to):
• Monitor size/resolution
• Graphics card/video card
• Storage devices (for example, DVD-ROM)
• Memory (RAM, cache, and hard disk)
• Disk controller interfaces (ATA, EIDE)
• For example, if a computer were to be used for viewing
movies, a DVD-ROM drive is needed since movies are
available as CDs and now increasingly as DVDs. A large
monitor (about 19”) that supports high resolutions and a
video card will also be necessary to enjoy the movie.
74
• a. Simultaneously running a number of
programs
• b. Running a speed-critical application
• c. Storing and retrieving huge volumes of
data
• d. Purchasing a basic configuration, to be
upgraded later as needed
75
• Question 3. Laptop Computer Selection
• You are a new graduate student enrolling in a
Masters in Information Technology program. The
department requires you to have a computer
with the following requirements:
• 512 MB of RAM
• 20 GB hard drive
• CD-ROM drive
• Wireless connection
• Ethernet network card
• Windows XP Professional version
76
• Your school has wireless connection, and Ethernet jacks.
However, some classes are three hours long, and your
AC adapter may not be long enough to reach an outlet.
You also would be carrying this computer around from
class to class.
• The most you can spend is US$1200.
• Indicate the range of values you desire for each of the
following criteria:
a. Weight
b. Screen size
c. Number of USB ports
d. Number of Firewire ports
e. Need CD-RW?
f. Need DVD-ROM?
g. Need DVD-RW?
h. Manufacturer preferences?
77
• i. Search the Internet for two suitable computers meeting
the above requirements and your budget constraint.
Submit screenshots of the Web pages detailing the
computer configuration and price.
• j. Record your search results in a MS Excel spreadsheet.
Fill column A with the following category labels:
• 1. Manufacturer
2. Processor
3. Memory (maximum upgrade capacity)
4. Screen size
5. Weight
6. Graphics card
7. USB
78
• 8. Firewire
9. CD-ROM
10. DVD-ROM
11. Communications (e.g. wireless, Ethernet)
12. Battery life
13. Price
14. Available Rebate
• Save and submit your Excel file.
• k. Make your final purchase decision and justify
your decision.
79
• Question 4. File Compression
• In this section, you will use a compression
algorithm to compress a message. Then you will
use a compression application to determine the
properties of compression.
• a. How does dictionary-based compression work?
• Use dictionary-based compression to compress
the message below:
sea shells, sea horses, and seals are in the sea.
80
• b. How many bytes does the message above
contain (each character is 1 byte including
spaces)?
• c. Create a compression dictionary and calculate
its size in bytes.
• d. What is the compressed the message?
• e. How many bytes did the entire compression
use?
• f. Is dictionary-based compression a lossy
compression? Explain.
81
• Copy and paste the entire content of this exercise into
Notepad and save it as compress0.txt
Compress this file using WinZip or any compression
application and name it compress1.zip. If you do not
have WinZip application installed on your computer, refer
to Appendix B. Downloading WinZip Appendix for
directions to download the application.
• g. What is the size of the file before and after
compression? What is the compression ratio of
compress1.zip to the original file?
• Compress compress1.zip and name it compress2.zip.
82
• h. What is the compression ratio of
compress2.zip to compress1.zip? Explain what
is happening. (Hint: think of information that
needs to be stored for a compression.)
• i. Is this a lossy or lossless compression? What
do you think would happen if you kept on
compressing the file successively?
• j. Is lossy compression appropriate for
compressing images? Is it appropriate for hard
disk backups? Provide explanations for both
parts.
83