Processor Design Part 2-Assembly Language Programming-Lecture Slides, Slides of Assembly Language Programming

This lecture was delivered by Mr. Gurpreet Verma at Cochin University of Science and Technology for Assembly Language Programming course. It includes: Abstract, Crtical, Perform, Meaning, Connections, Calculate, Fetch, jump, Except, Datapath, Store, Contol

Typology: Slides

2011/2012

Uploaded on 07/26/2012

parinita
parinita 🇮🇳

4.8

(6)

67 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 5.2 - Processor Design 2 1
Summary: A Single Cycle Datapath
imm16
32
ALUctr
Clk
busW
RegWr
32
32
busA
32
busB
55 5
Rw Ra Rb
32 32-bit
Registers
Rs
Rt
Rt
Rd
RegDst
Extender
Mux
32
16
imm16
ALUSrc
ExtOp
Mux
MemtoReg
Clk
Data In WrEn
32 Adr
Data
Memory
MemWr
ALU
Equal
Instruction<31:0>
0
1
0
1
0
1
<21:25>
<16:20>
<11:15>
<0:15>
Imm16RdRtRs
=
Adder Adder
PC
Clk
00
Mux
4
nPC_sel
PC Ext
Adr
Inst
Memory
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download Processor Design Part 2-Assembly Language Programming-Lecture Slides and more Slides Assembly Language Programming in PDF only on Docsity!

Chapter 5.2 - Processor Design 2

Summary: A Single Cycle Datapath

imm

ALUctr

Clk RegWrbusW^32

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst

Extender

Mux

32

imm

ALUSrc

ExtOp

Mux MemtoReg

Clk Data In

WrEn

Adr DataMemory MemWr ALU

Equal

Instruction<31:0>

Imm Rd Rt Rs

Adder Adder

(^00) PC Clk^

Mux

nPC_sel

PC Ext

Adr Inst Memory

Chapter 5.2 - Processor Design 2

An Abstract View of the Critical Path

-^

Register file and ideal memory:

  • The CLK input is a factor ONLY during write operation– During read operation, behave as combinational logic: -^

Address valid => Output valid after “access time.”

Critical Path (Load Operation) =

PC’s Clk-to-Q +Instruction Memory’s Access Time +Register File’s Access Time +ALU to Perform a 32-bit Add +Data Memory Access Time +Setup Time for Register File Write +Clock Skew

Clk

5 Rw

Ra

Rb

32 32-bitRegisters Rd

ALU

Clk DataAddressDataIn

IdealDataMemory

Instruction

Instruction

Address

Ideal InstructionMemory^ Clk

PC

Rs^5

Rt^5

Imm^16

A B

Next Address

Chapter 5.2 - Processor Design 2

An Abstract View of the Implementation

DataOut

(^5) Clk Rw

Ra

Rb

32 32-bitRegisters Rd

ALU

Clk DataAddressDataIn

IdealDataMemory

Instruction

Instruction

Address

Ideal InstructionMemory^ Clk

PC

Rs^5

Rt^5

A B

Next Address

ControlControl Signals Datapath

Conditions

Chapter 5.2 - Processor Design 2

Recap: A Single Cycle Datapath

-^

Rs, Rt, Rd and Imed16 hardwired into datapath from Fetch Unit

-^

We have everything except control signals (underline)^ – Today’s lecture will show you how to generate the control signals

ALUctr

Clk busW

RegWr 32

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst

Extender

Mux

Mux

imm

ALUSrc

ExtOp

MemtoRegMux

Clk

Data In

WrEn

32

Adr DataMemory

MemWr

ALU

InstructionFetch Unit

Clk

Zero

Instruction<31:0>

Imm Rd Rs Rt

nPC_sel

Chapter 5.2 - Processor Design 2

Recap: Meaning of the Control Signals

-^

ExtOp:

“zero”, “sign”

-^

ALUsrc:

regB; 1

immed

-^

ALUctr:

“add”, “sub”, “or”

°^

MemWr:

write memory

°^

MemtoReg:

ALU; 1

Mem

°^

RegDst:

“rt”; 1

“rd”

°^

RegWr:

write register

ALUctr

Clk RegWr busW^32

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst

Extender

Mux

32

imm

ALUSrc

ExtOp

Mux MemtoReg

Clk Data In

WrEn

Adr DataMemory MemWr ALU

Equal

Chapter 5.2 - Processor Design 2

The

add

Instruction

add rd, rs, rt

mem[PC]

Fetch the instruction from memory

R[rd]

R[rs] + R[rt]

The actual operation

PC

PC + 4

Calculate the next instruction’s address

op

rs^

rt^

rd

shamt

funct

6 bits

6 bits

5 bits

5 bits

5 bits

5 bits

Chapter 5.2 - Processor Design 2

The Single Cycle Datapath during

add

-^

R[rd]

R[rs] + R[rt]

op

rs^

rt^

rd

shamt

funct

ALUctr = Add

Clk RegWr = 1 busW

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst = 1

