2. Data Representation Flashcards

1
Q

Convert 0000 10112 to base 10.

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

MIPS words are 32 bits in length. What is the range of unsigned integers representable in 1 word?

A

0 to 232-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Write -21 in 8-bit sign-magnitude form.

A

1 001 0101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State two disadvantages of sign magnitude form over two’s complement.

A
  • There is a positive and negative zero.
  • Adders need an extra step to work out the sign.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

State an advantage of sign-magnitude form over two’s complement.

A

It is symmetric.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Convert 1111 11002 (sign-magnitude) to base 10.

A

-124

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Convert 1111 11002 (2’s complement) to base 10.

A

-4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Derive the ‘shortcut’ method for converting to two’s complement.

A

We can see that the inversion of a binary representation (xi) satisfies:

x + xi = -1

which implies:

-x = xi + 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe one’s complement notation.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Convert eca8 6420 16 to binary.

A

1110 1100 1010 1000 0110 0100 0010 0000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Convert 0001 0011 0101 0111 1001 1011 1101 1111 from binary to hexadecimal.

A

1357 9bdf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

State the range of signed integers in two’s complement.

A

-2n-1 to -2n-1 - 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe the process of sign extending a 16-bit binary number to a 32 bit binary number.

A

The msb (most significant bit) is copied into the 16 new bits at the start of the numbers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain the difference between logical right shift and arithmetic right shift. Why is there solely a left-shift?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why can an overflow not occur when the operands have different signs?

A

Because the magnitude of the result is smaller than those of the operands, the result will fit in the size the operands are.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When does an overflow occur in a binary addition?

A

When the (msb)s of the operands are the same, and both opposite to the msb of the result.

17
Q

Normalize 0.1 x 10-8.

A

1 x 10-9.

18
Q

In 1.xxxxxx x 2yyyyyyy, what are xxxx and yyyy?

A

xxxx is the ‘fraction’ or ‘mantissa’, and yyyy is the ‘exponent’.

19
Q

In IEEE 754, why is the exponent placed before the mantissa?

A

To make sorting simpler.

20
Q

Explain the reasoning behind (exponent - bias) in IEEE 754.

A

Negative exponents cause sorting to be harder, and so we wish to have the most negative exponent as 0000 0000 and the most positive as 1111 1111. To do this, we add 127 to the exponent. (Double precision is 1023)

21
Q

What is -0.75 in IEEE 754 binary representation?

A

1 0111 1110 1000 0000 0000 0000 0000 000

22
Q

What is 1 1000 0001 0100 0000 0000 0000 0000 000

A

-5

23
Q

An exponent and mantissa of zero means….

An exponent of 255 and a mantissa of 0 means….

An exponent of 255 and a mantissa non-zero means….

A

a. 0

b. Infinity

c. NaN