Questions tagged [floating-point]

In computing, floating point describes a method of representing an approximation of a real number in a combination of significant digits, usually in the [1..2] range, and an exponential of 2. This allows to store higher precision and much larger range with the same amount of bits of fixed point numbers.

A floating-point unit (FPU, colloquially a math coprocessor) is a part of a computer system specially designed to carry out operations on floating point numbers. Typical operations are addition, subtraction, multiplication, division, square root, and bitshifting.

95 questions
40
votes
6 answers

Is analog signal arithmetic faster than digital one?

Would it be theoretically possible to speed up modern processors if one would use analog signal arithmetic (at the cost of accuracy and precision) instead of digital FPUs (CPU -> DAC -> analog FPU -> ADC -> CPU)? Is analog signal division possible…
39
votes
6 answers

Why does Intel's Haswell chip allow floating point multiplication to be twice as fast as addition?

I was reading this very interesting question on Stack Overflow: Is integer multiplication really done at the same speed as addition on a modern CPU? One of the comments said: "It's worth nothing that on Haswell, the FP multiply throughput is double…
Nike Dattani
  • 547
  • 7
  • 22
20
votes
9 answers

Does the "Avoid using floating-point" rule of thumb apply to a microcontroller with a floating point unit (FPU)?

As a rule of thumb, I try to avoid using floating-point in my embedded system codebase. Floating-point variables are: Computation-intensive Not atomic (can cause problems in an RTOS application or with interrupts) Their precision can cause…
gbt
  • 671
  • 6
  • 17
12
votes
3 answers

VHDL: Why is it hard to design a floating point unit in hardware?

Floating point calculation basically involves representing units in a scientific notation and then deciding how many bits to devote to the manitssa and exponent. Therefore, all calculations involving FP numbers involve these two quanities which must…
quantum231
  • 11,218
  • 24
  • 99
  • 192
8
votes
5 answers

How fast does a 64-bit multiply or divide execute on an FPGA?

When using a regular FPGA such as Xilinx Spartan 3 or Virtex 5, how many cycles does a double-precision floating-point 64-bit multiplication or division take to execute? As far as I understand, the FPGA does not have a hard FPU and you need to…
Robin Rodricks
  • 866
  • 4
  • 10
  • 14
8
votes
3 answers

DIY FP - Implementing floating point math on a microcontroller without a hardware FPU

I'm working on a little personal project (targeting a Parallax Propeller, but this should be pretty generalizable) that needs floating point math. The micro-controller I am working with does not have native floating point, or a stock floating-point…
Connor Wolf
  • 31,938
  • 6
  • 77
  • 137
8
votes
5 answers

How are numbers with decimal point handled in an MCU?

Please tell me how do MCUs handle decimal numbers like '23.3', '3.24' etc? How is it stored in a memory register? I know that I have to use float data type when handling these numbers while programming. But actually what is happening inside an MCU…
0xakhil
  • 2,225
  • 7
  • 35
  • 33
7
votes
4 answers

Any good reference for digital architecture implementations of floating point arithmetic operations?

I am doing a thesis project. I need to make a FPGA implementation of a neural network. I want to implement some mathematical functions such as an exponential function. Does anyone know of any good books about FPGAs, VHDL or digital architecture…
Peterstone
  • 945
  • 2
  • 14
  • 30
7
votes
1 answer

TMS320 Floating Point (Texas Instruments DSP from '98)

Background Is there anybody here who is an EE with programming experience who has worked with the Texas Instruments TMS320 C3X-series DSP? I am currently doing some work with the C3X for a project. My goal here is to convert C3X-formatted floating…
Snoop
  • 581
  • 1
  • 5
  • 18
6
votes
2 answers

Why is Floating point non-synthesizable in verilog

I know now a days FPGAs have very good floating point performance as reported here for example . But then why it is said that Floating point is non-synthesizable in verilog? How FPGA handles float then?
gpuguy
  • 1,618
  • 8
  • 31
  • 54
6
votes
1 answer

STM32F4 : Floating point instructions too slow

I'm working on an audio application on the Nucleo F411RE and I've noticed that my processing was too slow, making the application skip some samples. Looking at my disassembly I figured given the number of instructions and the 100 MHz CPU clock (that…
Florent
  • 370
  • 3
  • 18
5
votes
1 answer

Microcontrollers with Floating Point Hardware

I know this is a "contemporary" question, but I think it's a useful one to aggregate some knowledge. What are some currently available microcontrollers that sport a hardware floating point unit (i.e. that aren't going to cost me a huge RAM footprint…
vicatcu
  • 22,499
  • 13
  • 79
  • 155
5
votes
1 answer

Cortex-M4F FPU problems

I'm writing some code for a Texas Instruments Stellaris Launchpad board (a Cortex-M4F, the chip is a LM4F120H5QR). I'm using the IRMP library for infrared decoding, which works fine, as long as I don't use any floating point math outside of its ISR.…
AVH
  • 151
  • 5
5
votes
0 answers

Floating point addition. Are guard, round and sticky bit always necessaryl? analysis of a special case

I've a particular case of floating point addition. As you know for given floating point numbers \$x,y\$ one of the steps of the addition involves the fixed point sum: $$ s = 1.m_x + (-1)^{s_x \oplus s_y} 2^{-\delta}1.m_y, $$ I'm assuming $ |x| > |y|…
user8469759
  • 618
  • 1
  • 11
  • 25
5
votes
3 answers

Normalized and denormalized floating point numbers

Regarding the normalized and denormalized representations of binary floating-point numbers (as described in the book by Patterson), I want to know how a denormalized number is really shown. See the table below which is saying that \$e=0\$,…
mahmood
  • 333
  • 1
  • 2
  • 12
1
2 3 4 5 6 7