Question 1:
IEEE 754-2008 has a half-precision standard that is 16 bits wide. The leftmost bit is the sign bit, the exponent is 5 bits wide and has a bias of 15, and the fraction is 10 bits long. A hidden 1 is assumed as usual. Complete the following for this 16 bit floating point standard: What is the maximum value that can be stored? What is the minimum value that can be stored? What is the precision in decimal places?

Question 2:
Consider the following sequence of MIPS instructions
add $s2, $s4, $s1
sub $t0, $s2, $s5
lw $t1, 4($t0)
add $s3, $s4, $s1
Explain using diagrams how the first two instructions would be executed in the 5-stage pipelined MIPS datapath. Identify and explain any examples of pipeline hazards that you can find in this sequence of
instructions. Can you reorganize the instructions to eliminate the hazards? If so, how?

Question 3:
What programming conventions relate to the use of the s, a, and v registers in MIPS?
What special function do the ra and sp registers perform in MIPS?
You need to save the values in the a0, a1, and s0 registers on the stack, write MIPS assembler to do this.
You need to restore the values you saved above from the stack back into the registers,write MIPS assembler to do this.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

The programming conventions with respect to the required registers are:
$s0-$s7 – considered “saved registers”
$a0-$a3 – considered “argument registers” containing the first four argument values for a call of the subroutine;
$v0-$v1- contain the returned value of a subroutine.

$ra – contains the returned address in a subroutine call;
$sp- stack pointer register.

As observation, it is not necessary to adjust the stack pointer for each value; instead we can adjust it at once for all the three registers like below (first the push onto the stack):

addi $sp, $sp, -12   # we decrement the SP value by 12
       sw   $a0, 0($sp)   # push/save the content of $a0 register onto the stack
       sw   $a1, 4($sp)   # push/save the content of $a1 register onto the stack...

By purchasing this solution you'll be able to access the following files:

for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats