FPGA Vs MCU--Another Method of Embedded Design

Most engineers start their journey with microcontrollers in embedded systems. With microcontrollers, one can get a complete micro-computing system on one integrated circuit. The CPU, RAM, ROM and I/O peripherals are all on a single thumb-sized SoC. This very popular method of learning embedded design and development is really just one side of the whole picture. Using microcontrollers (and microprocessors) is entirely software-based embedded design. Microcontrollers have their own instruction sets, which are fixed in size and operation. When working on microcontrollers, engineers use the same instruction set through assembly language or embedded c to solve some computing tasks in real-world applications.
Using a microcontroller is fairly easy. Popular microcontrollers like AVR, 8051, PIC, ARM, etc. nicely show engineers the software development side of embedded systems. But there is another approach to embedded development—hardware-based embedded design. Unfortunately, microcontrollers lack the ability to educate engineers about this aspect of embedded development. Here comes the FPGA.
Field Programmable Gate Arrays (FPGA) were invented by Xilinx in 1984. These integrated circuits contain millions of logic gates that can be electrically configured (eg, the gates are field programmable) to perform certain tasks. Any computer, such as a microcontroller, microprocessor, graphics processor, or application-specific integrated circuit (ASIC), is basically a digital electronic circuit that performs certain tasks according to a set of instructions. The instruction set contains machine code that can be implemented by the computer's digital circuits on some data, which is stored in registers or memory chips. FPGAs elevate design to the hardware level, where engineers can design a (simple) computing device from the architectural level, this simple computer is designed and built to perform a specific application.
Figure 1: Field Programmable Gate Array (FPGA) for Embedded Systems

