Top Banner
Cristian Hill
50

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.

Mar 26, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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.

Cristian Hill

Page 2: 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.

6.1

Page 3: 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.

Mocking Mr. Rohol is fun

Page 4: 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.

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

Page 5: 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 CPU

Houses the… Control Unit (CU)

Program CounterInstruction RegisterMemory Address Register (MAR)

A decoder Arithmetic Logic Unit (ALU)

Accumulator

Page 6: 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.

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

Page 7: 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.

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

Page 8: 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.

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

Page 9: 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.

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

Page 10: 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.

6.1.1/2

Page 11: 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.

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

Page 12: 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 Control Unit Registers The Program Counter The Instructions Register The Memory Address Register

Page 13: 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.

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

Page 14: 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.

Instruction Register

Holds the Opcode for the instruction that is about to be executedE.g. ADD, MULT, STORE

Page 15: 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.

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

Page 16: 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 Book Likes to Jump Around

Page 17: 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 Instructions

Stored as machine code (binary) Ready to be executed directly by the

hadware Compilation converts source code into

machine code, line by line

Page 18: 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.

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

Page 19: 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.
Page 20: 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.

6.1.3

Page 21: 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 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)

Page 22: 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.

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

Page 23: 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.

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

Page 24: 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.

Retrieve code for interrupt

B + O

Load into processor and execute

Interrupt Register

Offset (O)

Interrupt BaseB

Interrupt 1

Interrupt 3

Interrupt 2

Page 25: 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.

6.1.4

Page 26: 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 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

Page 27: 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.

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

Page 28: 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.

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

Page 29: 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 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

Page 30: 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.

Updating Cache

2 main algorithms:‘write-back’ – only updates changes‘write-through’ – updates data in cache and

main memory. Slower but safer.

Page 31: 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.

Exercises!!!

Describe the function of… the accumulator the instruction register the interrupt register the program counter

Page 32: 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.

6.2

Page 33: 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.

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

Page 34: 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.

Hard Disk

Page 35: 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.

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

Page 36: 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.

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

Page 37: 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.

Erasable optical disk that allows data to be read and written many times in a fashion much like the hard disk.

Magneto-Optical Disks

Page 38: 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.

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

Page 39: 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.

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

Page 40: 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.

6.2.1

Page 41: 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 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

Page 42: 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.

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

Page 43: 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.

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

Page 44: 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.

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

Page 45: 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.

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

Page 46: 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.

6.2.2

Page 47: 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.

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

Page 48: 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.

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

Page 49: 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.

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

Page 50: 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.