Sign and Magnitude
The most significant bi(MSB) is simply to represent the sign : 1 means the number is negative 0 means its positive
-4 as binary is exactly the same as denary to binary but we change the last number
10000100 = -4
00000100 = 4
replace last number with 1 or 0 but it then means you can only represent with 7 bits
can only represent -127 to 127 as the 8 bit is wasted changing the negativity
or -255 to 255
Twos complement - if it is in twos complement then it will change the whole binary number
more efficient as you use the whole number range.
e.g to work out 90
you first work it out in binary 01010110
you then have to make - 90
you leave all numbers until first 1 and leave it (then invert all of them)
01010110
10101010
most significant part is negative for example
-128 64 32 16 8 4 2 1
1 0 1 0 1 0 1 0
floating point numbers in binary
Floating point binary is used to hold really big, really small or really accurate
numbers using just 8 bits.
Using the example 0.92 × 10 squared , 0.92 is the mantissa, 10 is the base and 2 is
the exponent.
The mantissa is the part of the floating point number that represents the
significant digits of that number.
The exponent is the power to which the number in the mantissa is to be
raised.
The larger number of bits used in the mantissa will allow a number to be represented
with greater accuracy, however this will reduce the number of bits in the exponent and
consequently the range of values which can be represented.
maintissa = accuracy
exponent = range
No comments:
Post a Comment