Computer Microprocessor Architecture & Programming...

36
UTM-RHH Slide Set 3 1 Computer Microprocessor Architecture & Programming HCA1109 System Buses

Transcript of Computer Microprocessor Architecture & Programming...

Page 1: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 1

Computer Microprocessor Architecture & Programming

HCA1109

System Buses

Page 2: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 2

Program ConceptHard-wired systems are inflexibleGeneral purpose hardware can do different tasks, given correct control signalsInstead of re-wiring, supply a new set of control signals

Page 3: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 3

What is a program?A sequence of stepsFor each step, an arithmetic or logical operation is doneFor each operation, a different set of control signals is needed

Page 4: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 4

Function of Control UnitFor each operation a unique code is provided– e.g. ADD, MOVEA hardware segment accepts the code and issues the control signals

We have a computer!

Page 5: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 5

ComponentsThe Control Unit and the Arithmetic and Logic Unit constitute the Central Processing UnitData and instructions need to get into the system and results out– Input/outputTemporary storage of code and results is needed– Main memory

Page 6: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 6

Computer Components: Top Level View

Page 7: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 7

Instruction CycleTwo steps:– Fetch– Execute

Page 8: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 8

Fetch CycleProgram Counter (PC) holds address of next instruction to fetchProcessor fetches instruction from memory location pointed to by PCIncrement PC– Unless told otherwiseInstruction loaded into Instruction Register (IR)Processor interprets instruction and performs required actions

Page 9: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 9

Execute CycleProcessor-memory– data transfer between CPU and main memoryProcessor I/O– Data transfer between CPU and I/O moduleData processing– Some arithmetic or logical operation on dataControl– Alteration of sequence of operations e.g. jumpCombination of above

Page 10: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 10

Example of Program Execution

Page 11: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 11

Instruction Cycle - State Diagram

Page 12: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 12

ConnectingAll the units must be connectedDifferent type of connection for different type of unit– Memory– Input/Output– CPU

Page 13: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 13

Computer Modules

Page 14: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 14

Memory ConnectionReceives and sends dataReceives addresses (of locations)Receives control signals – Read– Write– Timing

Page 15: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 15

Input/Output Connection (1)Similar to memory from computer’s viewpointOutput– Receive data from computer– Send data to peripheralInput– Receive data from peripheral– Send data to computer

Page 16: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 16

Input/Output Connection (2)Receive control signals from computerSend control signals to peripherals– e.g. spin diskReceive addresses from computer– e.g. port number to identify peripheralSend interrupt signals (control)

Page 17: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 17

CPU ConnectionReads instruction and dataWrites out data (after processing)Sends control signals to other unitsReceives (& acts on) interrupts

Page 18: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 18

BusesThere are a number of possible interconnection systemsSingle and multiple BUS structures are most commone.g. Control/Address/Data bus (PC)e.g. Unibus (DEC-PDP)

Page 19: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 19

What is a Bus?A communication pathway connecting two or more devicesUsually broadcast Often grouped– A number of channels in one bus– e.g. 32 bit data bus is 32 separate single bit channelsPower lines may not be shown

Page 20: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 20

Data BusCarries data– Remember that there is no difference between “data” and “instruction” at this levelWidth is a key determinant of performance– 8, 16, 32, 64 bit

Page 21: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 21

Address busIdentify the source or destination of datae.g. CPU needs to read an instruction (data) from a given location in memoryBus width determines maximum memory capacity of system– e.g. 8080 has 16 bit address bus giving 64k address space

Page 22: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 22

Control BusControl and timing information– Memory read/write signal– Interrupt request– Clock signals

Page 23: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 23

Bus Interconnection Scheme

Page 24: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 24

Big and Yellow?What do buses look like?– Parallel lines on circuit boards– Ribbon cables– Strip connectors on mother boards

• e.g. PCI– Sets of wires

Page 25: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 25

Single Bus ProblemsLots of devices on one bus leads to:– Propagation delays

• Long data paths mean that co-ordination of bus use can adversely affect performance• If aggregate data transfer approaches bus capacityMost systems use multiple buses to overcome these problems

Page 26: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 26

Traditional (ISA) with cache

Page 27: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 27

High Performance Bus

Page 28: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 28

Bus TypesDedicated– Separate data & address linesMultiplexed– Shared lines– Address valid or data valid control line– Advantage - fewer lines– Disadvantages

• More complex control• Ultimate performance

Page 29: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 29

Bus ArbitrationMore than one module controlling the buse.g. CPU and DMA controllerOnly one module may control bus at one timeArbitration may be centralised or distributed

Page 30: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 30

Centralised ArbitrationSingle hardware device controlling bus access– Bus Controller– ArbiterMay be part of CPU or separate

Page 31: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 31

Distributed ArbitrationEach module may claim the busControl logic on all modules

Page 32: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 32

PCI BusPeripheral Component InterconnectionIntel released to public domain32 or 64 bit50 lines

Page 33: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 33

PCI Bus Lines (required)Systems lines– Including clock and resetAddress & Data– 32 time mux lines for address/data– Interrupt & validate linesInterface ControlArbitration– Not shared– Direct connection to PCI bus arbiterError lines

Page 34: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 34

PCI Bus Lines (Optional)Interrupt lines– Not sharedCache support64-bit Bus Extension– Additional 32 lines– Time multiplexed– 2 lines to enable devices to agree to use 64-bit transfer

Page 35: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 35

PCI CommandsTransaction between initiator (master) and targetMaster claims busDetermine type of transaction– e.g. I/O read/writeAddress phaseOne or more data phases

Page 36: Computer Microprocessor Architecture & Programming HCA1109rishiheerasing.net/modules/hca1109/ln/ss3.pdf · System Buses. UTM-RHH Slide Set 3 2 Program Concept Hard-wired systems are

UTM-RHH Slide Set 3 36

ReadingsStallings, chapter 3www.pcguide.com/ref/mbsys/buses/www.pcguide.com