Fpga 11
Fpga 11
Session-1
Presented By
Mohammed Abdul Kader
Assistant Professor, Dept. of EEE, IIUC
Email:[email protected] Website: kader05cuet.wordpress.com
What is an FPGA?
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
2
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
FPGA Architecture
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
IOB
Input/Output Block.
CLB
Configurable Logic Block.
PSM
Programmable Switch Matrix.
Connection Lines
Clock Circuitry
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
3 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
FPGA Vs Microcontroller
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Microcontroller:
• Micro-computer in a single chip.
• Configuring a predefined hardware
by programming.
FPGA:
• Developing Hardware by
programming
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
4 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
FPGA Programming
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
FPGA Programming
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
5 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Schematic Design in FPGA
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Y S=X⊕Y⊕Z
C = Z(X ⊕ Y) + XY
Steps:
a) Open a new project Wizard.
b) Open a new schematic file.
c) Draw the circuit.
d) Compilation.
e) Pin Planer.
f) Compilation
g) Upload
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
6
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Schematic Design in FPGA(Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Open a new project Wizard.
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
7 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Schematic Design in FPGA(Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Family and Device Settings
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
8 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Schematic Design in FPGA(Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Drawing circuit in New Schematic File
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
9 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Schematic Design in FPGA(Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Pin Planner
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
10 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Schematic Design in FPGA(Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Loading Program
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
11 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Verilog HDL – Structural Verilog Code
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
12 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Verilog HDL – Structural Verilog Code
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
13 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
Verilog HDL – RTL Verilog Code
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
14 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
RTL Verilog Code using Continuous Assignment
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
RTL Verilog code using Continuous Assignment to follow the logic equations given
below.
Verilog Code:
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
15 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
RTL Verilog Code using Continuous Assignment
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
BCD to Seven Segment Decoder by RTL Verilog Coding using Continuous assignment
A BCD to seven-segment decoder is a combinational circuit that accepts a decimal digit in BCD and
generates the appropriate outputs for the selection of segments in a display indicator used for displaying
the decimal digit. The seven output of the decoder (a,b,c,d,e,f,g) select the corresponding segments in
the display as shown in figure a. The numeric designation chosen to represent the decimal digit is shown
in figure b. Design the BCD to seven segment decoder circuit.
a: Segment designation
b: Numerical designation for display
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
16 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
RTL Verilog Code using Continuous Assignment (Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
17 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
RTL Verilog Code using Continuous Assignment (Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
From truth table we obtained-
a= ∑ (0,2,3,5,6,7,8,9) b= ∑ (0,1,2,3,4,7,8,9) c= ∑ (0,1,3,4,5,6,7,8,9) d= ∑ (0,2,3,5,6,8,9)
e= ∑ (0,2,6,8) f= ∑ (0,4,5,6,8,9) g= ∑ (2,3,4,5,6,8,9) Don’t care , d= ∑ (10,11,12,13,14,15)
CD CD CD CD
AB AB AB AB
X X X X X X X X X X X X X X X X
X X X X X X X X
X X X X X X X X X X X X
X X X X X X
e= BD+CD f= A+CD+BD+BC g= A+BC+BC+BD
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
18 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
RTL Verilog Code using Continuous Assignment (Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Logic Equations
Verilog Code
a= A+C+BD+BD
module seven_segment (a,b,c,d,e,f,g,A,B,C,D);
b= B +CD+CD
input A,B,C,D;
c= B +C+D output a,b,c,d,e,f,g;
d= A +BD+BC+BCD+CD assign a=A|C|(~B&~D)|(B&D);
assign b=(~B|(~C&~D)|(C&D));
e= BD+CD
assign c=B|~C|D;
f= A+CD+BD+BC assign d=A|(~B&~D)|(~B&C)|(B&~C&D)|(C&~D);
g= A+BC+BC+BD assign e=(~B&~D)|(C&~D);
assign f=A|(~C&~D)|(B&~D)|(B&~C);
assign g=A|(~B&C)|(B&~C)|(B&~D);
endmodule
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
19 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",
RTL Verilog Code using Continuous Assignment (Cont.)
101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Verilog Code:
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
20 010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Workshop on "Digital Circuit Design in FPGA Platform",