Data Representation Flashcards
Sign and Magnitude
MSB (most significant bit – on far left of binary number) represents the sign of the number 1 = -ve 0 = +ve.
Two’s Complement
MSB represents a negative value e.g. 1000 = -8 + 0 + 0 + 0 = -8 and 1001 = -8 + 0 + 0 + 1
Real Binary Number
Binary number that involves a fractional part.
Floating Point Rep
Used to represent real numbers. Involves two numbers, the mantissa and exponent.
Mantissa
The part of a floating-point number which represents the significant digits of that number (and the sign of the number).
Exponent
It defines where the point needs to be (+ve exponent point moves right and –ve exponent point moves left).
Normalisation why
Normalisation is a way of storing numbers so that maximum precision and accuracy is obtained. It also ensures that a specific representation of a number is unique. Allows for more accurate multiplication (as it maintains the maximum number of bits of precision for a computation) If the more significant bits of the mantissa are all zero then the mantissa has that many fewer bits of precision available for computation.
Normalisation how
Normalised mantissas always start 01 or 10 (depending on whether the number is positive or negative). So the mantissas first two bits must be different for the number to be normalised. Normalisation is achieved by adjusting the exponent (in order to move the binary point).
Accuracy and Range
If the number of bits for the mantissa is increased the greater the accuracy of the values that can be represented however the range of values that can be represented is reduced. If the number of bits for the exponent is increased the greater the range of values that can be represented however the accuracy of the values that can be represented is reduced.
Denary → F.P. Binary
+ve numbers
2.5 in pure binary is 010.1. Mantissa is 010.1, move point 2 places left to 0.101 so exponent becomes 2. Exponent is 0010. Binary value is 0101 0010.
Denary → F.P. Binary
-ve numbers
+3.5 in pure binary is 011.1 so -3.5 (write up to first 1 and change bits) = 100.1. Mantissa is 100.1, move point 2 places left to 1.001 so exponent becomes 2. Exponent is 0010. Binary value is 1001 0010.
F.P. Binary → Denary
+ve numbers
0100 0010. Exponent 0010 = 2. Mantissa is 0.100, move point 2 places right becomes 010.0. Value is +2.
F.P. Binary → Denary
-ve numbers
1001 0010. Exponent 0010 = 2. Mantissa is 1.001, move point 2 places right becomes 100.1. Convert as mantissa is -ve (write up to 1st 1 and change bits) 011.1. Value is -3.5.