How does an FPGA work?

Introduction

First, Let's start with what is FPGA? FPGA stands for Field Programmable Gate Array. FPGAs belongs to a class of devices known as a programmable logic or sometimes referred to as programmable hardware. An FPGA doesn’t do anything itself but it can be designed as per our requirement without changing anything physically. All you need to do is just load a design into FPGA and it starts acting like the circuit you wanted. No wires, no soldering, no confusion. The design is RAM-based so it can designed unlimited times.

Now you know we can use FPGA to create digital circuits, however, you don't actually draw designs of the circuit. Instead, you can describe the behavior of the circuit you want and the tools will use this information to create the circuit on its own which matches the behavior.


Digital Circuits and Logic Gates

One limitation of using FPGA is they can only create digital circuits. But some new FPGAs include on-board digital to analog converter. What is a digital circuit?

digital circuit is a circuit where the signal must be one of two discrete levels for e.g. 0/1, on/off, true/false.

There are few logic gates but the most common are AND, OR, NOT.

AND Gate:

An AND gate takes two inputs and outputs a 1 only when the first input AND the second input are 1. If either input is 0, the output is 0.


OR Gate:

An OR gate takes two inputs and outputs a 1 when either the first input OR the second input is 1. Only when both are 0 is the output 0.

NOT Gate:

A NOT gate is the simplest gate. It has one input and simply outputs the opposite of whatever it is. So a 1 becomes a 0 and a 0 becomes a 1.




Why use an FPGA?

When this question comes up it's in the context of choosing between using a processor or creating a custom design with an FPGA. A lot of people know how to code and very few people understand how to create a design for FPGA. Writing a code is far easier than creating a complex design for FPGA.

However, FPGAs can be time-efficient. To simplify this, let's take an example of turning an LED on when you press the button. If you write a code for this using Arduino, the processor would run a small loop of code that would read the state of a pin then update the state of another pin based on that value.

If you optimized the code you could probably get this to update millions of times per second. That may sound great but let’s look at what it would look like with an FPGA. In the case of simply connecting a button to an LED with an FPGA, you simply connect the button and the LED. The value from the button passes through some input buffer, is fed through the routing matrix, then output through an output buffer. This process happens continuously all the time. The only delay comes from the switching delays of the transistors in the chip, which are incredibly small.

There's a lot of extra stuff that has to go on to implement even the simplest circuit dynamically.

FPGAs tend to be expensive. The larger ones can easily cost tens of thousands rupees per chip. This is due to amount of silicon required to make them.

Another cost is power. There are a lot of transistors used compared to the number needed to implement. All these transistors require power to operate. Because of this, FPGAs tend to be poor candidates for battery operated devices. 

So why to use FPGA? Well, you have two major alternatives to creating a custom digital circuit. First, you could build it yourself out of discrete logic. This would take a significant amount of time, likely cost significantly more, and have little flexibility if you needed to change something.

The second, and more realistic, alternative is to create the circuit directly in silicon. This creates a very fast, very efficient circuit.


Reference:

https://learn.sparkfun.com/tutorials/how-does-an-fpga-work/all

https://en.wikipedia.org/wiki/Field-programmable_gate_array

Comments

  1. Very nicely written and informative

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. informative about FPGA 👍

    ReplyDelete
  5. Very informative content...good work

    ReplyDelete

Post a Comment