30
\$\begingroup\$

I have read this post and it does not answer my question in its entirety:

I think of a microcontroller as anything that has some memory, registers, and can process a set of instructions such as LOAD, STORE and ADD. It contains logic gates and such to perform its role, but its main task is to be a universal processor of bits. I think of a microntroller as a system of interconnected ASIC designs to create the ability to store and process instructions.

I think of an ASIC device as a circuit that has been specifically constructed using logical and electrical components to perform one single task, with no other task in mind nor extra hardware included.

I think of an FPGA device as an ASIC device (a low-level device) + a bunch of unused stuff left over, used to implement a particular truth table.

Despite its name, an FGPA feels very "application-specific", since it must be rewired to perform a new and different task. This leads to confusion with ASIC. Albeit, in the case of rewiring an FPGA, all necessary hardware should be present. Also, FPGAs are meant to be programmable, but isn't that what a microcontroller is meant for?

The post above I referenced also mentions HDL, with which I am familiar. Can't HDL be used for both ASIC and FPGA, and by proxy to design an entire microcontroller?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ It's not very clear what your question is. Have you read related questions on FPGA vs ASIC? HDL is indeed actually used to design ASICs and FPGA implementations, and you can design a microcontroller in HDL. \$\endgroup\$
    – pjc50
    Jan 20, 2015 at 10:58
  • 3
    \$\begingroup\$ Altera offers a free ebook called FPGAs for Dummies, which explains the difference between FPGAs, ASICs, and microcontrollers well. \$\endgroup\$
    – kkrambo
    Jan 20, 2015 at 13:35
  • \$\begingroup\$ @kkrambo You callin' me a dummy? :) Sorry, couldn't resist... I will check it out. \$\endgroup\$
    – user58446
    Jan 20, 2015 at 23:40
  • \$\begingroup\$ I added the word 'similarities' to the question title, because it seems that there are minute technical jargon details which may confuse how the three different devices relate: for instance one device may contain one of the other two devices, or it may contain many similar components but differ in some important aspect. This has already been touched on by some of the existing answers. Thank you. \$\endgroup\$
    – user58446
    Jan 20, 2015 at 23:59

7 Answers 7

34
\$\begingroup\$

ASIC vs FPGA

A Field Programmable Gate Array can be seen as the prototyping stage of Application Specific Integrated Circuits: ASICs are very expensive to manufacture, and once it's made there is no going back (as the most expensive fixed cost is the masks [sort of manufacturing "stencil"] and their development). FPGAs are reprogrammable many times, however because of the fact that a generic array of gates is connected to accomplish your goal, it is not optimised like ASICs. Also, FPGAs are natively dynamic devices in that if you power it off, you loose not only the current state but also your configuration. Boards now exist though that add a FLASH chip and/or a microcontroller to load the configuration at startup so this tends to be a less important argument. Both ASICs and FPGAs can be configured with Hardware Description Languages, and sometimes FPGAs are used for the end product. But generally ASICs kick in when the design is fixed.

FPGA vs microcontroller

As for the difference between a microcontroller and a FPGA, you can consider a microcontroller to be an ASIC which basically processes code in FLASH/ROM sequentially. You can make microcontrollers with FPGAs even if it's not optimised, but not the opposite. FPGAs are wired just like electronic circuits so you can have truly parallel circuits, not like in a microcontroller where the processor jumps from a piece of code to another to simulate good-enough parallelism. However because FPGAs have been designed for parallel tasks, it's not as easy to write sequential code as in a microcontroller.

For example, typically if you write in pseudocode "let C be A XOR B", on a FPGA that will be translated into "build a XOR gate with the lego bricks contained (lookup tables and latches), and connect A/B as inputs and C as output" which will be updated every clock cycle regardless of whether C is used or not. Whereas on a microcontroller that will be translated into "read instruction - it's a XOR of variables at address A and address B of RAM, result to store at address C. Load arithmetic logic units registers, then ask the ALU to do a XOR, then copy the output register at address C of RAM". On the user side though, both instructions were 1 line of code. If we were to do this, THEN something else, in HDL we would have to define what is called a Process to artificially do sequences - separate from the parallel code. Whereas in a microcontroller there is nothing to do. On the other hand, to get "parallelism" (tuning in and out really) out of a microcontroller, you would need to juggle with threads which is not trivial. Different ways of working, different purposes.

In summary:

ASIC vs FPGA: fixed, more expensive for small number of products (cheaper for high volumes), but more optimised.

ASIC vs microcontroller: certainly like comparing a tool with a hammer.

FPGA vs microcontroller: not optimised for sequential code processing, but can do truly parallel tasks very easily as well. Generally FPGAs are programmed in HDL, microcontrollers in C/Assembly

Whenever speed of parallel tasks is an issue, take an FPGA, evolve your design and finally make it an ASIC if it's cheaper to you in the long run (mass production). If sequential tasks are okay, take a microcontroller. I guess you could do an even more application specific IC from this if it's cheaper to you in the long run as well. The best solution will probably be a bit of both.

