Question

8.6 Assume that register $s0 = 0x70000000 and $s1 0x10000000. For the following code, will there...

8.6 Assume that register $s0 = 0x70000000 and $s1 0x10000000. For the following code, will there be overflow?

Add $s0,$s0,$s1

Add $s0,$s0,$s1

8.7 Assume that register $s0 = 0x40000000 and $s1= 0x20000000. For the code above, will there be overflow?

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

8.6 :The short answer is no, there will not be an overflow, because

$s0 = 0x70000000 in hex or 0111000000000000000000000000000 in binary

similarly,

$s1 = 0x10000000 or 00010000000000000000000000000000 in binary

on performing first command (add $s0,$s0,$s1), the value in $s0

$s0=0x80000000, which is 10000000000000000000000000000000 in binary

after the second add $s0, $s0, $s1;

$s0=0x90000000, which is 10010000000000000000000000000000 in binary

since the 32 bit is sufficient to provide the correct sum and no bit was carried over, there will be no overflow bit.

8.7 : No carry bit, no over flow.

$s0 = 0x40000000 in hex or 0100000000000000000000000000000 in binary

similarly,

$s1 = 0x20000000 or 00100000000000000000000000000000 in binary

on performing first command (add $s0,$s0,$s1), the value in $s0

$s0=0x60000000, which is 01100000000000000000000000000000 in binary

after the second add $s0, $s0, $s1;

$s0=0x80000000, which is 10000000000000000000000000000000 in binary

since the 32 bit is sufficient to provide the correct sum and no bit was carried over, there will be no overflow bit.

Add a comment
Know the answer?
Add Answer to:
8.6 Assume that register $s0 = 0x70000000 and $s1 0x10000000. For the following code, will there...
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 registers $s0 and $s1 hold the values 8000000016 and D000000016, respectively.

    Assume that registers $s0 and $s1 hold the values 8000000016 and D000000016, respectively. a. What is the value of $t0 for the following assembly code? add $t0, $s0, $s1b. Is the result in $t0 the desired result, or has there been overflow?c. For the contents of registers $s0 and $s1 as specified above, what is the values of $t0 for the following assembly code? sub $t0, $s0, $s1d. Is the result in $t0 the desired result, or has there been...

  • The following register transfers are to be executed in, with minimum clock cycles: S1' * S0'...

    The following register transfers are to be executed in, with minimum clock cycles: S1' * S0' : R3 <- R0, R1 <- R2 S1 * S0': R2 <- R0, R1 <- R3 S1' * S0 : R3 <- R1, R0 <- R2 S1 * S0 : R2 <- R1, R0 <- R3 (a)What is the minimum number of buses required? Construct the register transfer operations so that the transfers can occur in one clock indicate the individual load line for...

  • The following register transfers are to be executed in, with minimum clock cycles: S1' * S0'...

    The following register transfers are to be executed in, with minimum clock cycles: S1' * S0' : R3 <- R0, R1 <- R2 S1 * S0': R2 <- R0, R1 <- R3 S1' * S0 : R3 <- R1, R0 <- R2 S1 * S0 : R2 <- R1, R0 <- R3 (a)What is the minimum number of buses required? Construct the register transfer operations so that the transfers can occur in one clock indicate the individual load line for...

  • Draw a logical diagram of the 4-bit register with mode selection inputs S1 and S0. The...

    Draw a logical diagram of the 4-bit register with mode selection inputs S1 and S0. The register operates in accordance with the following table of functions. S1 S0 register operation 0 0 No change 0 1 parallel load 1 0 left shift 1 1 Clear register to zero

  • Assume that k correspond to register $s0 and the base of the array v is in...

    Assume that k correspond to register $s0 and the base of the array v is in $s1. What is the MIPS assembly code corresponding to this C segment? If ( V[K]< V[K+1]) { temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; } else { v[k] = k; v[k+1]=k+1 }

  • Please answer all the questions! Thank you. For the following C statement, what would be the corresponding MIPS assembly...

    Please answer all the questions! Thank you. For the following C statement, what would be the corresponding MIPS assembly code? Assume that the variables a, b, c, and d are given and were declared as 32-bit integers a - b - (c + 7)+ d; 1. 2. Show how the value 0xB47CA034 would be arranged in a little-endian and big-endian machine Assume the data is being stored starting with address 0 3. Convert the following base-16 numbers to base-2 a....

  • Translate these loops into C. Assume that the C level integer i is held in register...

    Translate these loops into C. Assume that the C level integer i is held in register $t1,$s2 holds the c level integer called result, and $s0 holds the base address of the integer MemArray. addi $t1, $s0, 400 loop: lw $s1, 0($s0) add $s2, $s2, $s1 lw $s1, 4($s0) add $s2, $s2, $s1 addi $s0, $s0, 8 bne $t1, $s0, Loop

  • $s0 - holds value of 128 (see top of image) No additional information has been provided by the textbook to answer the f...

    $s0 - holds value of 128 (see top of image) No additional information has been provided by the textbook to answer the following questions. Any help for any of the following questions is appreciated! 2.13 Assume that $s0 holds the value 128, ten" 2.13.1 [5]<§2.4> For the instruction add sto, sso, ssl, what is the range(s) of values for $s1 that would result in overflow? [5] <$2.4> For the instruction sub sto, $s0, $s1, what is the rangets) of values...

  • . please trace the code including the value in every register 1. Express the instruction on...

    . please trace the code including the value in every register 1. Express the instruction on line 9 of the program in 32-bit machine language, and if necessary, refer to the table in the appendix. 2. Set 000beef00 to $ s0 as input and calculate the value of $ s0 at the end of each step (lines 9, 13, 17, 21, 25) when executing the above program (binary or Write in hexadecimal).   3. Briefly explain the operation of the above...

  • Q3. (2 pts) Suppose $s0 = 1810, $s1 = 710. After running the following code, what...

    Q3. (2 pts) Suppose $s0 = 1810, $s1 = 710. After running the following code, what is value held in $to and $t1 (represented in decimal form)? divu $s0, $s1 mfhi $t0 mflo $t1

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