5
\$\begingroup\$

If we don't count the cost of both (MCU, FPGA) are there any applications where a microcontroller can be more efficient than an FPGA? It is easier to program a microcontroller than an FPGA (embedded C vs VHDL, for example) but if someone spent time and implemented the MCU design inside an FPGA, then the FPGA could be used for the same application as the MCU but more efficient because we can implement more than a single MCU in an FPGA.

I was wondering if the only application that an MCU can be more efficient than an FPGA is when we connect an analog sensor to the MCU (for example an analog source that harvest entropy in case of producing random numbers etc)? Is this correct or I am totally wrong?

edit(as gbulmer suggested): My criteria for efficiency are speed of execution and throughput/watt

\$\endgroup\$
4
  • 2
    \$\begingroup\$ How do you measure efficiency? die size, number of gates, energy consumption, throughput, throughput/watt, programmer time? \$\endgroup\$ Oct 5, 2014 at 10:06
  • \$\begingroup\$ i am more interested in speed of execution and throughput/watt if it is possible. \$\endgroup\$
    – user29966
    Oct 5, 2014 at 10:12
  • 4
    \$\begingroup\$ Please edit your question and add "speed of execution and throughput/watt" as your criteria for 'efficient'. By ding that you will make your question clearer to people reading it, and it will make sense without having to read the comments. \$\endgroup\$
    – gbulmer
    Oct 5, 2014 at 12:29
  • \$\begingroup\$ If it was better to just use FPGAs for everything, don't you think that's what everyone would be doing? An MCU implemented in an FPGA won't ever be as efficient as that MCU straight up, assuming similar underlying semiconductor technology. \$\endgroup\$ Oct 5, 2014 at 16:48

2 Answers 2

12
\$\begingroup\$

See When can FPGA's be used and Microcontrollers/DSPs not?

Microprocessors will nearly always win on throughput/watt. For total throughput, you can get quite good results with DSP chips, larger microcontrollers, or ARMs with onboard graphics cores. Although it may be hard to repurpose the graphics cores to other applications if the platform doesn't support CUDA or similar.

FPGAs win on latency, especially if you want to guarantee low latency response to lots of inputs. You can only have one highest priority interrupt on a microcontroller. FPGAs are also good if you want a fixed-function process that doesn't use a lot of RAM, such as a compression algorithm from some sort of signal capture.

\$\endgroup\$
3
  • \$\begingroup\$ For fixed-function processes you mean microcontrollers are good? \$\endgroup\$
    – user29966
    Oct 5, 2014 at 10:30
  • \$\begingroup\$ No, FPGAs ae good for fixed-function pipelineable algorithms. Will edit. \$\endgroup\$
    – pjc50
    Oct 5, 2014 at 12:59
  • \$\begingroup\$ +1 for link. That question elicited a lot of useful answers. \$\endgroup\$
    – gbulmer
    Oct 5, 2014 at 13:57
8
\$\begingroup\$

The key difference between FPGA's and microprocessors/microcontrollers is that a µp is a specialized circuit, and an FPGA is a general circuit that can be 'run-time' configured. In a fair comparison (same die size and process parameters) a µp/µc will win for what it is designed for: running vastly different sequences of instructions, with little repetition and lots of decisions and data dependencies. In the extreme, think of running Linux or Windows, or a scaled down equivalent for a smaller µc.

An FPGA will win when it can use its configurability and parallellism: on simple and repeated transformations, that do not translate effectively to µc/µp instructions.

Take for instance IEEE floating point calculations. A µp/µc will often have dedicated hardware for that, which is more efficient than an FPGA configured to do the same. But change a few trivial details in the IEEE specification, and the µc/µp hardware is useless, but the FPGA can be configured accordingly, and it will be as efficient as it was with the original specs.

Note that a µc/µp can trade throughput for complexity: if you make the task more complex, it can still do it, but it will take more time. An FPGA will need more FPGA real estate if the job gets more complex. In other words: in an FPGA the functionality is spread over (requires more) the FPGA real estate, in a µc/µp it is spread over (requires more) time.

Summary: a µc/µp will be more efficient for what it is designed for (which is general serial computation), an FPGA will be more efficient for a 'small' parallelizable task.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.