2. Data Representation Flashcards
Convert 0000 10112 to base 10.
11
MIPS words are 32 bits in length. What is the range of unsigned integers representable in 1 word?
0 to 232-1
Write -21 in 8-bit sign-magnitude form.
1 001 0101
State two disadvantages of sign magnitude form over two’s complement.
- There is a positive and negative zero.
- Adders need an extra step to work out the sign.
State an advantage of sign-magnitude form over two’s complement.
It is symmetric.
Convert 1111 11002 (sign-magnitude) to base 10.
-124
Convert 1111 11002 (2’s complement) to base 10.
-4
Derive the ‘shortcut’ method for converting to two’s complement.
We can see that the inversion of a binary representation (xi) satisfies:
x + xi = -1
which implies:
-x = xi + 1
Describe one’s complement notation.
One’s complement is just a flip of bits to convert to negative. In other words, it is one less than the two’s complement.
Convert eca8 6420 16 to binary.
1110 1100 1010 1000 0110 0100 0010 0000
Convert 0001 0011 0101 0111 1001 1011 1101 1111 from binary to hexadecimal.
1357 9bdf
State the range of signed integers in two’s complement.
-2n-1 to -2n-1 - 1
Describe the process of sign extending a 16-bit binary number to a 32 bit binary number.
The msb (most significant bit) is copied into the 16 new bits at the start of the numbers.
Explain the difference between logical right shift and arithmetic right shift. Why is there solely a left-shift?
Logical right shift fills in the spare bits with the msb, and arithmetic right shift fills it in with 0s. Left shift is always filled with 0s.
Why can an overflow not occur when the operands have different signs?
Because the magnitude of the result is smaller than those of the operands, the result will fit in the size the operands are.