Question

1. [10] Given the declarations: signed char0x05, y 0x0A, z 0x2F: we are using 1 byte 8 bits Evaluate each of the following. Give the answers as two hexadecimal characters a) 9 b) x-y c) x^y d) (x <<2) &z c) (x A y)loz) 2. [10] Suppose we are using a machine with that uses 7 bits to store a float value with 3 bits for the exponent in the manner of the IEE 754 standard. (Hint: the bias would be 3) Do cither: Decode: 1100110 OR Encode 3.2510 Circle your choice, show work below.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1

a) Note that this will be stored in the two's complement format. Thus, the binary will be 11110001, hence it will be 0xF7.

b) x - y = -5, which will be 11111011, hence 0xFB.

c) x ^ y = 5 ^ 10, but this will overflow and finally produce 0x0F.

d) x << 2 is 0x18, thus (x << 2) & z (bit-wise and) gives 0x04.

e) As x^y = 0x0F, and | is bit-wise or, thus it gives 0x2F.

2. The sign bit is 1, thus the number is negative. The next three digits are for the decimal part, which is 100, and the exponent is 110, which is 6, but there is a bias of 3, which means the actual exponent is 3. Thus, the number is 1.1 × 23 =-8.8 in the decimal representation.

Comment in case of any doubts.

Add a comment
Know the answer?
Add Answer to:
1. [10] Given the declarations: signed char0x05, y 0x0A, z 0x2F: we are using 1 byte...
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