Docsity

Assembly Instruction Set and Operation Codes, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
1

  
   
   !! "!
# $   % & ' ()*+ $
! 
,- !$ $
(!$ $ . . 
!*& /*/+ .0 1)1*/+
- ' & 2 
2
  ! 3 
PC
Instruction
memory
Read
address
Instruction
[31–0]
Instruction [20 16]
Instruction [25 21]
Add
Instruction [5 0]
MemtoReg
ALUOp
MemWrite
RegWrite
MemRead
Branch
RegDst
ALUSrc
Instruction [31 26]
4
16 32
Instruction [15 0]
0
0
M
u
x
0
1
Control
Add ALU
result
M
u
x
0
1
Registers
Write
register
Write
data
Read
data 1
Read
data 2
Read
register 1
Read
register 2
Sign
extend
M
u
x
1
ALU
result
Zero
PCSrc
Data
memory
Write
data
Read
data M
u
x
1
Instruction [15 11]
ALU
control
Shift
left 2
ALU
Address
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Assembly Instruction Set and Operation Codes and more Study notes Computer Architecture and Organization in PDF only on Docsity!

PC

Instruction memory

Read address

Instruction [31–0]

Instruction [20 16]

Instruction [25 21]

Add

Instruction [5 0]

MemtoReg ALUOp MemWrite

RegWrite

MemRead

Branch

RegDst

ALUSrc

Instruction [31 26]

Instruction [15 0]

M

u x

Control

Add ALU result

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Sign extend

M

u x 1

ALU

result

Zero

PCSrc

Data memory Write data

Read data M u x

Instruction [15 11]

ALU

control

Shift left 2

ALU

Address

 !!! I

 !B $ 

%  H*    !

B 1 1 @A @ 1   /@+

  1 1 @A  1  /@A

 1 1 @A  1 @D 7@C

(  1 1 @A   @D /@C

B

J  * !$   !!! @

B 1 1 @A @ 1   /@+

  1 1 @A  1  /@A

 1 1 @A  1 @D 7@C

(  1 1 @A   @D /@C

 !!! $ F

$ KF

 !!! $ F

$ KF

B 1 1 @A @ 1   /@+

  1 1 @A  1  /@A

 1 1 @A  1 @D 7@C

(  1 1 @A   @D /@C

 !!! $ F

$ KF

PC

Instruction

memory

Read

address

Instruction

Add ALU

result

M

u

x

Registers

Write

register

Write

data

Read

data 1

Read

data 2

Read

register 1

Read

register 2

Shift

left 2

M

u

x

ALU operation

RegWrite

MemRead

MemWrite

PCSrc

ALUSrc

MemtoReg

ALU

result

Zero

ALU

Data

memory

Address

Write

data

Read

data M

u

x

Sign

extend

Add

0  B$ < = 1

PC

Instruction

memory

Read

address

Instruction

Add ALU

result

M

u

x

Registers

Write

register

Write

data

Read

data 1

Read

data 2

Read

register 1

Read

register 2

Shift

left 2

M

u

x

ALU operation

RegWrite

MemRead

MemWrite

PCSrc

ALUSrc

MemtoReg

ALU

result

Zero

ALU

Data

memory

Address

Write

data

Read

data M

u

x

Sign

extend

Add

24 23 ' : $ 0 E

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

 %  !E *

What selected What type of op uses?

% !E

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

MemRead

ALUsrcA = 0

IorD = 0

IRwrite

ALUsrcB = 01

ALUop = 00

0 M  4   !   

E ! B  !! (

Problem: Automatic door sensor

Front

pad

Rear

pad

NEITHER FRONT REAR BOTH

OPEN C O O O

CLOSED C O O O

A = Register[IR[25-21]]

B = Register[IR[20-16]]

ALUout = PC + (sign-extend (IR[15-0]) << 2)

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

MemRead

ALUsrcA = 0

IorD = 0

IRWrite

ALUsrcB = 01

ALUOp = 00

PCWrite

PCSource = 00

Memory Inst

FSM

R-type Inst

FSM

Branch Inst

FSM

Jump Inst

FSM

Instruction Fetch, state 0

Opcode = LW or SW

Opcode = R-type

Opcode = BEQ

Opcode = JMP

Start

! /B*' :!

& !! . !  " * if (A==B) PC=ALUout

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead

MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp

ALUSrcB ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] 26 28 address [31-0] Shift left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

4   !! /B

from state 1

To state 0

ALUsrcA = 1

ALUsrcB = 00

ALUop = 10

from state 1

To state 0

Execution

WriteBack

' R ! 8!! /9*!$  

ALUout = A + sign-extend(IR[15-0])

0 E 8!! .   9* 

Reg[IR[20-16]] = MDR

ALUout = A + sign-extend(IR[15-0])

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

Memory[ALUout] = B

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

from state 1

MemWrite

IorD = 1

MemRead

IorD = 1

Memory

Access

write-back

Address

Computation

PC = PC[31-28] | (IR[25-0] <<2)

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

Shift left 2

PC

M

u x

Registers Write register

Write data

Read data 1

Read data 2

Read register 1

Read register 2

Instruction [15–11]

M

u x

M

u x

Instruction [15–0]

Sign extend

Instruction [25–21]

Instruction [20–16]

Instruction [15–0] Instruction register

ALU

control

ALU

result

ALU

Zero

Memory data register

A

B

IorD MemRead MemWrite MemtoReg

PCWriteCond PCWrite

IRWrite

ALUOp ALUSrcB

ALUSrcA

RegDst

PCSource

RegWrite

Control

Outputs

Op [5–0]

Instruction [31-26]

Instruction [5–0]

M u x

0

2

Jump Instruction [25–0] (^26) Shift^28 address [31-0] left 2

PC [31-28]

1 M

u x

M

u x

ALUOut

Memory MemData

Write data

Address

PCWrite

PCSource=

from state 1

0 MH  4  

H!.