How do FPGAs work and when are they used?

635 views

Im really confused by what field programmable gate arrays are and what they do. What is digital logic also and how do FPGAs relate to CPUs? Please eli5

In: Engineering

2 Answers

Anonymous 0 Comments

disclaimer : I’m not trained in any of this I’m just a nerd and starting to mess around with fpga’s. if anything is patently wrong and there are people qualified to correct me here I’d welcome it.

digital logic as I understand it is a combination of boolean algebra and digital circuit design. a digital circuit is a circuit that has two types of signals high and low voltages (current?) and are typically represented with 1s and 0’s. boolean algebra is a type of mathematics that has only two values (1’s and 0’s) it happens to map nicely on to digital circuit design because we can think of circuits as functions and use mathematics to compose and simplify circuits the and and or logic gates are analogous to boolean multiplication and addition. there are also not gates and a negation operator.

there is neat bit of math that any boolean expression can be written as the sum of products ( xd + xa + bd …. ) = some expresion (or alternatively as the product of sums) since they are analogous (isomorphic???) to the and or and not gates of a digital circuits it implies that any digital circuit can be made out of only those three gates.

fpgas and cpus are similar in that they are both machines without a fixed functionality beforehand but the mechanism by which they work is different.

a cpu on its own is not particularly interesting (its just a finite state machine I guess) but is more interesting in conjunction with computer memory. in order to understand how a cpu works you need to understand two simpler machines multiplexers and de-multiplexers

multiplexers take a set of input signals and output a single signal.

de-multiplexers take a single input signal and output a set of signals.

multiplexers are useful in that they let you filter out signals that are on the compute (all the components are connected in common to a “bus”) but not meant to turn on a specific component the best example would be computer memory each “cell” of memory has a “address” (multiplexer) data sent without that “address” won’t be saved in that cell.

de-multiplexers are useful in that they let you coordinate components say you want a computer to load a piece of memory into another location in memory (maybe you want to add it to something first) in order to do that the memory cell that has the value to be loaded must be “told” to send what’s in it’s memory and another memory “cell” has to be “told” to listen simultaneously.

multiplexers and de-multiplexers can be put together so that one set of signals will produce another. this is the mechanism behind how a cpu works the cpu has a set of multiplexers that listen for “instructions” those “instructions” turn on the circuitry required to do what the “instruction” is supposed to do. the computer works then by via a small program or a special set of circuitry called a control matrix (more mux de-mux stuff) reads through computer memory sequentially (unless told to jmp) the cpu “reads” each instruction via a multiplexer and executes the instruction via de-multiplexer. crucially the only component of hardware that really changes is the contents of computer memory. the functionality of the cpu (its instruction set) is fixed as are its peripherals (mostly)

a fpga is a machine thats programmability comes from the ability to connect and disconnect internal components between it’s input and output instead of reading signals from a mutable source (memory) and executing fixed outputs like a cpu. I’d say it’s sort of like a programmable breadboard instead of cpu.

I’m sure it’s more complicated in production but as mentioned above you can represent any digital circuit with nothing but nand gates (or nors) so if you had a set of switches that either included a nand gate or excluded it from the path from the input to the output you could make a arbitrary circuit. importantly by flipping those switches you are physically connecting the input to the output its not being “processed” the electricity just goes from point A to point B this is relevant because one it can be faster. it can actually run things in parallel not just fake it like a cpu. and some others.

You are viewing 1 out of 2 answers, click here to view all answers.