Question

Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump...

Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump (j) MIPS assembly instruction to jump directly to the instruction at 0x50003000? If yes, write the corresponding assembly instruction(s). If not, explain why and give other MIPS instruction(s) that can jump to this target address. (For this problem, assume that the instruction memory starts from 0x00000000 and goes to 0xFFFFFFFF.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Consider the given data.

The Program counter is set to 0x30002000.

The jump (j) instruction, is a 32-bit instruction. It uses 6 bits for “opcode” and the remaining 26 bits for the “target address”.

While executing the jump statement, the 26-bit address transforms into a 32-bit address by shifting left by two bits and taking the upper order 4 bits of the program counter.

The program counter is set to 0x30002000. The binary is equivalent to

0000 0000 0011 0000 0000 0000 0010 0000 0000 0000.

The largest possible value of jump with the highest value in the lower 26 bits is 0x3FFFFFFF.

The 26 bits are then shifted left by two bits to form the 28-bit value 0xFFFFFFFC.

Next, the upper order four bits of the program counter, that is 0x2 are appended to this 28-bit value to form the 32-bit value, that is 0x2FFFFFFFC.

Since, the address 0x2FFFFFFFC is the maximum size of jump, it is not possible to jump (j) in MIPS to the address 0x50003000.

The jump instruction cannot change the upper four bits.

Therefore, for the jump (j) instruction, it is not possible to set the PC to the address as 0x50003000.

Add a comment
Know the answer?
Add Answer to:
Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume that the program counter (PC) contains the value Ox 20000000 What is it the largest...

    Assume that the program counter (PC) contains the value Ox 20000000 What is it the largest address that can be reached via the jump and link (jal) instruction? a) OX200F FFFE b) Ox2001 FFFF c) Ox2000 01FF d) None of the above

  • 5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer...

    5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A- The MiteASM Assembler and Appendix B - The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should display a count on the 7-segment display. The count should increase by 1 when button 0 is 1. pressed. It should reset to 0 when button 1 is...

  • There is an example below Now that everything is working you can try the following exercises. To complete them you wi...

    There is an example below Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A The MiteASM Assembler and Appendix B The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should 1. display a count on the 7-segment display. The count should increase by 1 when button 0 is pressed. It should reset to 0 when button...

  • Assume the program counter (PC) is initially equal to n. Assume that the word length of...

    Assume the program counter (PC) is initially equal to n. Assume that the word length of the processor is 1. a)      How many fetches are required to make PC equal to m if there are no branch instructions between n and m? b)      What is the content of the instruction register (IR) when the PC’s value is n+k? Justify your answer. Why we are not using a hundred pipeline stages if anoperation can be divided up into a hundred steps,...

  • Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at...

    Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...

  • A short program loop goes through a 16 kB array one word at a time, reads...

    A short program loop goes through a 16 kB array one word at a time, reads a number from the array, adds a random number, and stores the result in the corresponding entry in another array that is located in the memory immediately following the first array. An outer loop repeats the above operation 100 times. The 64-bit processor, operating at a clock frequency of 4 GHz, is pipelined, has 48 address lines, three levels of caches with a 64...

  • Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for...

    Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for a special R-type instruction jlr Jump and Link Register) to the single-cycle datapath below. Though this is an R-type instruction, but it is a special one that has the opcode being 000001 (instead of 000000), so the control unit will be able to differentiate this jlr instruction from the other R-type instructions and generate a special set of controls for this instruction. Opcode rs...

  • The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2,...

    The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2, F(n + 1) = F(n) + F(n − 1) i.e., the (n + 1)th value is given by the sum of the nth value and the (n − 1)th value. 1. Write an assembly program typical of RISC machines for computing the kth value F(k), where k is a natural number greater than 2 loaded from a memory location M, and storing the result...

  • computer analysis

    Questions1.  The function L is defined as L(1) = 2,L(2) = 1,L(3) = 3,L(4) = 4 and for n ≥ 4,L(n + 1) = L(n) + L(n − 1) + L(n − 2)L(n − 3)i.e., the (n + 1)-th value is given by the sum of the n-th, n − 1-th and n − 2-th values divided by the n − 3-th value.(a)  Write an assembly program for computing the k-th value L(k), where k is an integer bigger than...

  • Please answer question 1-4 4. Vocabulary: Match definition to its word. There will be some words...

    Please answer question 1-4 4. Vocabulary: Match definition to its word. There will be some words left over. (DUP some words left over. (50 points, 5 points each) part of the processor that performs actions such as mathematics, testing, and moving data the processor uses this computed memory location to access data used to combine multiple partial programs into a single executable how instructions are stored as machine code A. Indirect B. event handler c. pointer D. assembler E. control...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT