Welcome to IDI Electronica!!!



Welcome!!! IDI Electronica is a blog for my personal projects and articles to help electronics enthusiasts like me.

Bienvenidos!!! IDI Electronica es un blog con mis proyectos personales y artículos con el fin de ayudar a entusiastas de la electrónica como yo.

Tuesday, April 7, 2015

Microprocessor vs Microcontroller vs FPGA

Whenever we talk about digital systems, we hear about logic devices like CPUs, microprocessors, microcontrollers, PLDs, ASICs, FPGAs, among others. But, what is the difference between them?

This article will attempt to explain their main differences without getting too technical.


CPU vs Microprocessor

The CPU (Central Processing Unit) is the part of a system that sequences and executes instructions by performing basic arithmetic, logic, control, as well as input and output operations. It is the part of the system that does all the processing.

Back in the day, the CPU was a combination of vacuum tubes wired together and were housed in multiple cabinets. We are talking about computers that occupied entire rooms. Later on, the transistor made an appearance and the CPUs became much smaller. However, these CPUs still occupied lots of space.

When the integrated circuit was invented, scientists were able to put the entire processing unit in a small silicon chip. This is what we know as the microprocessor.

Technically, a CPU refers to the main processor in the system. Therefore, not all microprocessors are CPUs. A good example of this situation would be the Sega Genesis video-game console. It contains 2 microprocessors, the Motorolla 68K to handle most instructions, video processing, etc. and the Zilog H80 for sound processing. In this case, only the 68K would be the CPU. Nonetheless, for most people, both terms are interchangeable.


Fig 1. Photo of U of Pennsylvania's ENIAC. The system used 18,000 vacuum tubes and dissipated 174KW of power


Fig 2. The Intel 8086 microprocessor


Microprocessor vs Microcontroller

A microprocessor unit (aka MPU or µprocessor) usually won't have I/O pins, memory or other peripherals. Instead, it uses its pins as a bus to interface with external components such as digital and analog I/O, RAM, ROM, serial ports, etc.

A microcontroller unit (aka MCU or µcontroller) integrates a CPU core (microprocessor), ROM and RAM memory, I/O pins, as well as other peripherals like serial ports, counters, clocks, etc. in one chip.

Microcontrollers are convenient because they put a full system in one chip without having to worry about compatibility issues or voltage level differences. They are also cheaper than using a microprocessor system. Their main disadvantage, is that they are limited by the amount of built-in peripherals.

Microprocessors are capable of performing more extensive calculations and because of the use of external components, they can be expanded to very complex systems at the board-level. A good example of a microprocessor system would be a personal computer.

Fig 3. Diagram comparing a microprocessor and a microcontroller


ASIC vs PLD vs FPGA

An Application Specific Integrated Circuit (ASIC) is a chip customized to perform a specific task rather than general-purpose applications.

A Programmable Logic Device (PLD) and a Field Programmable Gate Array (FPGA) are devices that can be reconfigured to create different digital circuits.

Simply put, PLDs and FPGAs are reprogrammable while ASICs aren't.

The 3 devices could potentially perform the same tasks, however ASICs are optimized for them. This means, they use less power and can process signals in less time. In some high speed applications, this difference in efficiency can make an ASIC the only option available. On the downside, ASICs are very expensive, take a long time to be designed and validated, and making any changes requires making a new device. They are only feasible if the chip needs to be mass produced. A good example of ASICs would be the Bitcoin miners.


PLD vs FPGA

The original PLDs were designed to replace a few dozen 7400-series chips (AND, OR, NOT gates). They are made of macrocells with combinatorial logic (AND, OR) and flip-flops. The most common type of PLD is the Complex Programmable Logic Device (CPLD), which is basically multiple PLDs connected in one chip. They are non-volatile, which means you don't need to reconfigure them after turning off the power.

A FPGA is made of logic blocks, interconnects and I/O. To create circuits, FPGAs configures an array of logic gates following Look-up tables (LUTs). They are volatile, so they need to be reconfigured every time they are powered up. The configuration file is usually stored in a EEPROM or NAND memory.

Because of their simple structure, CPLDs can be used to perform faster tasks than FPGAs. However, because of the size of the macrocells, CPLDs are usually limited to have less than 500 flip-flops. FPGAs on the other hand, can be used for larger and more complex designs since they can contain more than 150,000 flip-flops.


Microcontroller vs FPGA

We already described the difference between those two, but when should we pick one over the other?

In simple terms, a microcontroller is a processor with different circuits (peripherals) already built for you. All you need to do is program it and it will be ready to use. They are usually programmed using assembly, C or C++.

A FPGA is a blank chip with a bunch of logic gates for you to build whatever you want. In fact, you could technically build a small microprocessor with a FPGA. To configure them, you need to code them using a Hardware Description Language (HDL) like Verilog or VHDL.

For most applications, a microcontroller will be the simplest solution. They are cheap, easy to program and consume less power.

Microcontrollers do sequential processing (run one task at a time) while FPGAs can run multiple processes in parallel. This makes FPGAs better suited for high-speed or real-time applications like DSP.

2 comments: