Question: Assume we are running code on a 10-bit machine using twos complement arithmetic for signed integers. Short integers are encoded using 5 bits. Sign extension
Assume we are running code on a 10-bit machine using twos complement arithmetic for signed integers. Short integers are encoded using 5 bits. Sign extension is performed whenever a short is casted to an int. For this problem, assume that all shift operations are arithmetic. Fill in the empty boxes in the table below.
int i = -220; unsigned ui = i; short s = -14; unsigned short us = s;
TMax denotes the largest positive twos complement number and TMin denotes the minimum negative twos com- plement number. Finally, you must use hexadecimal notation for your answers in the Hex Representation column.
| Expression | Decimal Representation | Hex Representation |
| Zero | ||
| -1 | ||
| i | ||
| i >> 5 | ||
| ui | ||
| (int) s | ||
| (int) (s ^ -12) | ||
| (int) us | ||
| TMax | ||
| TMin | ||
| TMin + TMin |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
