I commonly see floating point numbers being used when bench-marking processors in common bench-marking software such as geekbench. I just wonder how are each handled by the processor/ memory?
asked Oct 30 '12 at 05:23
A floating point operation or 'FLOP' is the type of calculation used by the benchmark to determine how powerful the processor/gpu is?
answered Oct 30 '12 at 06:08
Integers are stored as a binary number. For example, the number 7 would be stored as 00000000000000000000000000000111 in a 32 bit computer.
Floating point numbers are stored slightly differently. The following link will take you to a page which explains exactly how floating point numbers are stored - http://introcs.cs.princeton.edu/java/91float/
The instructions which the processor gets from the memory are also stored as binary numbers. Each instruction that the processor can do is given a binary number. The list of instructions and the binary numbers for the instructions is called the Instruction Set. The computer will read the instruction from memory, and then process the data appropriately.
Hope this helps! :)
ok here is some background:
an integer is nothing more then a binary number you have two flavors unsigned and signed, unsigned is pretty simple if you know binary. Signed, however, you have a sign bit and something called twos complement. being that this is not what you asked we will skip over this.
a floating point number can represent really large number and really small number, it is very different
a floating point number has three parts, the sign, the exponent, and fraction.
The sign part is always one bit, and is the most significant bit in the number.
The exponent is 8 bits in a single floating point and 11 in a double floating point number.
The fraction represents the fractional part it is 23 bits in a single and 52 in a double.
There are some special cases for example you have the number 0, infinity, negative infinity, and NaN (not a number)
If the value is zero both the exponent and the fraction are both 0, sign bit does not matter.
If the value is infinity the exponent is all ones, and fraction is all zeros, sign bit is zero
If the value is negative infinity the exponent is all ones, the fraction is all zeros and the sign bit is 1.
In this case for NaN the exponent is all ones, the fraction is a non zero number, and the sign does not matter.
When you are adding to floating point numbers here are the steps:
This is a very detailed topic and i cannot get into all of it now. everything is detailed in the IEEE 754 standard.
answered Nov 04 '12 at 09:29