Hi all,
Apologies if this post is too basic, but I thought it may be good to start from the beginning and put some context behind what FPGAs are, why and where we use them and what we use them for.
There are two performance extremes when it comes to performing analog & digital signal/data processing.
At the low end of the scale (comparatively) are the microprocessors. These are the Intel/AMD/ARM chips you use in your computer. I'm also putting microcontrollers (ATMEL, PIC, ARM, 8051 etc) in this category. They tend to be limited to digital data processing only (although some MCUs will have ADCs and DACs)
These things can be programmed to leverage their internal resources (ALU, mem, data transfer etc) in any generic way in order to accomplish a very wide variety of tasks.
This can include, spreadsheets (or any office type stuff), complex number crunching (3D simulations/rendering in media eg video/graphics or engineering eg EMC, stress/strain) and general browsing and time wasting. That's whats so good about them. They can do all these tasks and, most importantly, they can do them at the same time (managed by the kernel of course). They are the jack of all trades, master of none. They prefer 'thinking' and 'managing' over 'doing'.
If you asked these devices to do something ridiculously complex (compared to what they are capable of) they will still complete the task. Its just that they will take such a long time and consume so much power that they are either not cost effective or too slow and the window for when the result is required has passed. This is the penalty you pay for having a device that can do a wide variety of different tasks (I think this is called in-homogeneous computing).
This is where ASICs come in. These devices are essentially an entire analog/digital circuit board crammed into a silicon chip. When you think of ASICs think 'money is no object', 'performance is king' (performance = power or throughput or robustness or ... whatever parameter you care about). They are 'processors' (analog and/or digital) that are hard coded (instead of programmed) to do one specific task and only that task. They are effectively the master at that particular task. Because of this, they can vastly outperform any other generic processor (intels, arms etc). If you ever ask these guys to do anything else, then all that processing power crumbles into nothingness. Infact, you cant ask these devices to do anything else. The ASIC design (or program) is etched into the silicon wafer using the same technique used to create the intel processors. Once they are 'burned' that's it. They like 'doing' rather than 'thinking' (although some ASICs can have processor cores inside them for 'thinking')
FPGAs are the middle ground. They can be programmed to do one dedicated task one day, and another different dedicated task the other day. In the past they were more biased towards the microprocessor class of devices because they didnt do analog. You would read paragraphs like:
"If you take the entire subject of electronics engineering (not electrical engineering eg power plants & distribution) and subtract linear amplifiers, mixers and the line-level part of analog communication such as RS485, 232 etc then you are left with digital electronics, most of which can be implemented in an FPGA"
Now, FPGAs are being released with analog parts built in such as ADCs.
FPGAs have become so incredibly fast and large that most modern electronics of reasonable complexity will contain an FPGA. In nearly all cases they have overtaken digital only ASICs because they are infinitely more flexible at much reduced cost (both in product development time and to purchase). Most digital only ASICs are developed on FPGA and then once proved and, if justified, transferred to ASIC through whats called the 'HardCopy' route. This is essentially a hard coded FPGA. Altera (or whoever) takes your design file and converts it into a mask for the lithography process and essentially creates a custom hardcoded FPGA for you.
You better be prepared to bend over and pull your pants down though.
ASICs are only ever made when there's serious volumes behind the product or if you need mixed mode (analog and digital) circuitry. They are used in aviation and defense applications because of their superior robustness against radiation (rad-hard ASICs) and because silicon structures are usually bigger than most commercial CPUs. This lets the silicon structures survive longer against neutron damage.
If your working on a project which needs an FPGA, your job is basically to get the FPGA as close as possible to the front of the signal chain. Modern ADCs/DACs + FPGA designs have pushed the 'rf' domain out into the multiple GHz to 10s of GHz area.
When i say 'thinking' what I really mean is doing conditional execution eg 'if ... then... else if ....' type statements.
In an FPGA you are dedicating hardware to do an instruction. Imagine you are adding up two 18bit numbers in three different locations. The HDL synthesizer will create three 18bit adders for you. In a CPU the instructions would be queued as part of the feth-execute cycle. The two 18bit numbers would be sent to 1 adder (in the ALU) to be summed and this would happen three times in the sequence the add instruction appears in the code. In the FPGA the three adders would execute at the same time (in parallel) every clock cycle. This gives them a huge throughput compared to intel chips doing the same task. Imagine this with huge data sets.
If you dedicate hardware to 'thinking' eg an 'if' statement then you're basically killing your parallel execution. You're basically saying the 'if' hardware will run 50% of the time and the 'else if' will run the other 50%. Do this in many places and you're turning the your expensive FPGA into a crappy microprocessor that can be beaten by a proper intel or arm chip.
In the real world, its difficult to make useful product that doesn't have some sort of intelligence behind the raw grunt of signal/data processing. The intelligence comes from conditional execution which is best performed by a microprocessor. If you have electronic equipment that feels laggy or slow to respond then its because the CPU is doing too many other things.
This brings us to when you would use an FPGA.
FPGAs are used whenever you need to do a dedicated task faster than a microprocessor or if you want to offload the heavy lifting from your poor little micro (ARMs , Intels) and let it have the time to 'think'. In this way FPGAs are treated as co-processors or hardware accelerators for the 'main' cpu.
Examples are:
main CPU tells the FPGA to process data from an ADC, display it on the screen whilst copying it to memory. The main cpu is then free to do pattern matching on the data in memory, look for peaks etc. This could be a scope which triggers off a specific data pattern and shows the corresponding peak value of a signal on the screen.
My little arduino might run out of grunt when its talking to loads of peripherals over SPI. it could have 1 SPI link to an FPGA which talks to all the peripherals on behalf of my arduino. It would collect the data and send it to the arduino in slow time.
My satellite TV box may have an FPGA which decrypts the channel and displays the image.
My wireless router may have an FPGA processing 5x1gbps ethernet channels.
HD Video cameras may use them to encode the data into MPEG or whatever
There are SDRs. Mobile phone base stations are transitioning to SDR FPGAs instead of ASICs because their cheaper to upgrade when new standards come out.
When you get a CAT scan at the hospital, or ultrasound or .... its all processed by FPGAs (probably)
When I dont have the space for CPU + FPGA i will get a softcore (CPU inside an FPGA).
With a PSU+Sensor+ADCs/DACs+FPGA+Memory+Display you can pretty much replicate the functionality of any electronic product out there.
Long live FPGAs
Tabs