Professional Documents
Culture Documents
CHAPTER 1
Architecture is those attributes visible to the programmer Operations
(2) Storage
— Instruction set, number of bits used for data
representation, I/O mechanisms, addressing
techniques.
Structure is the way in which components relate to each Structure – Top Level
other Four Components:
1.Main Memory
Function is the operation of individual components as part 2.Central Processing Unit
of the structure 3.System Interconnection
4.Input / Output
• All computer functions are:
— Data processing Structure - The CPU
— Data storage 1.Registers
— Data movement 2.Arithmetic and Logic Unit (ALU)
— Data Control 3.Internal CPU Interconnection
4.Control Unit (CU)
Operations
(1) Data movement
CHAPTER 2
ENIAC – background Structure of IAS – detail
• Electronic Numerical Integrator And Computer (ENIAC)
• Eckert and Mauchly
• University of Pennsylvania
• Trajectory tables for weapons
• Started 1943 • Finished 1946 —Too late for war effort
• Used until 1955
ENIAC - details
• Decimal (not binary)
• 20 accumulators of 10 digits
• Programmed manually by switches
• 18,000 vacuum tubes
• 30 tons
• 15,000 square feet
• 140 kW power consumption
• 5,000 additions per second
Transistors
• Replaced vacuum tubes
• Smaller
• Cheaper
• Less heat dissipation
• Solid State device
• Made from Silicon (Sand)
• Invented 1947 at Bell Labs
• William Shockley et al.
IAS (Institute for Advance Studies) – details Transistor Based Computers
• 1000 x 40 bit words • Second generation machines
—Binary number • NCR & RCA produced small transistor machines
—2 x 20 bit instructions • IBM 7000
• DEC - 1957
• Set of registers (storage in CPU) —Produced PDP-1
Performance Mismatch
• Processor speed increased
• Memory capacity increased
• Memory speed lags behind processor speed
PCI Bus
• Peripheral Component Interconnection
• Intel released to public domain
• 32 or 64 bit
• 50 lines
Performance
• Access time
— Time between presenting the
address and getting the valid
data
• Memory Cycle time
— Time may be required for the
memory to “recover” before
next access
— Cycle time is access + recovery
• Transfer Rate
— Rate at which data can be moved
Organisation Cache
• Physical arrangement of bits into • Small amount of fast memory
words • Sits between normal main memory
• Not always obvious and CPU
• e.g. interleaved • May be located on CPU chip or
module
Chapter 5
Internal Memory
✓ Semiconductor Memory
• RAM
o Read/Write
o Volatile
o Temporary storage
o Static or dynamic
✓ DRAM Operation
• Address line active when bit read or written
• Write
• Read
▪ transistor turns on
✓ Static RAM
• Bits stored as on/off switches
• No charges to leak
• No refreshing needed when powered
• More complex construction
• Larger per bit
• More expensive
• Does not need refresh circuits
• Faster
• Cache
• Digital
o Uses flip-flops
✓ SRAM v DRAM
• Both volatile
• Dynamic cell
o More dense
o Less expensive
o Needs refresh
• Static
o Faster
o Cache
• Permanent storage
— Nonvolatile
• Library subroutines
• Function tables
✓ Types of ROM
• Written during manufacture
• Programmable (once)
o PROM
• Read “mostly”
▪ Erased by UV
o Flash memory
✓ Packaging
✓ Error Correction
• Hard Failure
o Permanent defect
• Soft Error
o Random, non-destructive
✓ RAMBUS
• Adopted by Intel for Pentium & Itanium
• Main competitor to SDRAM
• Vertical package – all pins on one side
• Data exchange over 28 wires < cm long
• Bus addresses up to 320 RDRAM chips at 1.6Gbps
• Asynchronous block protocol
✓ RAMBUS Diagram
Chapter 6
External Memory
1. Magnetic Disk
• Disk substrate coated with magnetizable material (iron oxide…rust)
• Substrate used to be aluminium
• Now glass
i. Increases reliability
d. Better stiffness
• Write
• Read (traditional)
• Read (contemporary)
✓ Disk Velocity
• Bit near centre of rotating disk passes fixed point slower than bit on outside of disk
• Increase spacing between bits in different tracks
• Rotate disk at constant angular velocity (CAV)
✓ Finding Sectors
• Must be able to identify start of track and sector
• Format disk
✓ Characteristics
• Fixed (rare) or movable head
• Removable or fixed
• Single or double (usually) sided
• Single or multiple platter
• Head mechanism
— Contact (Floppy)
— Fixed gap
Flying (Winchester)
✓ Removable or Not
• Removable disk
o Can be removed from drive and replaced with another disk
o Provides unlimited storage capacity
o Easy data transfer between systems
• Nonremovable disk
o Permanently mounted in the drive
✓ Multiple Platter
• One head per side
• Heads are joined and aligned
• Aligned tracks on each platter form cylinders
• Data is striped by cylinder
o reduces head movement
o Increases speed (transfer rate)
✓ Cylinders
✓ Floppy Disk
• 8”, 5.25”, 3.5”
• Small capacity
o Up to 1.44Mbyte (2.88M never popular)
• Slow
• Universal
• Cheap
• Obsolete?
✓ RAID
• Redundant Array of Independent Disks
• Redundant Array of Inexpensive Disks
• 6 levels in common use
• Not a hierarchy
• Set of physical disks viewed as single logical drive by O/S
• Data distributed across physical drives
• Can use redundant capacity to store parity information
✓ RAID 0
• No redundancy
• Data striped across all disks
• Round Robin striping
• Increase speed
o Multiple data requests probably not on same disk
o Disks seek in parallel
o A set of data is likely to be striped across multiple disks
✓ RAID 1
• Mirrored Disks
• Data is striped across disks
• 2 copies of each stripe on separate disks
• Read from either
• Write to both
• Recovery is simple
o Swap faulty disk & re-mirror
o No down time
o Expensive
✓ RAID 2
• Disks are synchronized
• Very small stripes
o Often single byte/word
• Error correction calculated across corresponding bits on disks
• Multiple parity disks store Hamming code error correction in corresponding
positions
• Lots of redundancy
o Expensive
o Not used
✓ RAID 3
• Similar to RAID 2
• Only one redundant disk, no matter how large the array
• Simple parity bit for each set of corresponding bits
• Data on failed drive can be reconstructed from surviving data and parity info
• Very high transfer rates
✓ RAID 4
• Each disk operates independently
• Good for high I/O request rate
• Large stripes
• Bit by bit parity calculated across stripes on each disk
Parity stored on parity disk
✓ RAID 5
• Like RAID 4
• Parity striped across all disks
• Round robin allocation for parity stripe
• Avoids RAID 4 bottleneck at parity disk
• Commonly used in network servers
• N.B. DOES NOT MEAN 5 DISKS!!!!!
✓ RAID 6
• Two parity calculations
• Stored in separate blocks on different disks
• User requirement of N disks needs N+2
• High data availability
o Three disks need to fail for data loss
o Significant write penalty
✓ RAID 0, 1, 2
✓ RAID 3 & 4
✓ RAID 5 & 6
✓ CD Operation
✓ CD-ROM Format
✓ Random Access on
CD-ROM
• Difficult
• Move head to rough position
• Set correct speed
• Read address
• Adjust to required location
• (Yawn!)
✓ DVD – technology
• Multi-layer
• Very high capacity (4.7G per layer)
• Full length movie on single disk
o Using MPEG compression
• Finally standardized (honest!)
• Movies carry regional coding
• Players only play correct region films
• Can be “fixed”
✓ DVD – Writable
• Loads of trouble with standards
• First generation DVD drives may not read first generation DVD-W disks
• First generation DVD drives may not read CD-RW disks
• Wait for it to settle down before buying!
✓ CD and DVD
✓ Magnetic Tape
• Serial access
• Slow
• Very cheap
• Backup and archive
CHAPTER 7
INPUT / OUTPUT
✓ Input/Output Problems
• Wide variety of peripherals
— Delivering different amounts of data
— At different speeds
— In different formats
• All slower than CPU and RAM
• Need I/O modules
✓ Input/Output Module
• Interface to CPU and Memory
• Interface to one or more peripherals
✓ Generic Model of I/O Module
✓ External Devices
• Human readable
— Screen, printer, keyboard
• Machine readable
— Monitoring and control
• Communication
— Modem
— Network Interface Card (NIC)
✓ I/O Steps
• CPU checks I/O module device status
• I/O module returns status
• If ready, CPU requests data transfer
• I/O module gets data from device
• I/O module transfers data to CPU
• Variations for output, DMA, etc.
✓ I/O Module Diagram
✓ I/O Commands
• CPU issues address
— Identifies module (& device if >1 per module)
• CPU issues command
— Control - telling module what to do
– e.g. spin up disk
— Test - check status
– e.g. power? Error?
— Read/Write
– Module transfers data via buffer from/to device
✓ Addressing I/O Devices
• Under programmed I/O data transfer is very like memory access (CPU viewpoint)
• Each device given unique identifier
• CPU commands contain identifier (address)
✓ I/O Mapping
• Memory mapped I/O
— Devices and memory share an address space
— I/O looks just like memory read/write
— No special commands for I/O
– Large selection of memory access commands available
• Isolated I/O
— Separate address spaces
— Need I/O or memory select lines
— Special commands for I/O
– Limited set
✓ Interrupt Driven I/O
• Overcomes CPU waiting
• No repeated CPU checking of device
• I/O module interrupts when ready
✓ Interrupt Driven I/O
Basic Operation
• CPU issues read command
• I/O module gets data from peripheral whilst CPU does other work
• I/O module interrupts CPU
• CPU requests data
• I/O module transfers data
✓ CPU Viewpoint
• Issue read command
• Do other work
• Check for interrupt at end of each instruction cycle
• If interrupted:-
— Save context (registers)
— Process interrupt
– Fetch data & store
• See Operating Systems notes
✓ Design Issues
• How do you identify the module issuing the interrupt?
• How do you deal with multiple interrupts?
— i.e. an interrupt handler being interrupted
✓ Identifying Interrupting Module (1)
• Different line for each module
— PC
— Limits number of devices
• Software poll
— CPU asks each module in turn
— Slow
✓ Identifying Interrupting Module (2)
• Daisy Chain or Hardware poll
— Interrupt Acknowledge sent down a chain
— Module responsible places vector on bus
— CPU uses vector to identify handler routine
• Bus Master
— Module must claim the bus before it can raise interrupt
— e.g. PCI & SCSI
✓ Multiple Interrupts
• Each interrupt line has a priority
• Higher priority lines can interrupt lower priority lines
• If bus mastering only current master can interrupt
✓ Example - PC Bus
• 80x86 has one interrupt line
• 8086 based systems use one 8259A interrupt controller
• 8259A has 8 interrupt lines
✓ Sequence of Events
• 8259A accepts interrupts
• 8259A determines priority
• 8259A signals 8086 (raises INTR line)
• CPU Acknowledges
• 8259A puts correct vector on data bus
• CPU processes interrupt
✓ 82C59A Interrupt
Controller
✓ Intel 82C55A
Programmable Peripheral Interface
✓ InfiniBand Operation
• 16 logical channels (virtual lanes) per physical link
• One lane for management, rest for data
• Data in stream of packets
• Virtual lane dedicated temporarily to end to end transfer
• Switch maps traffic from incoming to outgoing lane
✓ InfiniBand Protocol Stack
✓ Foreground Reading
• Check out Universal Serial Bus (USB)
• Compare with other communication standards e.g. Ethernet
• Convenience
—Making the computer easier to use
• Efficiency
—Allowing better use of computer resources
✓ Layers and Views of a Computer System
✓ Operating System Services
• Program creation
• Program execution
• Access to I/O devices
• Controlled access to files
• System access
• Error detection and response
• Accounting
✓ Multi-Programming with
Two Programs
✓ Multi-Programming with
Three Programs
✓ Utilization
✓ PCB Diagram
✓ Memory Management
• Uni-program
—Memory split into two
—One for Operating System (monitor)
—One for currently executing program
• Multi-program
—“User” part is sub-divided and shared among active
processes
✓ Swapping
• Problem: I/O is so slow compared with CPU that even in multi-
programming system, CPU can be idle most of the time
• Solutions:
—Increase main memory
– Expensive
– Leads to larger programs
—Swapping
✓ What is Swapping?
• Long term queue of processes stored on disk
• Processes “swapped” in as space becomes available
• As a process completes it is moved out of main memory
• If none of the processes in memory are ready (i.e. all I/O blocked)
—Swap out a blocked process to intermediate queue
—Swap in a ready process or a new process
—But swapping is an I/O process...
✓ Partitioning
• Splitting memory into sections to allocate to processes (including
Operating System)
• Fixed-sized partitions
—May not be equal size
—Process is fitted into smallest hole that will take it (best fit)
—Some wasted memory
—Leads to variable sized partitions
✓ Fixed
Partitioning
✓ Relocation
• No guarantee that process will load into the same place in memory
• Instructions contain addresses
—Locations of data
—Addresses for instructions (branching)
• Logical address - relative to beginning of program
• Physical address - actual location in memory (this time)
• Automatic conversion using base address
✓ Paging
• Split memory into equal sized, small chunks -page frames
• Split programs (processes) into equal sized small chunks - pages
• Allocate the required number page frames to a process
• Operating System maintains list of free frames
• A process does not require contiguous page frames
• Use page table to keep track
✓ Virtual Memory
• Demand paging
—Do not require all pages of a process in memory
—Bring in pages as required
• Page fault
—Required page is not in memory
—Operating System must swap in required page
—May need to swap out a page to make space
—Select page to throw out based on recent history
✓ Thrashing
• Too many processes in too little memory
• Operating System spends all its time swapping
• Little or no real work is done
• Disk light is on all the time
• Solutions
—Good page replacement algorithms
—Reduce number of processes running
—Fit more memory
✓ Bonus
• We do not need all of a process in memory for it to run
• We can swap in pages as required
• So - we can now run processes that are bigger than total memory
available!
• Main memory is called real memory
• User/programmer sees much bigger memory - virtual memory
✓ Segmentation
• Paging is not (usually) visible to the programmer
• Segmentation is visible to the programmer
• Usually different segments allocated to program and data
• May be a number of program and data segments
✓ Advantages of Segmentation
• Simplifies handling of growing data structures
• Allows programs to be altered and recompiled independently,
without re-linking and re-loading
• Lends itself to sharing among processes
• Lends itself to protection
• Some systems combine segmentation with paging
Pentium II
• Hardware for segmentation and paging
• Unsegmented unpaged
—virtual address = physical address
—Low complexity
—High performance
• Unsegmented paged
—Memory viewed as paged linear address space
—Protection and management via paging
—Berkeley UNIX
• Segmented unpaged
—Collection of local address spaces
—Protection to single byte level
—Translation table needed is on chip when segment is in
memory
• Segmented paged
—Segmentation used to define logical memory partitions
subject to access control
—Paging manages allocation of memory within partitions
—Unix System V
✓ Pentium II Protection
• Protection bits give 4 levels of privilege
—0 most protected, 3 least
—Use of levels software dependent
—Usually level 3 for applications, level 1 for O/S and level 0 for
kernel (level 2 not used)
—Level 2 may be used for apps that have internal security e.g.
database
—Some instructions only work in level 0
✓ Pentium II Paging
• Segmentation may be disabled
—In which case linear address space is used
• Two level page table lookup
—First, page directory
– 1024 entries max
– Splits 4G linear memory into 1024 page groups of 4Mbyte
– Each page table has 1024 entries corresponding to 4Kbyte
pages
– Can use one page directory for all processes, one per
process or mixture
– Page directory for current process always in memory
—Use TLB holding 32 page table entries
—Two page sizes available 4k or 4M
✓ PowerPC Memory Management Hardware
• 32 bit – paging with simple segmentation
—64 bit paging with more powerful segmentation
• Or, both do block address translation
—Map 4 large blocks of instructions & 4 of memory to bypass
paging
—e.g. OS tables or graphics frame buffers
• 32 bit effective address
—12 bit byte selector
– =4kbyte pages
—16 bit page id
– 64k pages per segment
—4 bits indicate one of 16 segment registers
– Segment registers under OS control
✓ PowerPC 32-bit Memory Management Formats