Figure 1: Field Programmable Gate Arrays (FPGAs) for Embedded Systems
While an FPGA can be used to design arithmetic logic units and other digital circuits to perform simple computational tasks, it is not actually computationally compatible with microcontrollers or microprocessors. device compared. A microprocessor or microcontroller is a real computing device with a complex structure. However, FPGAs are fairly comparable application-specific integrated circuits, where any ASIC functionality can be custom designed and fabricated on the FPGA.
Microcontrollers let engineers master high-level or assembly language to design computer software, while FPGAs let engineers design computers (a simple computing device) themselves. This hardware-based embedded design requires a detailed understanding of digital circuit design and computer architecture. Just as microcontrollers are programmed in assembly language or high-level languages ​​such as c, FPGA chips are programmed in Verilog or VHDL languages. Just as C code or assembly code is converted to machine code for execution on the respective CPU, VHDL language is converted to digital logic blocks, which are then processed on FPGA chips to design custom computers for specific applications. Engineers use VHDL or Verilog to design the datapath and ALU hardware from the root level. Even a microprocessor or microcontroller can be designed on an FPGA, as long as it has enough logic blocks to support such a design.
Advantages of
FPGA - FPGA is more than just a tool for learning digital design and computer architecture. FPGA chip has certain practical application value in embedded system engineering. FPGA chips provide a real alternative to asic. FPGA has the following advantages, which also explain its application in embedded systems
Multithreaded FPGAs can process multiple instructions simultaneously. They can process instructions in parallel. This is a big advantage over microcontrollers in many applications. A microcontroller can only execute one instruction at a time, and only in sequence. Due to multi-threading, FPGAs can process tasks faster than any microcontroller in many applications. Also, because processes are logically encoded at the hardware level, FPGAs are suitable for strictly specialized applications, unlike microcontrollers that have a common architecture and instruction set at their disposal to solve a task. FPGAs can process a variety of simple logic operations at high speed, making them ideal for tasks such as preprocessing sensor data, encryption, logic circuit design, digital audio applications, video streaming, and more.
While microcontrollers are best at solving complex computing tasks that may require standard interfaces at slower speeds, FPGAs have an advantage when the amount of data that needs to be processed in an application is typically larger. This is all due to the multi-threaded nature of FPGAs. Even today many FPGA boards have built-in CPUs. Therefore, all that is required is to design additional logic for application-specific processing.
Design flexibility and scope - Any complex digital circuit can be designed on an FPGA chip as long as the chip contains a sufficient number of logic blocks to simulate the design. It can be used to design any peripheral device and perform any computing task. Microcontrollers do not have such flexibility. Microcontrollers come with a general-purpose computing unit and built-in peripherals such as timers, GPIOs, interrupts, and serial interfaces. In the case of microcontrollers, there is no way to change the chip to suit a specialized application. However, an FPGA can be programmed with something like 30 timers or a 20-channel UART or a 50-channel PWM generator or anything. This flexibility in designing chips of their own choice and requirements gives embedded engineers a lot of power, in which case the computing chip in the application should have a dedicated design.
Analog Factors - Generally speaking, in any embedded system, a controller or processor is coupled with sensors that provide analog inputs or actuators that require an analog output from the controller or processor. There are Field Programmable Analog Arrays (FPAA) that can be programmed to carry analog values. Many FPGA chips are a combination of FPGA and FPAA, where the chip can be programmed not only to digital circuits, but also to process analog signals. These mixed-signal chips contain ADC (analog-to-digital converter) or DAC (digital-to-analog converter) peripherals and analog signal conditioning blocks. In this case, the output pin can be programmed to have the drive strength and slew rate required by the load on that pin. Therefore, FPGA chips can not only be programmed for analog applications, but also provide flexible designs to accommodate specialized sensor-based applications.
Reusability - FPGA chips can be reprogrammed to emulate any other digital (and analog) circuit. This is not to say that once a circuit is assembled on a chip, it remains fixed. When the chip is powered up, the digital design is loaded onto the chip as configuration data. This happens every time the chip boots. This design remains on the chip until it continues to boot. These configuration data can be changed on the next boot, so a completely new digital design can be simulated on the chip next time. Because the chip is reusable, embedded engineers can experiment countless times with different digital designs on the same chip.
Single-Chip Solution - This FPGA chip provides applications for a single-chip solution. When using a microcontroller, it may be necessary to interface with other peripherals (which may not be built into the microcontroller), interfaces or asic connections on the FPGA, all the required peripherals as well as the processor or controller can be on a single chip design.
Real-time processing - FPGA chips are not ordinary computing integrated circuits. They are used to create a dedicated computing device on a chip. Unlike microcontrollers that run programs (machine code), datapaths and ALUs are constructed on FPGAs to solve specific computational tasks. So instead of running a program, the FPGA itself is programmed to run a specific computing task. This hardware-level logic execution allows real-time processing of data and information. This is why, FPGAs are often used in high-speed critical applications, where microcontrollers can fail due to their common architecture and code dependencies to run on fixed architectures and limited instruction sets.
With the above advantages, FPGAs are best suited for high-speed parallel processing, either with large amounts of data to be processed, or with processing chips that require custom peripherals, configurable analog outputs, or execution time-critical specialized applications (otherwise on average CPUs). is not possible). FPGAs give embedded engineers access to complex integrated designs that are otherwise only available at high engineering costs. FPGAs are like a mini semiconductor foundry getting a head start on integrating digital designs on a credit card-sized board.
In the real world, FPGAs can find applications in specific verticals where production volumes are not high. It is also widely used for prototyping ASIC designs, with the shortest time-to-market, avoiding the hassle of long fabrication methods for ASIC designs. Common applications for FPGAs include verticals such as digital signal processing, image processing, bioinformatics, cryptography, software-designed radios, medical imaging, speech recognition, telecommunications, data centers, aerospace electronics, and security systems. On the other hand, microcontrollers are widely used in general embedded applications in vertical fields such as consumer electronics, automotive, industrial electronics, communication systems, etc.
FPGA - Disadvantages
FPGAs have all the advantages and applications but few disadvantages. These disadvantages are caused by factors such as economy, design and development. Current FPGA technology has the following disadvantages:
Cost - FPGA boards are not cheap. FPGA boards typically cost $50 or more. This is many times higher than any microcontroller board. Many microcontroller boards are available, even for less than $10. The high cost of FPGA boards is one of the reasons why embedded courses using digital design and FPGAs are unpopular. However, since FPGA boards are reusable and can be used hundreds of times, their high cost is only a token figure for long-term use. Therefore, the cost of an FPGA board is worth it for research and development purposes or for prototyping purposes. However, given the production of the FPGA board, its high cost may prove to be an expensive project out of reach. In this case, the microcontroller is a viable option for manufacturers despite its slow speed, generic architecture and lack of multi-threading and real-time processing.
Figure 2: FPGA Development Board