What a quick search after writing this gave me: enter image description here enter image description here

FPGA vs Microcontrollers, on this very forum

\$\endgroup\$
17
\$\begingroup\$

FPGAs can be "re-wired" by re-programming. A FPGA loads it's configuration into it's configurable logic cells when powered. This means it can be re-programmed with no changes to the hardware.

ASICs can only be re-wired by modifying the photolitographic masks at the silicon foundry.

A microcontroller is a type of ASIC, that executes a program and can do generic things as a result. However, if you want to alter the instruction set, or do something similar, you have to modify the actual silicon IC layout.


The difference between a FPGA and a MCU is more fuzzy. Basically, what a FPGA is, at the hardware level, is a lot of small SRAM cells, all connected to a dense matric of multiplexers. Basically, a FPGA is a whole pile of discrete logic that can be electronically "re-wired" **simply by reprogramming the multiplexers and SRAM cells.

As such, you can actually implement a MCU within a FPGA, since a MCU is just a certain configuration of logic cells. In fact, FPGAs are very commonly used in the design process of MCUs.

A microcontroller is a implementation of a certain logic configuration. The reason we have them is that by implementing a MCU directly in the silicon, the overall amount of silicon die space required can be considerably optimized, and certain performance optimizations can be made that the required "genericness" of a FPGA prohibits. This allows the production costs of a MCU to be reduced dramatically, and as a result, the common MCU is much cheaper then a FPGA that's capable of containing the equivalent logic.


FPGAs are useful in certain applications, because they can implement logic structures in a manner that MCUs cannot. For example, if you need to add X1 + Y1, X2 + Y2, X3 + Y3, and X4 + Y4, the MCU will have to do each operation in sequence *. A FPGA can simply have 4 separate ALUs at the same time, so it can do the same operation in a quarter of the time (assuming the two devices are clocked at the same rate).

This is where FPGAs (or ASICs designed for the same task) can really shine, in the fact that you can do many, many things simultaneously, which a single-process can only do sequentially.

