Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS 281 HW 2 Solutions, Assignments of Computer Science

solutions to better understand MIPS for the system architecture

Typology: Assignments

2022/2023

Uploaded on 10/17/2023

tigerblah-1
tigerblah-1 🇺🇸

1 document

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download CS 281 HW 2 Solutions and more Assignments Computer Science in PDF only on Docsity! H-02 Solutions 2.24 Suppose the program counter (PC) is set to 0x2000 0000. Is it possible to use the jump (j) MIPS assembly instruction to set the PC to the address as 0x4000 0000? Is it possible to use the branch-on-equal (beq) MIPS assembly instruction to set the PC to this same address? no and no 2.40 If the current value of the PC is 0x00000000, can you use a single jump instruction to get to the PC address as shown in Exercise 2.39? No, jump can go up to 0x0FFFFFFC. 2.42 If the current value of the PC is 0x1FFFF000, can you use a single branch instruction to get to the PC address (0x20014924) as shown in Exercise 2.39? Apply the equation we use to calculate branch target T = C + 4 + 4 * D where T = The address of the instruction we want to branch to C = Address of current instruction (the branch instruction) D = displacement in the branch instruction Normally, knowing T and C, we would solve for D. Instead, here we find the most positive and most negative values of D and use them to find the maximum range of addresses we could branch to, starting from C. 17:12:58 7/21/19 C:\USR\TC\CLASSES\CS281\HOMEWORK\ASSIGNMENTS\H-02\H-02-WrittenAssignment-Solutions.wpd 1/2
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved