Question

Assume that 32-bit registers $80 and $1 hold values 80000000nex and D0000000mex respectively, (a) What is the value of $to fo

0 0
Add a comment Improve this question Transcribed image text
Answer #1
a)  $t0 = 0x50000000
b)  yes, there was an overflow

Very detailed Explanation:
---------------------------
Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from hexadecimal to binary
Converting 80000000 to binary
8 => 1000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
So, in binary 80000000 is 10000000000000000000000000000000

Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from hexadecimal to binary
Converting D0000000 to binary
D => 1101
0 => 0000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
0 => 0000
So, in binary D0000000 is 11010000000000000000000000000000

Adding 10000000000000000000000000000000 and 11010000000000000000000000000000 in binary
    10000000000000000000000000000000
    11010000000000000000000000000000
-------------------------------------
 (1)01010000000000000000000000000000
-------------------------------------
Sum produces a carry of 1. We can ignore that carry.
So, sum of these numbers in binary is 01010000000000000000000000000000

let's convert 01010000000000000000000000000000 back to hexadecimal
Converting 01010000000000000000000000000000 to hexadecimal
0101 => 5
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 01010000000000000000000000000000 is 0x50000000
so, value of $t0 is 0x50000000

Verification
---------------
first = 10000000000000000000000000000000
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   10000000000000000000000000000000 is flipped to 01111111111111111111111111111111
II. Add 1 to above result
01111111111111111111111111111111 + 1 = 10000000000000000000000000000000
III. Now convert this result to decimal value
=> 10000000000000000000000000000000
=> 1x2^31+0x2^30+0x2^29+0x2^28+0x2^27+0x2^26+0x2^25+0x2^24+0x2^23+0x2^22+0x2^21+0x2^20+0x2^19+0x2^18+0x2^17+0x2^16+0x2^15+0x2^14+0x2^13+0x2^12+0x2^11+0x2^10+0x2^9+0x2^8+0x2^7+0x2^6+0x2^5+0x2^4+0x2^3+0x2^2+0x2^1+0x2^0
=> 1x2147483648+0x1073741824+0x536870912+0x268435456+0x134217728+0x67108864+0x33554432+0x16777216+0x8388608+0x4194304+0x2097152+0x1048576+0x524288+0x262144+0x131072+0x65536+0x32768+0x16384+0x8192+0x4096+0x2048+0x1024+0x512+0x256+0x128+0x64+0x32+0x16+0x8+0x4+0x2+0x1
=> 2147483648+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0
=> 2147483648
Answer: -2147483648

second = 11010000000000000000000000000000
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   11010000000000000000000000000000 is flipped to 00101111111111111111111111111111
II. Add 1 to above result
00101111111111111111111111111111 + 1 = 00110000000000000000000000000000
III. Now convert this result to decimal value
=> 110000000000000000000000000000
=> 1x2^29+1x2^28+0x2^27+0x2^26+0x2^25+0x2^24+0x2^23+0x2^22+0x2^21+0x2^20+0x2^19+0x2^18+0x2^17+0x2^16+0x2^15+0x2^14+0x2^13+0x2^12+0x2^11+0x2^10+0x2^9+0x2^8+0x2^7+0x2^6+0x2^5+0x2^4+0x2^3+0x2^2+0x2^1+0x2^0
=> 1x536870912+1x268435456+0x134217728+0x67108864+0x33554432+0x16777216+0x8388608+0x4194304+0x2097152+0x1048576+0x524288+0x262144+0x131072+0x65536+0x32768+0x16384+0x8192+0x4096+0x2048+0x1024+0x512+0x256+0x128+0x64+0x32+0x16+0x8+0x4+0x2+0x1
=> 536870912+268435456+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0
=> 805306368
Answer: -805306368

sum = 01010000000000000000000000000000
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
=> 1010000000000000000000000000000
=> 1x2^30+0x2^29+1x2^28+0x2^27+0x2^26+0x2^25+0x2^24+0x2^23+0x2^22+0x2^21+0x2^20+0x2^19+0x2^18+0x2^17+0x2^16+0x2^15+0x2^14+0x2^13+0x2^12+0x2^11+0x2^10+0x2^9+0x2^8+0x2^7+0x2^6+0x2^5+0x2^4+0x2^3+0x2^2+0x2^1+0x2^0
=> 1x1073741824+0x536870912+1x268435456+0x134217728+0x67108864+0x33554432+0x16777216+0x8388608+0x4194304+0x2097152+0x1048576+0x524288+0x262144+0x131072+0x65536+0x32768+0x16384+0x8192+0x4096+0x2048+0x1024+0x512+0x256+0x128+0x64+0x32+0x16+0x8+0x4+0x2+0x1
=> 1073741824+0+268435456+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0
=> 1342177280
Answer: 1342177280
-2147483648+-805306368 must be -2952790016
This is not correct since we can verify that -2147483648+-805306368 not equals 1342177280
So, there was an overflow.
Add a comment
Know the answer?
Add Answer to:
Assume that 32-bit registers $80 and $1 hold values 80000000nex and D0000000mex respectively, (a) What is...
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
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