Cristian Hill
6.1
Mocking Mr. Rohol is fun
Introduction
The CPU performs most of the calculations on the PC
The CPU is a single chip on the motherboard
The motherboard houses the CPU,RAM, cache, memory, and data bus as well as connectors to other I/O devices
The CPU
Houses the… Control Unit (CU)
Program CounterInstruction RegisterMemory Address Register (MAR)
A decoder Arithmetic Logic Unit (ALU)
Accumulator
Cache
Decoder
Program Counter
Instruction Register (IR)
Accumulator
Control Unit (CU)
Memory Address Register (MAR)
Arithmetic Logic Unit
(ALU)
RAM
ROM
Memory (Address) Bus
Data Bus
Memory
RAM and ROM RAM is where current data and
executing program instructions are stored.
ROM Stores permanent operating system instructionsSuch as the boot code and other
instructions required to operate the computer
RAM Has address and contents per each
location The instructions and data are stored as
contentsInstructions are made of 2 parts, the opcode and
the operand The contents are transferred into the CPU
via the data and memory address bus RAM is a volatile storage area
It needs power to maintain is state
ROM
Information stored in ROM cannot be changed
The boot code starts automatically when the computer starts
Code that operates for each interrupt is stored the ROM in fixed positions
6.1.1/2
Cache
Decoder
Program Counter
Instruction Register (IR)
Accumulator
Control Unit (CU)
Memory Address Register (MAR)
Arithmetic Logic Unit
(ALU)
RAM
ROM
Memory (Address) Bus
Data Bus
The Control Unit Registers The Program Counter The Instructions Register The Memory Address Register
Program Counter
Holds the address of the next instructions in the program sequence
It is assumed to be the next instruction and is automatically incrementedThat is unless the executing instruction
modifies the contents via a jump or branch instruction
Automatic incrementing is a fundamental part of the design(architecture) of the chip
Instruction Register
Holds the Opcode for the instruction that is about to be executedE.g. ADD, MULT, STORE
Memory Address Register And the Accumulator Memory Address Register
Located in the CUHolds the operand of the data or the location
to be written
Accumulator:Located in the ALUHolds the ongoing total of any calculations
The Book Likes to Jump Around
The Instructions
Stored as machine code (binary) Ready to be executed directly by the
hadware Compilation converts source code into
machine code, line by line
Machine Code
Made of the opcode and the operand Can be writen in assembler language
that uses a mnemonic system Operands can be refered to by normal
variable type names 1:1 ratio between machine code and
assembler
6.1.3
The Basics Interrupts are how the processor handles
the demands of its processing time 2 types, hardware and software It is when the processor stops what it is
doing to complete another request When detected current states of resisters
are stored(PUSHED) onto a stack, the interrupt is executed, then processor returns to its prior state(POPPING)
Hardware Interrupts
Linked to the physical architecture of the computer
Allows the device to communicate and gain the attention of the processer when it wants to send or receive dataErrors would be a good example of this
Code to execute is stored in fixed positions starting from a fixed memory position
Software Interrupts
Similar to hardware interrupts except condition that needs responding to is generated by the processor
When an EVENT or EXCEPTION occurs that requires handling, software designed for it is executed
An offset position is required to access the interrupt software
Retrieve code for interrupt
B + O
Load into processor and execute
Interrupt Register
Offset (O)
Interrupt BaseB
Interrupt 1
Interrupt 3
Interrupt 2
6.1.4
The Fundamentals A bus is a set of parallel wires that allow
bits to be transmitted over one of the single wires.
Are ex/interally connected to the CPU and the I/O ports
2 main types within the CPU: Data Bus and Memory Bus
Data Bus
Moves data within the processor Is internally located E.G. STO Y - the contents of the
accumulator are shipped to the contents part of memory address Y…via the Data Bus
Memory Bus Moves memory addresses (the location) Used in tandem with a control bus to
synchronize the activity of the CPU Each wire matches to an individual bit in
the address or the contents of a memory locationBus determines the amount of memory that can
be addressedE.G. 32-bit computer needs a 32 bits wide
memory bus to enable all 232 memory addresses
The Role of Cache
A ‘speed up’ mechanism RAM memory made of faster than
normal memory chips Stores the most recently accessed
memory addresses and their contents CPU first looks to the Cache for
addresses
CPU RAMCache
Updating Cache
2 main algorithms:‘write-back’ – only updates changes‘write-through’ – updates data in cache and
main memory. Slower but safer.
Exercises!!!
Describe the function of… the accumulator the instruction register the interrupt register the program counter
6.2
Record data by magnetizing the binary code on the surface of a disk.
Data area is reusable Allows for both sequential and direct
access file organization. Built with multiple platters which use
both the top and bottom surfaces to read/write data. (Except for the top and bottom platter)
Hard Disk
Hard Disk
Disk is flexible and housed in a plastic case.
Operates on the same principle of a hard disk.
Has a single platter and is a convenient storage method.
Advantages-Cheap, Reasonable capacity for text based
storage Disadvantages-
Slow access, limited storage, disk is easily damaged.
Floppy Disk
Allows data to be read from CD-ROMs Data cannot be altered, only read by a
laser beam shining on the surface. Binary bit pattern is encoded at the time of
production (writing) by a stamping process. The plastic surface is stamped with ‘pit
areas’ and ‘land areas’ Pit areas absorb more laser light. Land
Areas reflect more light. Changes between pit to land or visa versa
represent binary ones and zeros.
Optical Disk Drive
Erasable optical disk that allows data to be read and written many times in a fashion much like the hard disk.
Magneto-Optical Disks
RAID- Redundant Array of Independent Disks’
Allows large amounts of storage that can be quickly accessed.
Provides a range of protective features. Data written to a RAID disk is spread
across a set of disks. Improves performance by taking advantage
of parallel access across many disks.
RAID
Can be combined with disk mirroring which provides a fault tolerance feature.
Disk mirroring- Data is written to multiple disks.Vital if the system needs continuous access.
RAID
6.2.1
The Block size determines the # of bytes that are read and written in a single physical read or write operation on a hard disk.
The Blocking Factor is usually more than one disk sector and is also known as ‘cluster size’.
Blocking
A disk surface is divided into a # of circular tracks which are divided into sectors.
Hard Disk Capacity is determined by the # of tracks per surface, # of sectors per track, and the # of bits or bytes per sector.
Sectors
A floppy disk has a single platter with a top and bottom surface.
A high density floppy has 160 tracks on 2 sides with 9 sectors per track and 512 bytes per sector.
Capacity = # of surfaces X # of tracks X # sectors per track X bytes per sector
Capacity = 2 surfaces X 160 tracks X 9 Sectors per track X 512 Bytes per sector
=1,474,560 bytes
Finding Capacity
Data can be stored around the tracks in the sectors.
Direct access is possible by specifying the require track and sector.
In this way data is retrieved without reference to other related data.
This is in contrast to sequential access. Data stored downwards in cylinders can be
retrieved using a parallel technique utilizing multiple read /write heads.
Accessing Data
Data is read and written to a disk sector by the use of read and write heads that are located on an arm.
The heads can be fixed or moveable. Fixed read/write arms can read many
sectors at one time down the cylinder in a parallel operation.
A moveable arm has one set of read/write heads which move across the surface of the disk.
Read/Write Heads
6.2.2
Made of two components-Seek Time and Latency Time
Seek Time -Occurs while the read/write arms seek the
desired track
Latency Time –Occurs as the head write arm waits for the
desired sector on the track to spin around
Disk Access Time
Access time can be specified as a relationship.
Access time = track seek wait time + sector wait latency time
Data on disks is accessed in times measured in terms of milliseconds.
Slower than the processing speeds of CPUs. I/O is still slow and does not match the speed improvement
of processors.
Disk Access Time
Exercises Outline how a disk drive operates Outline the role of the disk drive heads Define the term disk sector Defint the term cylinder Define the term ‘latency’ or ‘rotational delay’ Define the term ‘seek time’ How does seek time differ from access time Describe the access time to a hard disk with
reference to the latency and seek times