What is a CPLD? an FPGA? Describe why they might be used in an embedded system?
Both are programmable logic devices that let you implement custom digital hardware in the field rather than using fixed-function chips.
-
CPLD (Complex Programmable Logic Device): Built from a modest number of macrocells using a sum-of-products (product-term) architecture with a predictable interconnect. CPLDs are typically smaller in capacity, non-volatile (configuration stored on-chip in flash/EEPROM), so they are instant-on at power-up and have very deterministic timing. They are ideal for glue logic, address decoding, simple state machines, and board-level control.
-
FPGA (Field-Programmable Gate Array): Built from a large array of look-up tables (LUTs), flip-flops, block RAM, DSP slices, and often hard IP (PLLs, transceivers, memory controllers, even CPU cores). Most are SRAM-based, meaning the configuration is volatile and must be loaded from an external flash/boot device at power-up. FPGAs offer far greater capacity and are suited to complex logic, high-throughput parallel processing, DSP, and custom high-speed interfaces.
Why use them in an embedded system:
- Glue logic / integration: replace many discrete logic chips, decode addresses, manage resets and control signals.
- Custom or legacy interfaces: implement nonstandard buses, bridges, or protocol adapters the MCU lacks.
- Hardware acceleration / parallelism: offload DSP, image/video processing, encryption, or real-time control where dedicated parallel hardware beats a sequential CPU.
- Flexibility and prototyping: change/upgrade logic without respinning the board; prototype before committing to an ASIC.
Rule of thumb: CPLDs for small, instant-on glue logic; FPGAs for large, complex, or performance-critical logic.
