FPGA's - comPADRE

advertisement
BFY
Philadelphia
2012
• FPGA stands for Field
programmable Gate
Array.
• They are integrated
circuits that can be
programmed by the
user after fabrication
(i.e., in the field).
• Programming an FPGA
requires a Hardware
Description Language
(the two most common
are Verilog and VHDL)
ASICS
Discrete Gates
(AND, OR, NOR, Counters)
FPGA’s
LabView
Microprocessors
(Arduino)
¿Why use
FPGA’s?
• If you want to chip to
do a specific task and
that chip isn’t
commercially
available, you have
two options
• Design and fabricate an
ASIC (application
specific integrated
circuit)
• Or use an FPGA
¿Between ASIC’s and FPGA’s
which is better?
• Traditionally ASIC’s are faster, and
use less energy than FPGA’s.
• Additionally, ASIC’s are much
cheaper to mass produce.
• However, although the second (and
3rd and 4th) ASIC only costs a few
cents , the first chip costs millions
of dollars and months of work
• And if there’s an error, you have to
start all over again.
• With FPGA’s it’s possible to create
an implement a design cheaply and
rapidly
• And to correct errors
• And in fact with current technology
the performance of FPGA’s is
approaching that of ASIC’s.
History
• The first commercially available
FPGA appeared on the market
in 1985
• It was the SC2064 and had only
64 logic blocks
• Since then the number of
configurable logic blocks has
increased to millions while
their physical size has gotten
smaller.
• Nowdays the sale of FPGA’s is
dominated by Xilinx and Altera
that control 80% of the sales.
¿How do FPGA’s work?
Inputs
• The most common architecture is to have a
matrix of configurable logic blocks with
configurable inputs and outputs.
Look-up
Table
(LUT)
output
Clock
D FlipFlop
Inputs
0000
0001
To register
(store) values
0010
0011
0100
0101
0110
How does a
LUT work?
Output
• Microprocessors and CPU’s (Central
Processing Units) have a math
processors, a memories and are very
versatile.
• Although FPGA’s are more limited in the
fact that they lack a math processor and
memories, FPGA’s offer true parallelism.
That is to say that they really can do
several operations at once (they don’t
simply give the appearance of parallelism
by switching tasks quickly.
• In the end there is probably a place for
microprocessors and FPGA’s.
• But I wanted to introduce my students to
FPGA’s because I feel that my students
have so much more experience
programming software than hardware.
FPGA’s versus
Arduino’s
Hybrids
• Xilinx Virtex-II PRO and
Virtex-4 are FPGA’s that
have embedded processors
• The Mitrion Virtual
Processor de Mitrionics is
an example of a processor
made from FPGA’s that can
be customized to the needs
of the user.
• Xilinx and Altera offer
FPGA’s and processors in
the same integrated circuit.
Applications of FPGA’s
•
•
•
•
•
•
•
•
•
•
•
•
•
digital signal processing,
software-defined radio,
aerospace and defense systems,
ASIC prototyping,
medical imaging,
computer vision,
speech recognition,
cryptography,
bioinformatics,
computer hardware emulation,
radio astronomy,
metal detection
and a growing range of other
areas.
Our Boards:
You have to use limited
input and output
ports creatively since
they fill up fast
The 7-seg displays don’t
have a built-in driver
(but it’s good practice
to build one) and are
multiplexed
They are relatively cheap
$49 (student)
$59 (academic)
Free Xilinx WebPack ISE
Free Digilent Adept
¿Do you always have to start from
scratch?
• No, IP cores (intellectual
property) are available
One last thing fascinates me!
•
•
•
•
•
In 1995 Adrian Thomson took various
groups of 50 bits chosen at random to
program an FPGA.
Then he tested the FPGA to see if it could
distinguish between two tones.
As you might expect the arbitrary code
didn’t work very well, but a few of the
combinations of 0’s and 1’s were able to
perform better than others.
Adrian selected the best performers and
reproduced them by mixing their “DNA”
with other successful codes and occasional
new mutations.
After 100 generations not much happened.
•
•
•
•
•
•
•
After 220 generations the circuits could
reproduce the input, but not much more
than that.
After 650 generations the circuits could
identify the 1kHz signal.
After 4,000 generations the circuits could
distinguish between the 1kHz and the
10kHz tone.
Looking at the circuit that evolved it turned
out that it was using just 37 of the 100
gates and used a lot of feedback.
That’s neat, but the most interesting thing
is that 5 of the gates weren’t even
connected to the rest and any engineer
would say that they were irrelevant. But
the circuit didn’t work without them.
Apparently the FPGA had discovered and
utilized a magnetic field effect between
nearby gates.
This was one of the first examples of
evolvable hardware
FPGA’s force you to be
aware of the hardware
•
•
•
•
•
•
•
Allocation of recourses (space for numbers)
No Start
For loops
While loops
Parallelism
Deceptively similar to software
You’ll have to correct for contact bounce in
the switches and buttons
Video Examples
Download