100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Class notes CMPUT229:InstructionRepresentation

Rating
-
Sold
-
Pages
24
Uploaded on
14-01-2021
Written in
2020/2021

Instruction Representation











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
January 14, 2021
Number of pages
24
Written in
2020/2021
Type
Class notes
Professor(s)
Jose nelson amaral
Contains
All classes

Content preview

Eachregisterfield is 5bits
Opcodes are 7 bits 6
bib
Some instructionsare 32bitsothers31

Watchoutfor immediatefields




Topic V05
Binary Representation
of Instructions



1

, Representing Instructions
Instructions are encoded in a binary representation
Called machine code

RISC-V instructions
Encoded as 32-bit instruction words
Small number of formats encoding operation code (opcode),
register number, …
Regularity!

Register Names:
t0 – t2 ⟺ x5 – x7 This was a choice by hardware
t3 – t6 ⟺ x28 – x31 designer
s0 – s1 ⟺ x8 – x9 You must know these
s2 – s11c⟺ x18 – x27
S2 SII 2 18 X27

2

, bit field each rectangle

Representing Instructions: R-Type
x5 x23 x21
add t0, s7, s5
func7 rs2 rs1 func3 rd op
0x00 21 23 0xO 5 0x33
0 1
e 3 0
es 3
es
31 25 24 20 19 15 14 12 11 7 6 0

000000O 1010 1 10111 00O 00101 0110011
Bto
0 1 IET 18T I0
In memory we would see: 0x015B82B3
1B BET1 3
Each register fieldhas
0x01
0x015
0x0
5bits becausethereare
op: Opcode to specify the operation and format of an instruction zaregisters andsoyouneed
rd: register destination operand 5bits torepresentanregisters
funct3: co
function code; partially, specifies the variant of the instruction to be si
executed
rs1: first register source operand Tassinari
O
rs2:
funct7:
second register source operand
function code specifies the variant of the instruction to be executed
Hipaa


3
CA$4.24
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
titaniayuki1

Also available in package deal

Thumbnail
Package deal
CMPUT229: full lesson
-
36 2021
CA$ 159.05 More info

Get to know the seller

Seller avatar
titaniayuki1 university of alberta
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
4 year
Number of followers
1
Documents
69
Last sold
4 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions