quiz 5 Flashcards

1
Q

Adding integer rules

A

1 + 1 = 0 carry 1
1 + 0/0 + 1 = 1
0 + 0 = 0

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

Bit-wise flipping syntax

A

bar on top of the number

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

Signed magnitude changing the sign

A

Replace the sign bit with the opposite

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

One’s complement changing the sign

A

flip everything

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

Two’s complement changing the sign

A

Flip everything and add one

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

Single precision length?

A

32 bits, 1 sign bit, 23 bits significand, 8 bits exponent, bias 127

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

Double precision length?

A

64 bits, 1 sign bit, 52 bits significand, 11 bits exponent, bias 1023

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

Quadruple precision length?

A

128 bits, 1 sign bit, 112 bits significand, 15 bits exponent, bias 16383

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

Half precision length?

A

16 bits, 1 sign bit, 10 bits significand, 5 bits exponent, bias 15

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

Convert decimal to IEEE 754

A
  • Determine sign bit:
    o -42.625 is negative, therefore sign bit is 1.
  • Convert number to binary:
    o 101010.101 x 2^0
  • Shift point so that there is only one 1 in front of the point:
    o 1.01010101 x 2^5
  • Add bias to the exponent value:
    o 32-bit floating point numbers, the bias is 127.
    o 5 + 127 = 132
  • Convert exponent to the binary system
    o 132 = 10000100
  • Assemble floating point number:
    o 1.10000100.01010101000000000000000
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Convert IEEE 754 into decimal

A
  • 0.10000100.10111001000000000000000
  • Convert exponent to decimal
    o 10000100 = 132
  • Subtract bias from exponent
    o 132-127 = 5
  • Extend mantissa by leading “1” (add a 1 to the end)
    o 1.10111001000000000000000
  • Shift point
    o The binary point must be shifted so that the exponent becomes 0.
    o If the exponent is greater than 0, the point must be moved to the right, otherwise to the left
    o 110111.001000000000000000
  • Convert mantissa to decimal number
    o 110111.001 = 55.125
How well did you know this?
1
Not at all
2
3
4
5
Perfectly