27
Or ganisasi dan Arsitektur Or ganisasi dan Arsitektur Komputer Komputer Pertemuan 2 Instruction Set Architectur e

2-Instruction Set Architecture

Embed Size (px)

Citation preview

Page 1: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 1/27

Organisasi dan ArsitekturOrganisasi dan Arsitektur

KomputerKomputerPertemuan 2

Instruction Set Architecture

Page 2: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 2/27

What is a program?What is a program?

A sequence of stepsFor each step, an arithmetic or

logical operation is done

For each operation, a differentset of control signals is needed

Page 3: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 3/27

Computer Components:Top LevelComputer Components:Top Level

ViewView

Page 4: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 4/27

Instruction CycleInstruction Cycle

 Two steps:◦ Fetch

◦ Execute

Page 5: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 5/27

Fetch CycleFetch Cycle

Program Counter (PC) holds addressof next instruction to fetchProcessor fetches instruction from

memory location pointed to by PCIncrement PC◦ Unless told otherwise

Instruction loaded into Instruction

Register (IR)Processor interprets instruction and

performs required actions

Page 6: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 6/27

Execute CycleExecute Cycle

Processor-memory◦ data transfer between CPU and main

memory

Processor I/O◦ Data transfer between CPU and I/O

module

Data processing◦

Some arithmetic or logical operation ondata

Control◦ Alteration of sequence of operations

◦ e.g. jump

Page 7: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 7/27

Example of ProgramExample of Program

ExecutionExecution

Page 8: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 8/27

Instruction Cycle -Instruction Cycle -

State DiagramState Diagram

Page 9: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 9/27

InterruptsInterrupts

Mechanism by which other modules (e.g. I/O) mayinterrupt normal sequence of processing

Program Timer

◦ Generated by internal processor timer

◦ Used in pre-emptive multi-tasking

I/O◦ from I/O controller

Hardware failure◦ e.g. memory parity error

Page 10: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 10/27

Program Flow ControlProgram Flow Control

Page 11: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 11/27

Interrupt CycleInterrupt Cycle

Added to instruction cycle

Processor checks for interrupt

◦ Indicated by an interrupt signal

If no interrupt, fetch next instruction If interrupt pending:

◦ Suspend execution of current program

◦ Save context

Set PC to start address of interrupt handler routine◦ Process interrupt

◦ Restore context and continue interrupted program

Page 12: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 12/27

 Transfer of Control via Transfer of Control via

InterruptsInterrupts

Page 13: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 13/27

Instruction Cycle withInstruction Cycle with

InterruptsInterrupts

Page 14: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 14/27

Instruction Cycle (withInstruction Cycle (with

Interrupts) - State DiagramInterrupts) - State Diagram

Page 15: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 15/27

Memory ConnectionMemory Connection

Receives and sends dataReceives addresses (of locations)

Receives control signals

◦ Read

◦ Write

◦ Timing

Page 16: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 16/27

Input/Output ConnectionInput/Output Connection

Similar to memory fromcomputer’s viewpoint

Output

◦ Receive data from computer

◦ Send data to peripheral

Input

◦ Receive data from peripheral◦ Send data to computer

Page 17: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 17/27

CPU ConnectionCPU Connection

Reads instruction and dataWrites out data (after processing)

Sends control signals to other

unitsReceives (& acts on) interrupts

Page 18: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 18/27

BusesBuses

 There are a number of possibleinterconnection systems

Single and multiple BUS

structures are most commone.g. Control/Address/Data bus

(PC)

Page 19: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 19/27

What is a Bus?What is a Bus?

A communication pathwayconnecting two or more devices

Usually 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: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 20/27

Data BusData Bus

Carries 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: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 21/27

Address busAddress bus

Identify the source or destinationof data

e.g. CPU needs to read an

instruction (data) from a givenlocation in memory

Bus width determines maximum

memory capacity of system◦ e.g. 8080 has 16 bit address bus

giving 64k address space

Page 22: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 22/27

Control BusControl Bus

Control and timing information◦ Memory read/write signal

◦ Interrupt request

◦ Clock signals

Page 23: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 23/27

Bus InterconnectionBus Interconnection

SchemeScheme

Page 24: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 24/27

Big and Yellow?Big and Yellow?

What do buses look like?◦ Parallel lines on circuit boards

◦ Ribbon cables

◦ Strip connectors on mother boardse.g. PCI

◦ Sets of wires

Page 25: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 25/27

 Traditional (ISA) Traditional (ISA)

(with cache)(with cache)

Page 26: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 26/27

 Tugas (1) Tugas (1)

1.  Jelaskan mengapa keberadaancache dapat meningkatkanperforma komputer!

2.  Jelaskan fungsi setiap komponendi dalam CPU!

3.  Jelaskan secara lengkap

mengenai Instruction Cycle padaCPU!

Page 27: 2-Instruction Set Architecture

8/3/2019 2-Instruction Set Architecture

http://slidepdf.com/reader/full/2-instruction-set-architecture 27/27

 Tugas (2) Tugas (2)

1. Dikumpulkan dalam bentukhardcopy.

2. Deadline: pertemuan minggu

depan.3. Sertakan Nama dan NIM.

4.  Tugas bersifat perseorangan.