6 ms·
Can someone explain why someone would choose an FPGA over a standard microprocessor? What advantages could this UPDuino have over an Arduino? Also, how do ASIC'
by yazan94 8y ago
Can someone explain why someone would choose an FPGA over a standard microprocessor? What advantages could this UPDuino have over an Arduino? Also, how do ASIC's figure into this comparison?
My understanding is that microprocessors excel at executing logic using an onboard general-purpose ALU sequentially and quickly.
On the other hand, an FPGA excels at doing a specified task as the hardware (gates) are programmed/hooked up in a certain way to execute that one task.
ASIC's are processors that are designed from the factory to execute a specific task (kind of like pre-programmed, non-reprogrammable FPGA's).
Can someone please fill in the gaps please? I have a general idea, but I'm not sure I understand all the differences correctly.
- pulse7 8y agoChoosing FPGA = learning, how to be independent from ASICs, which have more and more "hidden security parts" like Intel ME, AMD PSP, ARM TrustZone...
- SahAssar 8y agoCPU's like the ones that include Intel ME, AMD PSP or ARM TrustZone are not embedded in ASIC's. A ASIC is meant to perform a single task well, if you need or if there even could ever be a usecase for a OS or processor like those examples then by definition it isn't an ASIC anymore.
- TomVDB 8y agoFor hobby projects? Multiple reasons: - because writing RTL is fun, while writing C code is boring. :-) - because it's probably not possible to outputs VGA with your standard microprocessor. You can create a dinky 3-bit VGA output with very little hardware. - because I may want to DMA data from an external sensor and feed it straight into a DSP for processing, and only use the CPU to deal with the post-processed result. Think multi-channel audio etc. - because anything that requires fast real-time is probably not possible with the standard microprocessor. But mostly because writing RTL is fun.
- makapuf 8y agoI mostly agree with your post and its spirit. But I've dabbled enough with microcontrollers and custom consoles to say that vga is completely doable at 800x600 32k colors on a 7$ microcontroller : https://github.com/makapuf/bitbox https://github.com/makapuf/bitbox
- TomVDB 8y agoI expected that somebody would prove me wrong about the VGA thing. Very nice project!
- cheeko1234 8y agoAmazing answer from stackexchange: ASIC VS FPGA A Field Programmable Gate Array can be seen as the prototyping stage of Application Specific Integrated Circuits: ASICs are very expensive to manufacture, and once it's made there is no going back (as the most expensive fixed cost is the masks [sort of manufacturing "stencil"] and their development). FPGAs are reprogrammable many times, however because of the fact that a generic array of gates is connected to accomplish your goal, it is not optimised like ASICs. Also, FPGAs are natively dynamic devices in that if you power it off, you loose not only the current state but also your configuration. Boards now exist though that add a FLASH chip and/or a microcontroller to load the configuration at startup so this tends to be a less important argument. Both ASICs and FPGAs can be configured with Hardware Description Languages, and sometimes FPGAs are used for the end product. But generally ASICs kick in when the design is fixed. FPGA VS microcontroller As for the difference between a microcontroller and a FPGA, you can consider a microcontroller to be an ASIC which basically processes code in FLASH/ROM sequentially. You can make microcontrollers with FPGAs even if it's not optimised, but not the opposite. FPGAs are wired just like electronic circuits so you can have truly parallel circuits, not like in a microcontroller where the processor jumps from a piece of code to another to simulate good-enough parallelism. However because FPGAs have been designed for parallel tasks, it's not as easy to write sequential code as in a microcontroller. For example, typically if you write in pseudocode "let C be A XOR B", on a FPGA that will be translated into "build a XOR gate with the lego bricks contained (lookup tables and latches), and connect A/B as inputs and C as output" which will be updated every clock cycle regardless of whether C is used or not. Whereas on a microcontroller that will be translated into "read instruction - it's a XOR of variables at address A and address B of RAM, result to store at address C. Load arithmetic logic units registers, then ask the ALU to do a XOR, then copy the output register at address C of RAM". On the user side though, both instructions were 1 line of code. If we were to do this, THEN something else, in HDL we would have to define what is called a Process to artificially do sequences - separate from the parallel code. Whereas in a microcontroller there is nothing to do. On the other hand, to get "parallelism" (tuning in and out really) out of a microcontroller, you would need to juggle with threads which is not trivial. Different ways of working, different purposes. https://electronics.stackexchange.com/questions/150058/what-are-the-differences-and-similarities-between-fpga-asic-and-general-microco https://electronics.stackexchange.com/questions/150058/what-...
- pitaj 8y agoYou can program an FPGA to work like a microprocessor, or pretty much any other digital circuit that fits. They are great for teaching students about computers and hardware design languages. Most FPGAs are essentially grids of little devices which are programmed to map a certain input pattern to a certain output pattern. Like, 0000 -> 0101, 0101 -> 1111. They emulate logic gates. When you program an FPGA, you are both programming these maps, and setting the connections between them. (Note: efficient means processing power / electrical power) ASICs, on the other hand, are custom-built ICs which are designed to very efficiently perform one task, like performing SHA hashes or h.264 decoding. FPGAs can be more efficient than full-fledged processors because they can make use of custom combinational (combinations of gates) logic along with sequential (clocked) logic. ASICs can be more efficient than FPGAs. Essentially, there's a tradeoff between development cost, unit cost, efficiency, and flexibility. flexibility development cost unit cost efficiency processor ++ ++ - - FPGA + + -- + ASIC -- -- ++ ++
- leowoo91 8y agoI think scoring is not right because FPGA should be more flexible than processor and processor should be more efficient than FPGA. You might be considering a specific use case where FPGA would take over.
- pitaj 8y ago> FPGA should be more flexible than processor I disagree. Processors can be programmed in many sophisticated languages and have many built-in features that either don't come in similarly priced FPGA, or you'd have to program into the FPGA itself. > processor should be more efficient than FPGA It depends on the workload. Some things, processors might be more efficient at. But FPGAs have the upper hand at many things because they can use combinational logic.
- gh02t 8y ago> ASICs, on the other hand, are custom-built ICs which are designed to very efficiently perform one task, like performing SHA hashes or h.264 decoding. ASICs aren't necessarily task specific, you can do whatever you want in an ASIC. Your unit cost analysis isn't quite right either, because what really matters is scale. The primary cost tradeoff between an FPGA and an ASIC is strongly dependent on manufacturing scale. ASICs have high design and tooling costs, but low unit cost after that. FPGAs on the other hand have much lower initial cost, but higher unit cost. Whether or not it makes sense to use an ASIC depends largely on whether or not you're going to ship enough units to amortize the setup costs, hence why a lot of manufacturers often design a single ASIC to be used across multiple products.
- Glawen 8y agoYou chose fpga when you have yo handle bit streams with a precise clock to interface with a hardware, for example a screen or camera. It is very difficult to have a precise timing with a microcontroller unless you have a good one with timers. It becomes impossible to do when you need to toggle several pins at the same time quickly (like a pci bus). You overcome the problem by adding a fpga to your microcontroller board, which will handle the bit flipping and communicate to the micro with a standard bus like spi or i2c.
- phamilton 8y agoYou are correct enough here. The interesting question is not how they are different, but what the advantages are. An FPGA is really good at doing a single task a ton of times. A microprocessor is good at doing a lot of tasks a ton of times. And an ASIC is just a more permanent and more efficient FPGA. So when would I use an FPGA? Let me describe an example: Stream processing. Let's say I have a stream of data. Like a camera producing a video feed. As each frame of data comes in, we want to compare it to the previous frame and take the average of the two values to create a blurring effect. On a microprocessor we process each frame. We iterate over groups of pixels one at a time, compare it to the value at the pixel in the previous frame and divide by two. Our processing time is a function of the number of pixels we want to look at. If we're lucky we have multiple cores so we can do work in parallel. Maybe even do 32 groups of pixels in parallel on a ryzen or something. But if we have a 1 megapixel image, we're going to still have to visit ~30k pixels sequentially on each core and perform some math. We're probably adding at least a few ms of lag on the feed. And if we're trying to do any multitasking on this cpu, then we may not have very predictable performance. On an FPGA we approach the problem very differently. Instead of having sequential logic for visiting each pixel, we have combinatorial logic. Supposed each pixel came through on a different wire. That wire goes into a component that holds the previous value for the pixel and outputs the average of the current and previous value. We then take that output and rebuild the video feed with it. On a 1 megapixel image, our unit of work is a single pixel and we have concurrency of 1 million units. We add a cycle or two of lag, which is negligible. Additionally, we have very predictable performance because our computation executes in lock step with the system clock. FPGA's are expensive (per unit cost) and aren't always the most efficient. An ASIC will drop per unit cost and power requirements significantly but has a large up front capital investment.
- pkaye 8y agoI think you have it pretty close. Also FPGA are good for low volume custom circuitry. ASICs are good for high volume custom circuitry. And things are a hybrid of the three these days. Something like a cell phone has a ASIC with standard features like an ARM core, cellular communications, WiFI, display controllers.
- marcosdumay 8y agoFPGAs can have hardware parallelism. And not some specialized SIMD instructions, but the one kind of parallelism you need. FPGAs can have deep pipelines, so instead of taking data from the memory, working on it, storing it back and moving to the next, you can take serial data, process it in multiple stages and only writing to memory at the end. FPGAs can have deterministic timing (with a clock). So you can synchronize stuff in parallel, you can have it respond in nanoseconds, you can follow a signal without losing any sample. FPGAs can have complex pipelines, so you can take an earlier response from the system, but continue processing your data for a more elaborated response later, without performance loss.
- pmorici 8y agoWhen you are talking about small ones like this a common reason I don't see mentioned here is peripheral flexibility. A processor is going to come with a fixed set of peripherals what happens if you need 10 UARTs but the processor only has 3? An FPGA can solve that problem.
- mhh__ 8y agoAn FPGA is not the same thing as a microcontroller. Field Programmable Gate Array: An FPGA can be a microcontroller, but a microcontroller can only pretend to be an FPGA. Your microcontroller was probably prototyped on an FPGA. ASICs are basically FPGA designs etched onto permanent silicon.