The binary number system Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What does two’s complement enable?

A

For signed integers to be represented in binary, not just unsigned

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

Explain the two’s complement method of representing binary numbers

A

In a string of n bits, the most significant bit represents -(2ⁿ⁻¹), instead of just 2ⁿ⁻¹

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

Given the representation of a number n in binary, how can the representation of -n be calculated in two’s complement?

A

If necessary, pad the number with a preceding 0. Then, find the least significant 1. Flip all bits that are more significant than this 1

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

Explain the fixed point method of representing binary numbers

A

A binary point is positioned somewhere in the number. The bits to the left of this work like regular binary, the values doubling as they get closer to the most significant bit. The bit to the right of the point represents a half, and the values half as they get closer to the least significant bit

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

Explain the floating point method of representing binary numbers

A

A string of bits consists of two parts, a mantissa and an exponent, with each allocated a certain number of bits. By default, the binary point is positioned after the most significant bit. The exponent gives how many places to the right the binary point should be moved. The mantissa should be in normalised form. If there are not enough bits to fully store the mantissa, the least significant bit(s) get removed until it fits

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

Give an advantage of floating point representation compared to fixed point

A

A much wider range of numbers can be produced with the same number of bits

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

Give two advantages of fixed point representation compared to floating point

A
  • They are faster to process as there is no processing required to move the binary point
  • The absolute error will always be the same
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is overflow?

A

When a number is too large to be represented with the number of bits allocated

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

What may happen during overflow in a two’s complement system?

A

Two positive numbers may add together to produce a negative, due to the most significant bit changing to a 1

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

What is underflow?

A

When a number is too small to be represented with the number of bits allocated

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

What is normalisation?

A

The notion that a floating point binary number should have a mantissa starting with either 0.1 for a positive number of 1.0 for a negative number

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

Give an advantage of normalisation

A

It provides maximum precision for a given number of bits

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

How can a floating point binary number be normalised?

A

By moving the binary point such that the mantissa starts with either 0.1 or 1.0, and then adjusting the exponent accordingly

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

What is the absolute error of a number that has been rounded?

A

The difference between the exact value and the approximation

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

What is the relative error of a number that has been rounded?

A

The absolute error divided by the exact value

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