* (note: I'm ignoring some things like SIMD here)

\$\endgroup\$
2
  • \$\begingroup\$ I don't think the FPGA/ASIC distinction is fuzzy; in an FPGA, the circuits whose "wiring" can be changed operate simultaneously and independently. An MCU has a large quantity of circuitry whose wiring cannot be changed, whose behavior is controlled through information which is accessed piecemeal from a programmable memory array. At any moment in time, a CPU will generally only be able to perform one operation from a list of a few thousand to a few billion choices, but the MCU will be designed so that putting such operations together in sequence will make it possible to do useful work. \$\endgroup\$
    – supercat
    Jan 20, 2015 at 20:52
  • \$\begingroup\$ Thank you. VERY close to becoming the answer... albeit 10 months later. +1 to make ammends. \$\endgroup\$
    – user58446
    Nov 26, 2015 at 1:59
6
\$\begingroup\$

This is a good question,

Basically a micro controller and an ASIC have hardware (often referred to as silicon) that is set in stone and can't be changed. An FPGA can be configured to represent many different kinds of hardware (this can include micro controllers).

You may think that a micro controller can be made to do many different things but this is all done by running different programmes - technically software but sometimes referred to as firmware - the hardware itself doesn't change essentially it does the same operations but in a different order with different inputs.

FPGAs are usually used to generate the designs that are committed to ASICs the difference between them is that if you wanted to update the inner workings of an FPGA or add/remove functional blocks all you need to do is update it's firmware, this can't be done on ASICs as the inner workings have been committed to silicon, it is not reconfigurable.

So in short, with a micro processor you use the same hardware to run different programmes, with an FPGA you are reconfiguring the hardware to perform different functions and ASICs are like a micro controller in that the hardware cannot be changed but are usually designed to perform a single function extremely efficiently.

Both ASICs and FPGAs can contain micro controllers and if they do you can write programmes for them as you would a stand alone micro controller, an example of this is Altera's NIOS II embedded processor.

If this is still confusing, let me know what about it is unclear and I will do my best to clarify my answer.

Gipsy

\$\endgroup\$
4
\$\begingroup\$

well, no an FPGA is programmed by electrical signals if behave like a specific collection of gates, some FPGAs include flash memory to store this configuration, some do not and must be reprogrammed after every power reset.

An ASIC comes off the production line already configured.

FPGA bugs can be fixed with a firmware upgrade, ASIC bugs can't economically be repaired.

\$\endgroup\$
2
\$\begingroup\$

Despite its name, an FGPA feels very "applcation-specific", since it must be rewired to perform a new and different task.

That's the opposite of what "application-specific" means. You can use an FPGA for more than one application by rewiring it. You cannot change an ASIC, so it can only be applied to one task (that task may be implementing a microcontroller).

Albeit, in the case of rewiring an FPGA, all necessary hardware should be present.

Not sure what this means. Usually there's a software interface for reprogramming an FPGA. It's an ASIC that requires millions of [currency unit]s of hardware.

FPGA's are meant to be programmable, but isn't that what a Microcontroller is meant for?

A microcontroller allows you to program sequential software for a fixed hardware. Just like a normal computer, but very small and resource limited. An FPGA allows you to program any hardware you want using an HDL.

\$\endgroup\$
0
\$\begingroup\$

The other answers cover the differences well enough. I wanted to point out that a microcontroller is really a system on a chip. Typically it will have a microprocessor of some sort, which can run code compiled in C and other languages. Also on board are a variety of peripherals. These can include ADCs, DACs, PWM controllers, quadrature decoders, capacitive touch controllers and many, many other things. There are a zillion different types of these things. Often, they have embedded flash memory and SRAM, so that very little is needed outside the chip for support. There are high performance and low performance versions, versions with hundreds of pins and others with 8 and everything in between.

\$\endgroup\$
3
  • \$\begingroup\$ Microcontrollers were around long before they started incorporating peripherals (ADCs, DAC, etc). They were not considered SOCs. \$\endgroup\$
    – SteveSh
    Sep 1, 2022 at 19:42
  • \$\begingroup\$ Fair enough. When I hear Microcontroller today, I think of SOCs. I'm sure this is due to my work experience. \$\endgroup\$
    – Troutdog
    Sep 12, 2022 at 18:50
  • \$\begingroup\$ That's OK. There's not a hard and fast distinction, or dividing line between, say micoprocessors, microcontrollers, SOCs, etc. They sort of morph from one to the other as more features and capability is added, and how they are used. Some of this is marketing hype also. \$\endgroup\$
    – SteveSh
    Sep 12, 2022 at 19:17
0
\$\begingroup\$

First let get something clear. What is a digital circuit? A digital circuit is made up of logic gates and registers. The logic gates implement boolean operations that follow the rules of boolean algebra. The registers are capable of storing data. By expressing real world quantities in binary arithmetic in electrical form, we can build circuits that can carry out arithmetic and logic operations of the real world quantities and give an output as an electrical signal.

The processor as it is called is a high complex digital circuit which contains a CPU, memory and ALU. These are all digital circuit components that are themself made up of registers and logic gates and work together in a processor. We can specify a program to the processor which it will execute step by step. In each step it will access memory to load or store data. It will carry out some arithmetic (add, subtract, multiply, divide e.t.c) or logic (equality, greater than, less than, not equal) operation on the data between loading and storing it. The processor is a highly flexible digital circuit. To make the processor do something different, we just change the program. The program is usually written in a high level language like C and then coverted into machine code. The program basically contains a sequence of 0 and 1 when it stored into the program memory. Being able to program the same circuit with little effort to make it do something completely different is The power that makes processor so important.

Now as powerful and flexible as a processor is, it is not suitable for all applications. There are many applications where we want the digital circuit to do only 1 specific thing and that is it. In this case, a general purpose processor might not even be fast enough to do that one thing by not having sufficient processing bandwidth to process that much data in the time constraint given to give the type of result we need. In this case, we design a digital circuit for a specific purpse.

A digital circuit is usually manufactured using semiconductor materials. Usually this will be using Silicon. The actual steps are not important for our discussion here. The manufacture process shall create logic gates and registers on a piece of silicon. These are extremely small in size, maybe a few nano meters across. The manufacture process will also create the electrical connections between them. Manufacturing a digital circuit like this is VERY expensive and only done for very high volume products where millions of parts will be manufactured and sold. Once manufactured, the piece of silicon will have the design "set in stone" i.e it cannot be changed, not even to debug the hardware. If we need to make changes, we manufacture the design again from scratch. This actually how the microprocessors and microcontrollers are manufactured.

Now an alternative to going through the 6 month process of manufacturing a digital circuit, perhaps only to find it has bugs, is to use something called FPGA. This is a circuit component that contains a huge number of gates and registers, that can be configured to interconnect in a specific way to realise a specific digital circuit and we can usually change this interconnect order quite easily. FPGAs are used to prototype an ASIC design before going through the VERY expensive design cycle. They are also used as the actual device implementing the digital circuit in a low volume product. Now the question that arises is, if FPGAs have this capability then why not just implement everything in them? Without going into too much detail what I will say is that, FPGAs cannot run at very high frequency like GHz range, this is a limitation resulting from how they are designed on silicon. It is the drawback we must live with for the high flexibility. However, this is not the only reason. They usually need more power (remember they run on electricity) vs an ASIC having similar number of logic gates and registers. If we have a product that will be manufactured in millions of parts, then an ASIC will be cheaper per part than shipping the product with FPGA.

An application will have certain constrains which are usually cost, time to market, production volume, power dissipation, data bandwidth required among others. All these will be considered to decide whether to use ASIC, GPU, Microcontroller, Microprocessor or FPGA. Nowadays we have very extremely highly complex FPGAs like the Xilinx MPSoC device that integrate multicore ARM processors with programmable logic of FPGA to get the best of both worlds.

\$\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.