[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help !!
sorry, need helps on another topic: representation of
floating point in Digital computer ..
assume real-number is represented as 32-bits as follows:
-------------------------------------------------
fraction ! exponent
-------------------------------------------------
24 bits for fraction 8 bits for exponent
the 1st bits of fraction and exponent is sign bit
the floating point must be normalized ;ie that the first bit and second
bit in the fraction must be of opposite sign. for example
positive number 0 1 .......
negative number 1 0 .......
so a real number is computed as +- a * (2 ** b)
where 0.5 <= abs(a) <= 1.0 (abs = absolute value)
and -128 <= b <= 127
question: given a real number, need an alogorithm to convert it
into the above machine reprensentation.
PDP
hi all,
assume: negative integer is represented in digital computer
as 2 complement and assume 4 bits computer
so -3 looks like: 1101
and 1101 = 13 as a positive number (forget the sign bit)
13 = 16 - 3
so in general if we have n-bits computer, a negative integer number
b in 2 complement is 2**n + b (in postive representation).
the above statement is intuitively true.
Comment anyone ???.
PDP