Docsity

Processor Organization - Intro to Computer Architecture - Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Processor Organization - Intro to Computer Architecture - Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

ECE 366 -- Computer Architecture

Lecture Notes # 6

How to Add To & Use the Basic

Processor Organization To Execute

Different Instructions

Instruction: lw ri x(16-bit offset) [r1 <= MEM[PC+X]

  • Determine Phases (each may take >= 1cc and may be

further decomposed):

  • 1. Instruction Fetch: Same for all instr. of the same size (32 bits

here)

  • 2. Decode & Incr. PC (same as before). Note that X is offset from

new PC value

  • 3. Compute the address (PC+x) of the data to be fetched
    • Requirements & Options:

(I) F.U.: (a) Adder: Use adders avail (which?) OR Put in a new

adder. (b) Need a sign extender for X (16 to 32 bits)

(II) Registers: A data address reg. to store PC+X

(III) (a) Connections from PC & X to Adder; (b) Connection from

MAR to mem. address bus

Instruction Processing: Phase 1 -- Fetch

Instruction: lw ri x(16-bit offset) [r1 <= MEM[PC+x]

Memory Interface (Addr. + Data Bus)

PC IR
C.U.
FSM

PC

Upd.

Data Memory

Memory Interface (Buses + Regs)

Register

File

ALU

O/P Reg.

Instruction Memory

Connect PC to

Addr. Bus &

Read Mem.

Onto Data Bus

Load IR when

Instr. Avail

[IR <= Data Bus]

Status signals

Source & dest reg addr

[PC=>Addr Bus; Mem[PC] => Data Bus]

Instruction Processing: Phase 2 -- Decode & Incr. PC

Instruction: lw ri x(16-bit offset) [r1 <= MEM[PC+x]

Memory Interface (Addr. Bus)

PC IR
C.U.
FSM

PC

Upd.

Data Memory

Memory Interface (Buses + Regs)

Register

File

ALU

O/P Reg.

Instruction Memory

Start State for lw

Decode State

Load PC w/ o/p

of Update H/W

[PC <= PC Upd o/p]

Adding extra hardware for PC+X: Design 1

Design 1: Put in extra adder---(a) Expensive in logic and

interconnects; (b) Time = 1cc (if + takes 1cc)

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

.

MUX

Instruction Processing: PC+X :Phase 3--Design 1

1cc operation (if + takes 1 cc)

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

.

MUX

Instruction Processing: PC+X :Phase 3(a)--Design 2

3cc entire operation: Phase 3(a) Load offset and PC in ALU reg (1cc)

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

.

MUX

MUX (^) MUX

Select offset, PC

Load ALU regs

Instruction Processing: PC+X :Phase 3(b)--Design 2

3cc entire operation: Phase 3(b) ADD in ALU, Load o/p reg. (1cc if + is

1cc)

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

.

MUX

MUX (^) MUX

.

Select Add

Load o/p reg.

Adding extra hardware for PC+X: Design 3

Design 3: Use PC adder---(a) Slightly less expensive than opt. 2; (b)

Time = 1cc (if + takes 1cc)

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

MUX

MUX

Instruction Processing: PC+X :Phase 3--Design 3

1cc operation (if + takes 1cc)

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

MUX

MUX

Instruction Processing: PC+X :Phase 3(a)--Design 4

5 cc entire operation: Phase 3(a): Load scratchpad reg0 (sr0) from PC -- 1cc

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

Write Bus

Instruction Processing: PC+X :Phase 3(b)--Design 4

5 cc entire operation: Phase 3(b): Load scratchpad reg1 (sr1) from offset-- 1cc

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

Write Bus

Instruction Processing: PC+X :Phase 3(d)--Design 4

5 cc entire operation: Phase 3(d): ADD and load o/p reg.

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

Write Bus

Select Add

Load o/p reg.

Instruction Processing: PC+X :Phase 3(e)--Design 4

5 cc entire operation: Phase 3(d): Read o/p reg. to WB, load MAR --1cc

C.U.
FSM

.

Data Memory

Memory Interface (Data Bus)

Register

File

ALU

O/P Reg.

Status signals

Memory Interface (Addr. + Data Bus)

PC IR

Instruction Memory

Source & dest reg addr

MDR
MAR

16->32 ext.

16

32

Write Bus