FPGA vs ASIC vs Microcontroller: How to Choose for a Design
When you need a digital system, you have three broad choices. A microcontroller runs a program written in C on a fixed processor. An FPGA is a chip full of configurable logic that you wire up using a hardware description language. An ASIC is a custom chip designed for one job and manufactured in a fab. Each wins in different situations, and choosing wrongly can waste months or lakhs of rupees. This tutorial explains how each works internally, compares them on speed, power, cost and flexibility, and works through a cost break-even calculation and real selection examples.
How Each Device Works
Microcontroller
A microcontroller such as an ATmega328P or STM32 contains a CPU, flash memory, RAM and peripherals like timers, UART, SPI, I2C and ADC on one chip. The CPU fetches and executes instructions one after another. Parallelism comes only from the hardware peripherals, which run independently, and from interrupts. Changing the behaviour means recompiling and reflashing the program, which takes seconds.
FPGA
A field-programmable gate array contains thousands to millions of configurable logic blocks. Each block has look-up tables (LUTs), small memories that can implement any Boolean function of their inputs, plus flip-flops and fast carry logic. A programmable routing network connects them. Modern FPGAs also include block RAM, DSP multiplier blocks, clock managers (PLLs) and high-speed transceivers. Most FPGAs store their configuration in SRAM, so it is loaded from an external flash chip at every power-up. Your Verilog or VHDL is synthesised into LUTs and flip-flops, placed and routed, and turned into a bitstream.
ASIC
An application-specific integrated circuit implements the design directly in transistors and metal wiring, using a standard-cell library from the foundry. There is no configuration overhead, so it is the fastest, smallest and lowest-power option for a given process. The design cannot be changed after fabrication, and the one-time engineering cost, called NRE, includes design tools, verification effort and photomask sets, which can be very large at advanced process nodes.
Side-by-Side Comparison
| Factor | Microcontroller | FPGA | ASIC |
|---|---|---|---|
| Design entry | C or C++ software | Verilog, VHDL or HLS | Verilog or VHDL, then physical design |
| Execution | Sequential instructions | True parallel hardware | True parallel hardware |
| Latency and determinism | Microseconds, affected by interrupts | Nanoseconds, cycle-exact | Nanoseconds, cycle-exact |
| Unit cost | Low | Medium to high | Lowest at very high volume |
| Upfront cost (NRE) | Very low | Low | Very high |
| Power for a given task | Low for control tasks | Higher, due to configurable routing | Lowest |
| Change after shipping | Firmware update | New bitstream | New silicon |
| Development time | Days to weeks | Weeks to months | Many months to years |
A useful mental model: a microcontroller trades speed for flexibility and ease, an ASIC trades flexibility for speed and efficiency, and an FPGA sits in between. FPGAs are also the standard platform for prototyping ASICs, because the same HDL can be tested on real hardware before tape-out. Hybrid parts blur the lines: the AMD Xilinx Zynq-7000 combines ARM Cortex-A9 processors with FPGA fabric, and many ASICs contain embedded processor cores.
Worked Example: Cost Break-Even
Total cost for N units is NRE plus N times the unit cost. The numbers below are illustrative, chosen only to show the method; real quotes vary enormously with process node, package and volume.
Total cost = NRE + N x (unit cost) Option A, FPGA : NRE = Rs 10 lakh, unit = Rs 1,500 Option B, ASIC : NRE = Rs 3 crore, unit = Rs 200 Break-even when costs are equal: 10,00,000 + 1500 N = 3,00,00,000 + 200 N 1300 N = 2,90,00,000 N = 22,308 units (approximately) Below about 22,000 units the FPGA is cheaper; above it the ASIC wins, if you can wait for it.
Real decisions also weigh time to market and risk. An ASIC bug found after fabrication may cost another full mask set and several months, while an FPGA bug is fixed with a new bitstream. That is why many products launch on FPGAs and move to an ASIC only once the design and the market are proven.
Hardware Thinking: An FPGA LED Blink
On a microcontroller you blink an LED with a loop and a delay function. On an FPGA there is no loop and no delay: you build a counter that divides the board clock. This short module shows the difference in thinking. Set CLK_HZ to your board's oscillator frequency and map the ports in your toolchain's constraints file.
module blink #(
parameter integer CLK_HZ = 12_000_000 // board oscillator frequency
) (
input wire clk,
output reg led = 1'b0
);
localparam integer HALF = CLK_HZ / 2; // toggle every half second
reg [31:0] count = 32'd0;
always @(posedge clk) begin
if (count == HALF - 1) begin
count <= 32'd0;
led <= ~led; // one full on/off cycle per second
end else begin
count <= count + 32'd1;
end
end
endmodule
This synthesises to a 32-bit register, an incrementer, a comparator and one flip-flop for the LED. Ten such blinkers with different rates would run in perfect parallel and use ten times the logic, whereas ten blinkers on a microcontroller would share one CPU and need scheduling.
Selection Guidelines
- Choose a microcontroller for control, user interfaces, sensors, communication stacks and anything where response in microseconds is good enough. Examples: a home automation node, a battery charger controller, a data logger.
- Choose an FPGA when you need many operations in parallel, nanosecond timing, custom interfaces or high data rates. Examples: capturing a high-speed parallel ADC, driving a custom video interface, real-time image filtering, software-defined radio front ends.
- Choose an ASIC when volume is very high, power or size is critical and the design is stable. Examples: smartphone processors, Bluetooth chips, bitcoin mining chips.
- For learning, an inexpensive Lattice iCE40 board works with the open-source Yosys and nextpnr toolchain, while AMD Artix-7 and Intel Cyclone boards use the free editions of Vivado and Quartus.
Summary
Microcontrollers execute software sequentially and are cheap, low-power and quick to develop. FPGAs implement your logic as parallel hardware using LUTs, flip-flops and routing, and can be reprogrammed at any time. ASICs offer the best speed, power and unit cost but need large upfront investment and a frozen design. Compare total cost using NRE plus unit cost times volume, and weigh time to market and the cost of mistakes before deciding.