Instruction Set Architecture Part 2 - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Instruction Set Architecture Part 2

Description:

Instruction Set Architecture Part 2 – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 14
Provided by: lakshm1
Category:

less

Transcript and Presenter's Notes

Title: Instruction Set Architecture Part 2


1
Instruction Set ArchitecturePart 2
  • Lecture 19

2
Programmers Model
3
Simplified Datapath
4
Instruction Formats
The Program Counter (PC) must have its 2 LSBs
00 to ensure 32-bit word alignment.
5
Arithmetic Instructions
add t0,s0,s1 set t0 ) (s0)(s1)
sub t0,s0,s1 set t0 ) (s0)-(s1) and
t0,s0,s1 set t0 ) (s0)?(s1) or
t0,s0,s1 set t0 ) (s0)?(s1) xor
t0,s0,s1 set t0 ) (s0)?(s1) nor
t0,s0,s1 set t0 ) ((s0)?(s1))?
6
Arithmetic with an Immediate Operand
An operand in the range -32 768, 32 767, or
0x0000, 0xffff, can be specified in the
immediate field. addi t0,s0,61 set t0 )
(s0)61 andi t0,s0,61 set t0 )
(s0)?61 ori t0,s0,61 set t0 )
(s0)?61 xori t0,s0,0x00ff set t0 )
(s0)? 0x00ff
Error Assume that the immediate operand is
sign-extended in ALL FOUR instructions. This is
consistent with the DataPath given on page 248
BUT is not consistent with the middle paragraph
on page 90.
7
Loading Registers.
The Offset is sign-extended before adding to the
Base Register Value.
8
Load and Store
lw t0,40(s3) load mem40(s3) in t0
sw t0,A(s3) store (t0) in
memA(s3) (s3) means content of
s3 lui s0,61 The immediate value 61 is
loaded in upper half of s0
with lower 16b set to 0s
9
Jump Instructions
Unconditional jump and jump through register
instructions j verify go to mem loc
named verify jr ra go to address
that is in ra ra may hold a
return address
10
Conditional Branch Instructions
Conditional branches use PC-relative addressing
bltz s1,L branch on (s1)lt 0 beq
s1,s2,L branch on (s1)(s2) bne
s1,s2,L branch on (s1)?(s2)
The signed offset is multiplied by 4 to guarantee
long-word alignment
11
Comparison Instructions
slt s1,s2,s3 if (s2)lt(s3), set s1 to
1 else set s1 to 0 often
followed by beq/bne slti s1,s2,61 if
(s2)lt61, set s1 to 1 else set s1 to 0
Look at the MUX at the output of the ALU given on
page 192.
12
Addressing Modes
13
20 MicroMIPS Instructions
Write a Comment
User Comments (0)
About PowerShow.com