4.5 Data Representation Flashcards

1
Q

What is Two’s complement?

A

Two’s complement is a method used to represent a negative signed binary number on a computer. The value of the MSB is stored as negative.

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

What is fixed point bianry?

A

Fixed point binary is a method used to represent fractional numbers in binary. The programmer will decide the placement of the binary point, and everything to the right of the point will be the previous value halfed e.g. 1/2 , 1/4 , 1/8 etc.
Limitations:
- The range of numbers a binary number can store becomes much smaller
- Cannot represent irrational numbes

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

What is the trade off of fixed point binary?

A

The further left that the binary point moves, the **greater the accuracy **of the number becomes, but the range of values that can be stored becomes smaller.

If the point up the binary number, the accuracy reduces but the range increases (if using the same number of bits)

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

What is floating point binary?

A

Floating point binary is another method to represent large or fractional numbers. The binary number is split into two parts, the mantissa and the exponent. The mantissa is a floating point binary number which can shift up and down the number, with a single digit above the bianry point which uses two’s complement (the MSB is negative) beginning at (-) 1. The mantissa is another binary number which uses two’s complement and typically starts at (-)4. Value of the exponent is the number of times the binary point of the mantissa needs to be shifted up or down the number.

e.g.
-1 . 1/2 1/4 1/8 . -4 2 1
0 . 1 1 1 . 1 1 0

The binary number 0.111 needs to be shifted 2 times to the left (mantissa = -2)

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

What is the absolute error?

A

The absolute error is the difference between the number you are trying to represent, and the closest possible approximation of that number in a given format.

This occours when either binary number does not have enough bits to store a fractional number, or when an irrational number is trying to be stored.

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

What are the 2 types of errors in binary and how do we solve them?
What issues are created by the solutions to the above problems?

A

Overflow occurs when the result of a calculation is too large to be represented with the available number of bits.

Underflow occurs when the result of a calculation is too small, i.e. it is** too close to zero**, to be represented with the available number of bits.

Truncation/rounding - Deals with the problem of having insufficient bits to store a number. Truncation discards bits after a certain point, rounding does the same if the first bit to be discarded is 0, if the first bit to be discarded is 1, then 1 is added to the last bit before that.

This can create another problem where the binary number is no longer an accurate representation of the original denary number (bits have been lost). The difference between the binary representation of the number, and the original denary number is called the absolute error. The absolute error/the original number = the relative error

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

What are the two ways to represent images?

A

Bitmap and vector images

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

What is a Bitmap image?

A

A bitmap image is made up of single discrete picture elements of colour (pixels)
Pixels are presented together to create an image

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

What is metadata?

A

“Data about data”
Are stored along with the file itself to provide information about the file
Used to store the type of compression and how to recreate the original file
Also stored

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

What is a vector image

A

A vector image uses a list of information and mathematical equations to recreate an image based on the data
e.g. for a circle we’d need to know:
- coordinates of the centre
- radius
- fill colour
- outer colour
- outline width
Means we can recreate the circle without having about every pixel
We can represent it in a drawing list:
Circle(Centre = [2,3], Radius = 6, FillColour = “Red”…….)

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