Unit 17 Flashcards
lw R₁, Kd(R₂)
What does the above do?
The value from word adress (Kd + R₂) is updated into register R₁
note: Kd = sx(⃗ b)
R1 := !W [!R2 + sx(⃗ b)]
sw R₁, Kd(R₂)
What does the above do?
The value from register R₁ is updated into main memory of adress Kd + R₂
note: Kd = sx(⃗ b)
W [!R2 + sx(⃗ b)] := !R1
How is each machine instruction stored?
How is Kd stored in the instruction?
What type of BInary is Kd?
Each machine isntruction is storteds as a 32 bit binary number
The denary number Kd is stored as the rightmost 16 bits
Kd is stored as sighned binary as it can be negative
What are the three formats a 32 bit mahcine instruction can belong to?
R,I and J
Give an example of an R-format example?
name R1, R2, R3 such as add $t0, $s1, $s2, and sub, and, . . .
A R-format instruction is 32 bits long but it vcan be broken down into the following sections:
6bits
5bits
5bits
5bits
5bits
6bits
Name each of the sections and use registers R₁,R₂,R₃?
6bits : Opcode (op) always 6 zeros
5bits: rs (R₂)
5bits:rt (R₃)
5bits:rd (R₁)
5bits: shamt (don’t need to study)
6bits: funct (function) #specifies waht functiuon we want the ALU to perform
Give an example of an I-format example?
name R1, R2, Kd (Kd= denary number)
A I-format instruction is 32 bits long but it vcan be broken down into the following sections:
6bits
5bits
5bits
16bits
Name each of the sections and use registers R₁,R₂?
6bits : Opcode (op) #stores instructions for the ALU for example addi
5bits: rs (R₂)
5bits:rt (R₃)
16bits:address (⃗b)