login about faq


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

mfrondella's gravatar image

mfrondella
1222


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

Tim%20Fontana's gravatar image

Tim Fontana
15.2k135198367

so how is a floating point / integer number handled by the processor/ memory ?

(Oct 30 '12 at 06:20) mfrondella mfrondella's gravatar image

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! :)

answered Oct 30 '12 at 10:10

Ryan1996's gravatar image

Ryan1996
91238

edited Oct 30 '12 at 10:13

Thanks for the help ;P but wouldn't the FPU and ALU be used in the processing ?

(Nov 03 '12 at 06:41) mfrondella mfrondella's gravatar image

FPU for floating point numbers and ALU for integer numbers

(Nov 03 '12 at 06:41) mfrondella mfrondella's gravatar image

Floating points are probably used as a simple way to generate a lot of work for even a strong CPU. I would assume that integers would occur periodically though unintended. Is that what you were asking?

(Nov 03 '12 at 17:12) ClosetFuturist ClosetFuturist's gravatar image

Im Asking how the processor/ memory handle integer and floating point numbers? Are they handled by using the ALU and the FPU?

Thanks :P

(Nov 04 '12 at 04:45) mfrondella mfrondella's gravatar image

The ALU passes the binary through logic gates, (in the form of transistors) which will output the result. The logic gates it passes through will differ depending on the instruction. The FPU is a little bit more complicated. It also uses logic gates to process the operands, but it uses a more advanced algorithm to do so. As trueb said, if you want to know the process that the FPU uses, then look at the IEEE 754 standard, as that outlines it all. Hope this information helps!

(Nov 04 '12 at 11:45) Ryan1996 Ryan1996's gravatar image

Considering the current ways of threading and caching that's probably quite a can of worms. Well over my head to say the least.

(Nov 04 '12 at 16:50) ClosetFuturist ClosetFuturist's gravatar image
showing 5 of 6 show all

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:

  1. Extract the exponent and fraction bits
  2. Prepend leading 1 to form the mantissa
  3. Compare exponents
  4. shift smaller mantissa if nessary
  5. add mantissas
  6. normalize mantissa and adjust exponent if necessary
  7. round the result
  8. assembly exponent and fraction back to floating point number.

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

trueb's gravatar image

trueb
14.9k4899256

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported


Join Us in the Chat Room

Tags:

×1,411
×151
×134
×29
×3
×2

Asked: Oct 30 '12 at 05:23

Seen: 467 times

Last updated: Nov 04 '12 at 16:51