Figure 2: FPGA Development Board
High Power Requirements - Most FPGA boards are powered by a 48v backplane. The high power consumption and high power consumption of FPGA boards make them unsuitable for many embedded applications. On the other hand, most microcontroller boards require a 5v or 3.3v power supply to operate. This makes microcontrollers an obvious choice for designing any battery-operated portable embedded device.
Volatility - The digital design is passed to the FPGA board as configuration data. When the board is powered up, the board is configured accordingly and then starts to function. Configuration data is either stored in flash in master mode or passed by the processor in slave mode over a boundary scan (JTAG) interface. Configuration data is lost once the board is powered off. In most FPGA boards, this erratic nature makes them unsuitable for applications where the board may experience power interruptions or power loss.
Boot time - FPGA boards load configuration data every time they are powered up. This adds significant startup time. However, once the configuration data is loaded, the FPGA board can run faster than the microcontroller. However, in the case of FPGA boards, the boot time can cause the failure of applications that need to perform time-critical operations immediately after the embedded device boots. Due to the volatility of boot time and configuration data, FPGA boards are not suitable for applications where embedded devices are frequently switched on and off. Furthermore, it is impossible to keep an FPGA board always on the power supply of an embedded device due to its high power consumption requirements.
High pin count - FPGA chips typically have a high number of pins. This is why, FPGAs are not suitable for size-constrained embedded applications, where a computing processor or controller should be as compact as possible with a minimum number of pins. In contrast, there are many microcontrollers that have 8 pins or less, so they can easily be used in a gadget or device.
Complexity - Working on an FPGA is not as easy as working on a microcontroller. Years ago, starting with FPGAs, engineers had to have detailed knowledge of digital design and computer architecture. Then VHDL or Verilog is much more complex than any high level programming language used for software development or even assembly language. While most of the tools needed to develop in FPGAs are available for free, and there are many FPGA boards available at reasonable prices (~$50), these tools are complex to use and are still quite limited among the available FPGA boards. Hard to choose. Digital design also presents many complexities, pitfalls, and caveats that can only be mastered through hands-on experience.
Design Limitations - With an FPGA, you can only interconnect logic blocks for digital designs. However, there is no control at the gate level and the usual synthesis is non-standard. However, FPGAs are very useful in the early stages of testing an architecture or ASIC design.
Endurance – Compared to microcontrollers, FPGA integrated circuits have a shorter lifespan. While microcontrollers can be used in a device for decades, FPGA chips in embedded devices may need to be replaced within 2 to 5 years.
Due to the high cost, variability, long startup time, high power consumption, high pin count, short lifespan, and design limitations of FPGAs, FPGA chips are being used less and less. They appear only in high-power devices that require specialized architectures, custom peripherals, and execution of critical machine code through parallel processing.
Conclusion -
FPGA chips have their own advantages and disadvantages compared to microcontrollers. FPGAs may not be suitable for general or common embedded applications, but FPGAs can access and explore the world of integrated circuit design in a way that microcontrollers can never do. An embedded engineer must work on FPGAs and have extensive experience with microcontrollers and microprocessors. It will allow engineers to explore the digital world in and out. Before using microcontrollers and processors, an engineer could only think in software, but after using FPGAs, he can also think in hardware. By working on FPGAs, engineers gain practical knowledge of how software works on processors and controllers.
Like after building code from scratch, apis (application programming interfaces) in the software development perspective start to feel like simple handles for programming. The same is true for assembly language or embedded c after VHDL and Verilog. Assembly and high-level languages ​​for embedded development will start to feel like VHDL and Verilog's apis used to be used. So, in effect, FPGAs and similar CPLD technologies complement and complement the embedded engineering discipline.
Mr. Bai Jilong has been engaged in the electronics industry for 15 years.
So far, he has developed more than 100 products, most of which have been mass-produced and launched.
It took 5 years since 2018 to
record thousands of episodes. A series of practical-level electronic engineer courses,
from components to core modules to complete products

  • Lao Bai's original intention was "May the world's engineers not take detours". Among them, there is a course explaining MOS transistors and IGBTs in detail. Mr. Bai Jilong has been engaged in the electronics industry for 15 years.

  • So far, more than 100 products have been developed, and most of them have been mass-produced and launched. It took 5 years since 2018.

  • I have recorded thousands of actual combat-level electronic engineer series courses. The original intention of this course is from components to core modules to complete products. The original intention of Lao Bai is "I hope all engineers in the world will not take detours". Among them,
    there are courses on MOS tubes and IGBTs in detail.

Guess you like

Origin blog.csdn.net/m0_49011926/article/details/124216007