100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Class notes CMPUT229:InstructionRepresentation CA$4.34   Add to cart

Class notes

Class notes CMPUT229:InstructionRepresentation

 7 views  0 purchase

Instruction Representation

Preview 3 out of 24  pages

  • January 14, 2021
  • 24
  • 2020/2021
  • Class notes
  • Jose nelson amaral
  • All classes
All documents for this subject (36)
avatar-seller
titaniayuki1
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller titaniayuki1. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for CA$4.34. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75632 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
CA$4.34
  • (0)
  Add to cart