Most engineers begin embedded-systems training by learning about microcontrollers. Microcontrollers entail a complete miniature computing system on a single integrated circuit. The CPU, RAM, ROM, and input/output peripherals are on a single thumb-sized, system-on-a-chip (SoC) — the integrated circuit that comprises all or most of the electronic components.
Aside from the components, another part of embedded design relates to software development. Microcontrollers (and microprocessors) have an instruction set that remains fixed in size and operation, which means that an engineer uses the same instructions via assembly language or embedded C to solve a computing task, typically for a real-world application.
The good news is that working with microcontrollers is relatively simple to learn, given experience with programming languages. Popular versions, such as the AVR, 8051, PIC, and ARM expose engineers to the software development aspect of embedded systems. So, there are several options.
However, there’s also another approach to embedded software development for which microcontrollers lack the capacity: hardware-based embedded design. For this, a field-programmable gate array (FPGA) is required.
FPGAs were invented by Xilinx in 1984. They’re integrated circuits that contain millions of logic gates that configure electronically to perform specific tasks (meaning, the gates are field-programmable).
Let’s compare an FPGA to a computer. The computer (which could be a microcontroller, microprocessor, or graphic processor) is a digital electronic circuit that performs tasks based on an instruction set. These instructions contain machine codes that are implemented by the digital circuitry of the computer on data, where the data is stored and manipulated on registers or memory chips.
Alternatively, an FPGA takes the design to the hardware, so an engineer can design a (simple) computing device from the architecture level to perform specific tasks or applications.
Microcontrollers versus FPGAs
Although an FPGA is often used to design digital circuitry to perform simple computational tasks, it’s no match to a microcontroller in computing terms. Microcontrollers and microprocessors are true computing devices with complex architecture.
An FPGA is comparable to and can work with application-specific integrated circuits (ASICs). An ASIC is customized for a particular task, rather than for general-purpose use. In fact, any ASIC function can be custom-designed and fabricated on an FPGA.
Where microcontrollers let engineers with expertise in assembly or high-level programming language design software for a computer, an FPGA allows for the design of a simple computing device. This hardware-based embedded design requires detailed knowledge of digital circuits and computer architecture.
A few differences in the language:
- Microcontrollers are programmed using an assembly or a high-level language (such as ‘C’), which is converted to machine code for execution on a CPU.
- FPGA chips are programmed using either Verilog or very high-speed integrated circuit hardware description language (VHDL). VHDL is converted to digital logic blocks that are fabricated on FPGA chips to design a customized computer for specific applications. By using VHDL or Verilog, an engineer designs the data path and arithmetic logic unit (ALU) hardware from the root level. Even a microcontroller can be designed on an FPGA, provided there are sufficient logic blocks to support the design.
It makes sense to first learn about microcontrollers and microprocessors because it’s important to understand how computers operate and are programmed to perform specific tasks. Microcontrollers, FPGAs, and CPLDs (complex programmable logic devices) are independent embedded systems with their own pros and cons.
FPGAs extend this knowledge to the hardware circuitry, with knowledge about how computers are built.
Advantages of FPGAs
FPGAs not only serve as a way to learn about digital design and computer architecture, but these chips also offer real-life applications in embedded systems engineering. They provide an alternative to ASICs, with certain advantages…
Multi-threading. FPGAs can process multiple instructions at the same time or in parallel form. This is a big advantage over microcontrollers, which can only execute one instruction at a time, sequentially. This means FPGAs are typically much faster at processing tasks. Since these processes are logically coded at the hardware level, FPGA chips are ideal for dedicated or specialized applications, including pre-processing sensor data, cryptography, logic circuit designing, digital audio applications, video streaming, and more.
Microcontrollers, on the other hand, have a generic architecture with a dedicated instruction set, which makes them better suited for solving complex computational tasks at slower speeds that may require standard interfaces.
Overall, FPGAs have an edge when the volume of data to be processed in an application is high, thanks to this multi-threading feature. Today, FPGA boards are available with built-in CPUs, so only design logic is required for application-specific processing.
Flexibility and scope of design. Any digital circuit, regardless of complexity, can be designed on an FPGA, provided the chip contains a sufficient number of logic blocks to emulate the design. So, technically, FPGAs can be used to design any peripheral or perform any computing task.
They can also be programmed to have several timers, channel UARTs, or channel pulse width modulation (PWM) generators — unlike microcontrollers, which do not offer such flexibility. This is because there is no way to alter the chipset in a microcontroller to suit an application. Instead, they have a generic computing unit and in-built peripherals (such as the timers, GPIO, interrupts, and serial interfaces).
This flexibility of FPGAs gives greater power to engineers for specialized designs.
Analog factor. Typically, in any embedded system, the controller or processor is coupled with sensors that provide analog input or actuators that require analog output from the controller or processor.
Field-programmable analog arrays (FPAA) are also an option that let designers program complex analog circuits. Many FPGA chips include FPAAs, so the chip can be programmed for a digital circuit and process analog signals. These mixed-signal chips contain analog-to-digital converter (ADC) or digital-to-analog converter (DAC) peripherals, coupled with analog signal conditioning blocks.
The output pins in such devices can be programmed for drive strength and slew rate as required by the load at that pin. This is another example of how FPGAs offer greater flexibility, with the ability to offer analog programming for specific applications.
Reusability. FPGAs can be reprogrammed to emulate any other digital (or analog) circuit, so a circuit is never fixed. When the chip is powered on, the digital design per the configuration data is loaded onto the chip. This happens every time the chip is powered on.
The configuration data can be changed for the next start with a new design. As the chip is reusable, an engineer can endlessly experiment with different digital designs on the same chip.
Single-chip solution. FPGAs offer a single-chip solution to an application. This is different than microcontrollers that typically must interface with other peripherals (which might not be in-built), interfaces, or ASICs.
Real-time processing. FPGAs are not generic computing ICs but are used to design a dedicated computing device on the chip. Unlike microcontrollers, which run a program (machine code), the data paths and ALU are fabricated on the FPGA to solve a computing task.
This means that instead of running a program, the FPGA is programmed to operate for a specific task. This execution of logic at the hardware level allows for the real-time processing of data and information. This is why FPGAs are often used for high-speed, critical applications where a microcontroller might fail because of its dependency on code to run on a fixed architecture with a limited instruction set.
Given these advantages, FPGAs are ideal for high-speed parallel processing where the volume of data to be processed is large or the processing chip requires customized peripherals, configurable analog output, or a time-critical dedicated application (which would not otherwise be possible on a generic CPU).
FPGAs provide access to complex integrated designs that are otherwise only available at a high engineering cost. This chip is like a mini semiconductor foundry on a credit card-sized board.
In real-world applications, FPGAs are used in specific verticals where the production volume is low. It’s extensively used in prototyping ASIC designs, typically offering a quick time-to-market without a lengthy fabrication process.
Common applications include digital-signal processing, image processing, bioinformatics, cryptography, software-designed radios, medical imaging, voice recognition, telecommunications, data centers, aerospace electronics, and security systems.
In comparison, microcontrollers are used in general embedded applications, such as for automotive, consumer and industrial electronics, communication systems, and others.
Drawbacks of FPGAs
There are a few significant cons related to FPGAs, depending on the application. These include the complexity, high power requirements, and price point.
Cost – FPGA boards are more costly than microcontrollers (about $50 compared to $10 or less). This is one reason FPGA chips are typically not discussed at the beginning of a training course about embedded design.
However, FPGAs are reusable, giving them greater long-term value, particularly for R&D or prototype purposes. In other cases, despite the low speeds and generic architecture of microcontrollers, they’re often just more affordable.
High-power requirement. Most FPGA boards are powered by a 48-V backplane. Unfortunately, the high-power requirement makes them unsuitable for several embedded applications. Compare this to microcontroller boards, which typically only require a 5 or 3.3-V supply for operation. They’re the obvious choice for the design of any battery-operated, portable embedded device.
Volatility. An FPGAs digital design is passed to it via configuration data. When powered on, the board is configured accordingly and begins operating. The configuration data must be stored on flash memory in master mode or passed by a processor through a boundary-scan (JTAG) interface in slave mode. This data is lost once the board is powered off.
The volatile nature of most FPGAs makes them unsuitable for applications where there’s a risk of power loss or interruption.
Start-up time. FPGAs must load configuration data every time they are powered on. This adds significant start-up time to its operation. However, once the configuration data is loaded, an FPGA board typically operates much faster than a microcontroller.
The start-up time might be an issue for certain critical applications that require immediate action upon activation. FPGAs are not fit for applications where the embedded device goes on and off frequently. It’s also not possible to keep these chips continually powered on within an embedded device due to its high power requirement.
High pin count. In general, most FPGAs have several pins. Therefore, these chips are not ideal for small spaces or constrained embedded applications where the computing processor or controller must be compact. In contrast, there are many microcontrollers with eight pins or less, which easily fit in small devices.
Complexity. Working with FPGAs takes detailed knowledge about digital design and computer architecture. It’s not as simple as with microcontrollers. The languages for FPGAs — VHDL or Verilog — are fairly complex to learn compared to the high-level programming or assembly language required for software development.
Although most of the tools for FPGA development are available for free, they’re complex to use and it can be tough to choose the ideal board. There are also many complications, traps, and cautions in digital design that can only be learned over time and with practical experience.
Design limitations. It’s only possible to interconnect the logic blocks for a digital design with FPGAs. There’s also no control at the gate level and, typically, the synthesis is non-standard. However, FPGAs are excellent for testing architecture or for an early-stage ASIC design.
Durability. FPGA ICs have a short lifespan compared to microcontrollers. While microcontrollers can last in a device for decades, an FPGA chip in an embedded device typically requires replacement every two to five years.
The high cost, pin, count, and power requirement, as well as the complexity, volatility, and design limitations have meant that FPGAs are less common in embedded applications. Currently, they’re only used in high-power devices that require a dedicated architecture, custom peripherals, or a critical machine code execution through parallel processing.
FPGAs have advantages and disadvantages. It depends on the application. In general, they give engineers greater access to hardware design and an ability to explore integrated circuits, which are impossible with microcontrollers. But this requires a certain level of knowledge and experience. It can be worth it though to get a full understanding of embedded design engineering.
Whereas microcontrollers and processors offer software experience, FPGAs provide hardware knowledge. And much like after first building code from scratch, experience makes it easier over time.
You may also like:
Filed Under: Tech Articles