Extender

Mux

Mux

imm

ALUSrc = 0

ExtOp = x

Mux MemtoReg = 0

Clk

Data In

WrEn

32

Adr DataMemory

MemWr = 0

ALU

InstructionFetch Unit

Clk

Zero

Instruction<31:0>

Imm Rd Rs Rt

nPC_sel= +

Chapter 5.2 - Processor Design 2

Instruction Fetch Unit at the End of

add

-^

PC

PC + 4

  • This is the same for all instructions except: Branch and Jump

Adr Inst Memory

Adder

Adder

PC

Clk

Mux

nPC_sel

imm

Instruction<31:0>

Chapter 5.2 - Processor Design 2

The Single Cycle Datapath during Or Immediate

-^

R[rt]

R[rs]

or

ZeroExt(Imm16)

op

rs^

rt^

immediate

ALUctr = Or

Clk busW

RegWr = 1^32

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst = 0

Extender

Mux

Mux

imm

ALUSrc = 1

ExtOp = 0

Mux MemtoReg = 0

Clk

Data In

WrEn

32

Adr DataMemory

MemWr = 0

ALU

InstructionFetch Unit

Clk

Zero

Instruction<31:0>

Imm Rd Rs Rt

nPC_sel= +

Chapter 5.2 - Processor Design 2

The Single Cycle Datapath during Load

-^

R[rt]

Data Memory {R[rs] + SignExt[imm16]}

op

rs^

rt^

immediate

ALUctr =

Add

Clk busW

RegWr = 1^32

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst = 0

Extender

Mux

Mux

imm

ALUSrc = 1

ExtOp = 1

Mux MemtoReg = 1

Clk

Data In

WrEn

32

Adr DataMemory

MemWr = 0

ALU

InstructionFetch Unit

Clk

Zero

Instruction<31:0>

Imm Rd Rs Rt

nPC_sel= +

Chapter 5.2 - Processor Design 2

The Single Cycle Datapath during Store

Instruction<31:0>

-^

Data Memory {R[rs] + SignExt[imm16]}

R[rt]

op

rs^

rt^

immediate

ALUctr =

Add

Clk RegWr = 0 busW

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst = x

Extender

Mux

Mux

imm

ALUSrc = 1

ExtOp = 1

Mux MemtoReg = x

Clk

Data In

WrEn

32

Adr DataMemory

MemWr = 1

ALU

InstructionFetch Unit

Clk

Zero

Imm Rd Rs Rt

nPC_sel= +

Chapter 5.2 - Processor Design 2

The Single Cycle Datapath during Branch •^ if (R[rs] – R[rt] == 0) then Zero

1; else Zero

^0

op

rs^

rt^

immediate

ALUctr =Sub

Clk RegWr = 0 busW

busA busB^32 5

Rw

Ra

Rb

32 32-bitRegisters

Rs Rt

Rt

Rd

RegDst = x

Extender

Mux

Mux

imm

ALUSrc = 0

ExtOp = x

Mux MemtoReg = x

Clk

Data In

WrEn

32

Adr DataMemory

MemWr = 0

ALU

InstructionFetch Unit

Clk

Zero

Instruction<31:0>

Imm Rd Rs Rt

nPC_sel= “Br”

Chapter 5.2 - Processor Design 2

Step 4: Given Datapath: RTL

Control

ALUctr

RegDst

ALUSrc

ExtOp

MemtoReg

MemWr

Zero

Instruction<31:0>

Imm

Rd Rs

Rt

nPC_sel

Adr Inst Memory

Control DATA PATH

Op

Fun

RegWr

Chapter 5.2 - Processor Design 2

A Summary of Control Signals

inst

Register Transfer

ADD

R[rd]

R[rs] + R[rt];

PC

PC + 4

ALUsrc = RegB, ALUctr = “add”, RegDst = rd, RegWr, nPC_sel = “+4”SUB

R[rd]

R[rs] – R[rt];

PC

PC + 4

ALUsrc = RegB, ALUctr = “sub”, RegDst = rd, RegWr, nPC_sel = “+4”ORi

R[rt]

R[rs] + zero_ext(Imm16);

PC

PC + 4

ALUsrc = Im, Extop = “Z”, ALUctr = “or”, RegDst = rt, RegWr, nPC_sel = “+4”LOAD

R[rt]

MEM[ R[rs] + sign_ext(Imm16)];

PC

PC + 4

ALUsrc = Im, Extop = “Sn”, ALUctr = “add”,

MemtoReg,

RegDst = rt, RegWr,

nPC_sel = “+4”

STORE

MEM[ R[rs] + sign_ext(Imm16) ]

R[rs];

PC

PC + 4

ALUsrc = Im, Extop = “Sn”, ALUctr = “add”, MemWr, nPC_sel = “+4”BEQ

if ( R[rs] == R[rt] ) then PC

PC + sign_ext(Imm16)] || 00 else PC

PC + 4

nPC_sel = “Br”, ALUctr = “sub”