Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A freezer stores its temperature in degrees Celsius as an 8-bit two's complement number.
Add binary in columns from the right: (write 0, carry 1) and (write 1, carry 1). An 8-bit register holds 0 to 255, so a total above 255 is an overflow. A logical shift of places left multiplies by , and right divides by ; bits shifted off the end are lost and 0s come in. In 8-bit two's complement the MSB is worth .
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Given. 8-bit two's complement, with the MSB worth .
Step 1. in binary. , so it is 00101101.
Step 2. Flip and add 1. Flipping gives 11010010. Adding 1 gives 11010011.
Step 3. Check (a). .
Step 4. Read 10011101. . So the temperature is .
Step 5. The lowest value. Only the MSB set: 10000000 is . So the lowest temperature is .
Answer: (a) 11010011. (b) . (c) .
Log in to join the discussion.
Loading…