Educational Engineering: FPGA

Educational Engineering is seeking to develop the content on the internet through the dissemination of educational videos in various technical, technological and engineering fields. Follow us get new Tutorials and Lessons

Advertisement

Showing posts with label FPGA. Show all posts
Showing posts with label FPGA. Show all posts

Thursday, September 20, 2018

Microcontrollers and FPGAs

9:33 PM 0
Microcontrollers and FPGAs
Microcontrollers and FPGAs 

In Summary, and if you don't have much time to read details, these two pictures sum it up for you, we know that your time is important.
Diagram2

Diagram1
In my initial attempt at writing on this topic, I used to be wrestling with a way to begin. I originally had it phrased as “FPGA vs. Microcontroller”, however, the more I realized that the title was a problem because it looked as if it would imply that one was higher than the opposite. And whereas there are circumstances wherever one has a bonus, they extremely are a lot of simply totally different instead of one being “better”. thus with that, I’ll be presenting to you some info concerning FPGAs and microcontrollers, their similarities, variations, and maybe a theoretic or 2.
Nexys4DDR
A field programmable gate array (FPGA) is an integrated circuit (IC) that is built with a large number of logical processing resources, or logic blocks. These logic blocks consist of digital logic components such as multiplexers, flip-flops, lookup tables, and adders. These components are not unique to FPGAs by any means, as they are some of the basic pieces required for an IC to take input and process it into some meaningful output. What makes an FPGA unique is that the logic blocks within it are built with interconnections that can be reconfigured by the user using a hardware description language (HDL), allowing for the FPGA to take on variable functionality.
chipKIT_WF32

A microcontroller is an IC that is essentially a tiny computer. It contains a dedicated processor core, a small amount of memory, and a specific number of I/O ports and functionality. All of this functionality on the chip is made up of the same basic components you will find in the fabric of an FPGA (multiplexers, adders, flip-flops, etc.), however, the interconnections between all of the elements in a microcontroller are fixed and cannot be reconfigured. The user can use one of a variety of software development tools for microcontrollers (provided they are compatible with the chip) to upload code to it which, similar to when you install something onto your computer, tells the microcontroller what to do.

Diagram1

They seem pretty similar, being made up of pretty much the same pieces. So they should be pretty similar in their usage right? Not so much.

This is an instance where the microcontroller has a decided advantage: ease of use. Anybody who is familiar with writing code, such as C, C++, Java, etc., can fairly easily write some code for a microcontroller board since there are compilers that can convert the high-level code into machine code for the microprocessor to use. Pretty much every microcontroller you can find will have at least one program you can download that will allow you to program your device via some type of high-level code. Another advantage microcontrollers have is that they are relatively cheap. Once a circuit design has been finalized, production runs of a chip benefit from economies of scale and manufacturing processes that have been refined for decades. So if you wanted to create some cool LED lighting for your room, you could just buy one of a number of microcontrollers, find some simple LED code online, plus all the pieces together correctly and voila, you’ve got a nightclub in your living room…..sort of.  To present an analogy for this task with an FPGA, it’s like buying a Caterpillar backhoe to dig a hole in a flower bed as opposed to just using a shovel.

As with most good things, however, the microcontroller has its drawbacks. For instance, the dedicated processor handles everything that you can program the microcontroller to do, meaning that all input processing and output functions go through it, creating an inherent bottleneck. This core may be very fast and may have multiple paths to allow for some parallel processes to happen, but the bottom line is that since everything goes through it, there may be certain processes that have to wait for other things to resolve.

Herein lies one of the biggest advantages of an FPGA: massive parallelism. Writing in an HDL for an FPGA lets you define the behavior of its logic blocks, of which there are many thousands. So if your design only uses a small percentage of the resources, you could create multiple instances of that design that are independent of each other, allowing you to multiply the productivity of the FPGA. For example, you could write a bit of HDL code that toggles an LED based on a combination of input signals, let's say it checks to see if a certain number of switches are on. You can create multiple instances of that module in your design, specifying a different output LED for each set of inputs. This could allow you to simultaneously monitor a handful, tens, hundreds, possibly even thousands of different input signals at the same time, independently, and none of them would have any delay in output due to the others.

Another advantage to using an FPGA is the flexibility afforded to the user to make hardware changes later. This advantage can be seen from two sides in my opinion. From the perspective of an average user (enthusiast, student) it provides you a versatile platform from which you can create all kinds of designs, from audio signal processing to making a video game controller. From the perspective of a company that makes electronic devices, the use of FPGAs can give you the ability to do things like prototyping a hardware design before mass production of an application specific integrated circuit (ASIC). Along similar lines to how car manufacturers make models in clay before any actual production runs. This kind of flexibility is pretty cool, but it’s also rather difficult to implement. The primary languages themselves (Verilog and VHDL), the slight change in mindset from writing software to writing for hardware, the large number of variables that go into designing a circuit are all factors that make someone’s first attempt at writing code for an FPGA difficult.

.
Diagram2

While this is by no means a complete list, we now have slightly filled out our diagram of differences between the two. Hopefully, this post helped clear some of the obscurity around what the differences are between these two platforms. The main theme to be taken away is that where these two devices are concerned, the question of “Which one?” is actually a matter of selecting the right tool for the job.