Transcript CD-ROM

Computer Organization
Hardware and Software
Computing Systems
Computers have two kinds of components:
• Hardware, Hardware
Any machinery (most of which uses digital
circuits) that assists in the input, processing,
storage, and output activities of an information
system
consisting of its physical devices (CPU, memory,
bus, storage devices, ...)
• Software, consisting of the programs it has
(Operating system, applications, utilities, ...)
Computer Generations
Hardware
Software
1st
Vacuum Tubes machine language
2nd
Transistors
3rd
Integrated Chip (IC) Higher level languages,
4th
VLSI (Very Large Scale ICs) Object oriented
Assembly language
Application Programs
programming, natural language processing
•[email protected][email protected]
Sixth generation
of computers
(1990 -till date)
•[email protected]
The Binary System
Bits – Binary digits, or 0,1.
Bytes (8 bits) – ASCII, EBCDIC
One byte is the space needed to store one character,
like the letter “A”.
Kilobyte (KB) – 1000 (actually, 1024)
Megabyte (MB) – 1,000,000
Gigabyte (GB) – 1,000,000,000
Terabyte (TB) – 1,000,000,000,000
•[email protected]
Types of Computer Systems (1)
• Personal computers (PCs)
– Small, inexpensive, often called microcomputers
• Network computers
– Used for accessing networks, especially the Internet
• Workstations
– Fit between high-end microcomputers and low-end midrange
• Midrange (or ‘mini’) computers
– Size of a three drawer file cabinet and accommodates several users
at one time
• Mainframe computers
– Large and powerful, shared by hundreds concurrently
• Supercomputers
– Most powerful with fastest processing speeds
•[email protected]
Hardware Components
• Central processing unit (CPU)
– A hardware component that performs computing
functions utilizing the ALU, control unit, and
registers.
• Arithmetic/logic unit (ALU)
– Performs mathematical calculations and makes
logical comparisons
• Control unit(CU)
– Sequentially accesses program instructions, decodes
them, coordinates flow of data in/out of ALU,
registers, primary and secondary storage, and
various output devices
•[email protected]
Hardware Components
• Registers
– High-speed storage areas used to
temporarily hold small units of program
instructions and data immediately before,
during, and after execution by the CPU
• Primary storage
– Holds program instructions and data (a.k.a.
main memory)
•[email protected][email protected]
Hardware: CPU
Central Processing Unit (CPU):
– the “brain” of the machine
– location of circuitry that performs arithmetic and
logical ML statements
– measurement: speed (roughly) in megahertz
(millions of clock-ticks per second)
– examples: Intel Pentium, AMD K6, Motorola
PowerPC, Sun SPARC,
• CPU = Control Unit + ALU + Registers.
• Control unit: monitors and directs
sequences of instructions.
• ALU (Arithmetic-Logic Unit): performs
simple arithmetic and logical operations.
– Examples: Add, subtract, and, or, invert,
increment, etc.
A
B
R = A op B
select
ALU
R
•[email protected]
n-bits operations
• Registers: Fast memories in the CPU, storing
operands, temporary results and status
information.
• General-purpose registers and special
registers:
– PC (program counter)
– ACC (accumulator)
– IR (instruction register)
– MAR (memory address register)
– MBR (memory buffer register) or MDR (memory
data register)
•[email protected]
Program in
High-level language
(C, Pascal, etc)
Link multiple
machine-language programs
to one program
Compile program
into assembly language
Load program into
computer’s memory
Assemble program
to machine language
Execute program
•[email protected]
The organization of a simple computer with
one CPU and two I/O devices
•[email protected]
CPU Organization :
The data path of a typical Von Neumann machine
•[email protected]
Execution of an Instruction
• Machine cycle
– Instruction phase
– Execution phase
• Instruction phase
– Step 1: Fetch instruction
– Step 2: Decode instruction
• Execute phase
– Step 3: Execute instruction
– Step 4: Store results
•[email protected]
•Instruction execution cycle:
fetch, decode, execute.
•Fetch: fetch next instruction
(using PC) from memory into
IR.
•Decode: decode the
instruction.
•Execute: execute
instruction.
Instruction
Fetch
Instruction
Decode
Operand
Fetch
Execute
Result
Store
Next
•[email protected]
Instruction
Pipelining: A CPU operation in which multiple
execution phases are performed in a single
machine cycle
Machine Cycle Time
• Machine cycle time
– Time it takes to execute an instruction
• Slow machines
– Measured in microseconds (one-millionth of a second)
• Fast machines
– Measured in nanoseconds (one-billionth of a second) to
picoseconds (one-trillionth of a second)
• MIPS
– Millions of instructions per second
•[email protected]
Cycle Time:
Clock Speed:
• Clock speed
– Predetermined rate a CPU produces a series of
electronic pulses.
• Hertz (Hz)
– One cycle or pulse per second
• Megahertz (MHz)
– Millions of cycles per second
•[email protected]
Wordlength
• Wordlength
– Number of bits the CPU can process at any one time
• BIT
– ‘Binary digit’ - 0 or 1 that combine to form a “word”
• Computer word
– What the computer processes
• Microcode
– Predefined, elementary circuits and logical operations
that the processor performs when it executes an
instruction
•[email protected]
Instruction Execution Steps
•
Fetch next instruction from memory into instr. register
•
Change program counter to point to next instruction
•
Determine type of instruction just fetched
•
If instructions uses word in memory, determine where
Fetch word, if needed, into CPU register
•
Execute the instruction
•
Go to step 1 to begin executing following instruction
•[email protected]
Main memory :consists of a number of storage locations,
each of which is identified by a unique address
Types of main memory
There are two types of main memory, Random Access Memory (RAM) and Read Only Memory (ROM)
Types of RAM
.1- Dynamic Random Access Memory (DRAM)
Contents are constantly refreshed 1000 times per second
Access time 60 – 70 nanoseconds
Note: a nanosecond is one billionth of a second!
2-Synchronous Dynamic Random Access Memory (SDRAM)
Quicker than DRAM
Access time less than 60 nanoseconds
3-Direct Rambus Dynamic Random Access Memory (DRDRAM)
New type of RAM architecture
Access time 20 times faster than DRAM
More expensive
•[email protected]
4-Static Random Access Memory (SRAM)
Doesn’t need refreshing
Retains contents as long as power applied to the chip
Access time around 10 nanoseconds
Used for cache memory
Also for date and time settings as powered by small battery
5-Cache memory
Small amount of memory typically 256 or 512 kilobytes
Temporary store for often used instructions
Level 1 cache is built within the CPU (internal)
Level 2 cache may be on chip or nearby (external)
Faster for CPU to access than main memory
•[email protected]
6-Video Random Access memory
Holds data to be displayed on computer screen
Has two data paths allowing READ and WRITE to occur at the same time
A system’s amount of VRAM relates to the number of colours and resolution
A graphics card may have its own VRAM chip on board
7-Virtual memory
Uses backing storage e.g. hard disk as a temporary location for programs
and data where insufficient RAM available
Swaps programs and data between the hard-disk and RAM as the CPU
requires them for processing
A cheap method of running large or many programs on a computer system
Cost is speed: the CPU can access RAM in nanoseconds but hard-disk in
milliseconds (Note: a millisecond is a thousandth of a second)
Virtual memory is much slower than RAM
•[email protected]
Notes:Random Access Memory (RAM)
– “main” memory, which is fast, but volatile...
– analogous to a person’s short-term memory.
– many tiny “on-off” switches: for convenience
• “on” is represented by 1, “off” by 0.
– each switch is called a binary digit, or bit.
• 8 bits is called a byte.
• 210 bytes =1024 bytes is called a kilobyte (1K)
• 220 bytes is called a megabyte (1M).
There are two basic types of RAM:
dynamic RAM (DRAM)
static RAM (SRAM)
•[email protected]
2. CPU checks to see
whether
the
next
instruction it requires is in
cache
1. Cache fetches data
from next to current
addresses
in
main
memory
Cache
Main
Memory
Memory
(SRAM)
CPU
(DRAM)
4. If not, the CPU has to
fetch next instruction
from main memory - a
much slower process
•[email protected]
3. If it is, then the
instruction is fetched from
the cache – a very fast
position
= Bus connections
Read only memory (ROM)
• ROM holds programs and data permanently even when
computer is switched off
• Data can be read by the CPU in any order so ROM is also direct
access
• The contents of ROM are fixed at the time of manufacture
• Stores a program called the bootstrap loader that helps start
up the computer
• Access time of between 10 and 50 nanoseconds
•[email protected]
Types of ROM
• 1. Programmable Read Only Memory (PROM)
• Empty of data when manufactured
• May be permanently programmed by the user
2. Erasable Programmable Read Only Memory (EPROM)
• Can be programmed, erased and reprogrammed
• The EPROM chip has a small window on top allowing it to be erased by
shining ultra-violet light on it
• After reprogramming the window is covered to prevent new contents
being erased
• Access time is around 45 – 90 nanoseconds
•[email protected]
• 3. Electrically Erasable Programmable Read Only Memory
(EEPROM)
• Reprogrammed electrically without using ultraviolet light
• Must be removed from the computer and placed in a special machine
to do this
• Access times between 45 and 200 nanoseconds
4. Flash ROM
• Similar to EEPROM
• However, can be reprogrammed while still in the computer
• Easier to upgrade programs stored in Flash ROM
• Used to store programs in devices e.g. modems
• Access time is around 45 – 90 nanoseconds
5. ROM cartridges
• Commonly used in games machines
• Prevents software from being easily copied
•[email protected]
Storage
• Hard Drive
– 160 GB on upwards today
– As low as 256 KB less than 20 years ago!
• CD-ROM
– 600-700 MB
• DVD-ROM
– 4 GB - Red Laser, 27 GB- Blue Laser
• Flash Drives
– From 256 MB up to 100+ GB
•[email protected]
Memory Hierarchies
•[email protected]
•A five-level
memory hierarchy
Access Methods and Storage
Devices
• Sequential
– Data retrieved in the order stored.
• Direct
– Data retrieved without the need to read or pass
other data in sequence
• Storage Devices
– Sequential Access Storage Devices (SASDs)
– Direct Access Storage Devices (DASDs)
•[email protected][email protected]
Hardware (Disk)
Secondary Memory (Disk): Stores large amounts of
data, instructions, and information more
permanently than main memory
– Stable storage using magnetic or optical media.
– Analogous to a person’s long-term memory.
– Slower to access than RAM.
– Examples:
• floppy disk (measured in kilobytes)
• hard disk (measured in gigabytes (230 bytes))
• CD-ROM (measured in megabytes), ...
Devices for Secondary Storage
– Magnetic tape and disks
– Compact Disk Read-Only Memory (CD-ROM)
– Write Once Read Many - (WORM)
– Magneto-optical disks
– Redundant Array of Inexpensive Disks (RAID)
– Optical disks
– Digital Video Disks
– Memory cards
– Flash memory
– Removable storage
•[email protected]
Magnetic Disks (1)
•A portion of a disk track. Two sectors are illustrated
•[email protected]
Magnetic Disks (2)
•A disk with
four platters
•[email protected]
Magnetic Disks (3)
A disk with five zones. Each zone has many tracks.
•[email protected]
CD-ROMs (1)
•Recording structure of a Compact Disk or CD-ROM
•[email protected]
CD-ROMs (2)
•Logical data•[email protected]
layout on a CD-ROM
CD-Recordables
Cross section of a CD-R disk and laser (not to scale). A CD-ROM has a similar
structure, except without the dye layer and with a pitted aluminum layer instead of a
•[email protected]
reflective layer
DVD
•A double-sided,
dual layer DVD disk
•[email protected]
Comparison of Secondary
Storage Devices
•[email protected]
Hardware: the Bus
The Bus:Bus
Physical wiring connecting computer components
– Connects CPU to other hardware devices.
– Analogous to a person’s spinal cord.
– Speed measured in megahertz (like the CPU),
but typically much slower than the CPU...
– The bottleneck in most of today’s PCs.
• Bus width
– Number of bits a bus can transfer at one time
Hardware: Cache
While accessing RAM is faster than accessing
secondary memory, it is still quite slow,
relative to the rate at which the CPU runs.
To circumvent this problem, most systems add
a fast cache memory to the CPU, to store
recently used instructions and data.
(Assumption: Since such instructions/data
were needed recently, they will be needed
again in the near future.)
The cache is logically between the CPU and main
memory. Physically, there are several possible places
it could be located.
Cache memory
High speed memory that a processor can access
more rapidly than main memory
•[email protected]
Logical structure of a simple
personal computer
•[email protected]
Input and Output Devices
• Data entry
– The process by which human-readable data is
converted into a machine-readable form.
• Data input
– The process of transferring machine-readable data
into the computer system.
• Source data automation
– Capturing and editing data where the data is
originally created and in a form that can be directly
input to a computer
•[email protected]
Input Devices
•
PC input devices
•
Voice recognition devices
•
Digital computer cameras
•
Terminals
Keyboard, Mouse, Camera, Touch Pad
•
Scanning devices
•
Optical data readers
•
Magnetic Ink Character
•
Recognition (MICR)
•
Point Of Sale (POS) devicesAutomatic Teller Machine (ATM)
•
Pen input devices
•
Light pens
•
Touch sensitive screens
•
Bar code scanners
•[email protected]
Output Devices
Display monitors
Liquid Crystal Displays (LCDs)
Printers and plotters
Computer Output Microfilm (COM)
•[email protected]
Software: OS
The operating system (OS) is loaded from
secondary memory into main memory when
the computer is turned on, and remains in
memory until the computer is turned off.
Cache
Bus
CPU
RAM
OS
Disk