Digital Literacy Training Arduino Introduction To FPGA
Digital Literacy Training Arduino Introduction To FPGA
2021
Introduction to FPGA
A jumpstart to Field-Programmable Gate Arrays
Engr. Brian Jay R. Lumauag
2021
1
12/2/2021
2021
o Basic Electronics
o Basic Logic Circuits
o Familiar with C Programming (Verilog)
o Familiar with Pascal Programming (VHDL)
2
12/2/2021
2021
3
12/2/2021
2021
4
12/2/2021
2021
Components
1. I/O Blocks
2. Logic Blocks
3. Programmable Interconnect
Other components can be:
1. Multiplexers
2. Flip-flops
3. Memories
4. LUTs, Etc.
o Intel - Altera
10
5
12/2/2021
o Xilinx
11
o Lattice Semiconductor
12
6
12/2/2021
o Microchip Technology
13
o Gowin Semiconductor
14
7
12/2/2021
15
2021
16
8
12/2/2021
17
18
9
12/2/2021
19
20
10
12/2/2021
21
22
11
12/2/2021
o Verilog
o Slightly better at gate / transistor level
o Language style close to C / C++
o Pre-defined data type, easy to use
o VHDL - VHSIC (very high speed integrated circuit) HDL
o Slightly better at system level
o Language style close to Pascal
o User-defined data type, more flexible
23
2021
24
12
12/2/2021
25
Microcontroller/CPU FPGA
Programming Design Software-Based Hardware-Based
Programming Language C,C++, etc HDL, Verilog, VHDL
Code Execution Serial Execution Parallel Execution
Limitation Limited by Time (Depends on Limited by Space (More
the MCU Clock) Complicated Design, More
Blocks , More Space)
External Components No need for external Needs memory , ROM, RAM,
components Serial Ports, ADC, DAC, etc
Programmer Needs Programmer Chip (FTDI, JTAG)
Price Cheap Expensive
Design Difficulty Easy to Use More Complicated
26
13
12/2/2021
Code > Compile > Binary > ROM > Code > Register-Transfer Level (RTL)
Use Existing Hardware > Synthesis > Create NEW Hardware
Introduction to Field-Programmable Gate Arrays 27
27
2021
28
14
12/2/2021
AND 2021
a b a.b
0 0 0
0 1 0
1 0 0
1 1 1
29
OR 2021
a b a+b
0 0 0
0 1 1
1 0 1
1 1 1
30
15
12/2/2021
a 𝒂
0 1
1 0
31
a b 𝑎⨁𝑏
0 0 0
a⨁b 0 1 1
1 0 1
1 1 0
32
16
12/2/2021
NAND 2021
a b 𝑎. 𝑏
0 0 1
0 1 1
1 0 1
1 1 0
33
NOR 2021
a b 𝑎+𝑏
0 0 1
0 1 0
1 0 0
1 1 0
34
17
12/2/2021
a 𝒂
0 0
1 1
35
a b 𝑎⨁𝑏
0 0 1
𝑎⨁𝑏 0 1 0
1 0 0
1 1 1
36
18
12/2/2021
2021
A Jumpstart to Verilog
Introduction to Field-Programmable Gate Arrays 37
37
38
19
12/2/2021
39
40
20
12/2/2021
41
2021
42
21
12/2/2021
43
44
22
12/2/2021
2021
module adder(A,B,S,C);
input A,B;
output S,C;
xor(S,A,B);
and(C,A,B);
endmodule
45
2021
module example2(A,B,C,X);
input A,B,C;
output X;
A B C wire wire1, wire 2, wire 3;
wire1
xor EOR2(wire1,B,C);
EOR2 wire3 and AND2(wire3,wire1,A);
AND2
not NOT(wire2,A);
X nor NOR2(x,wire3,wire2);
NOR2
wire2
endmodule
NOT
46
23
12/2/2021
47
48
24
12/2/2021
49
50
25
12/2/2021
51
52
26
12/2/2021
Example 2021
53
2021
54
27
12/2/2021
55
56
28
12/2/2021
57
58
29
12/2/2021
59
60
30
12/2/2021
61
2021
62
31
12/2/2021
2021
Afternoon Session
63
2021
64
32
12/2/2021
65
2021
66
33
12/2/2021
67
2021
68
34
12/2/2021
2021
69
HALF-ADDER 2021
module adder(A,B,S,C);
input A,B;
output S,C;
xor(S,A,B);
and(C,A,B);
endmodule
70
35
12/2/2021
module FA(A,B,Cin,S,Cout);
input A,B,Cin;
output S,Cout;
wire U1out,U3out,U4out;
xor U1(U1out,A,B);
and U2(U2out,Cin,U1out);
and U3(U3out,A,B);
xor U4(S,U1out,Cin);
or U5(Cout,U2out,U3out);
endmodule
Introduction to Field-Programmable Gate Arrays 71
71
Multiplexer 2021
module multiplexer41(sel,A,B,C,D,Q);
input [1:0]sel,A,B,C,D;
output Q;
not U1 (U1not,sel[1]);
not U2 (U2not,sel[0]);
and U3 (U3out,A,U2not,U1not);
and U4 (U4out,B,U2not,sel[1]);
and U5 (U5out,C,sel[0],U1not);
and U6 (U6out,D,sel[0],sel[1]);
or U7 (Q,U3out,U4out,U5out,U6out);
endmodule
72
36
12/2/2021
input [3:0]bin;
output [7:0]segment;
output DTenable;
reg [7:0] segment;
assign DTenable=1'b0;
always @(*)
case(bin)
4'b0000 : segment = ~(8'b00111111);
4'b0001 : segment = ~(8'b00000110);
4'b0010 : segment = ~(8'b01011011);
4'b0011 : segment = ~(8'b01001111);
4'b0100 : segment = ~(8'b01100110);
4'b0101 : segment = ~(8'b01101101);
4'b0110 : segment = ~(8'b01111101);
4'b0111 : segment = ~(8'b00000111);
4'b1000 : segment = ~(8'b01111111);
4'b1001 : segment = ~(8'b01101111);
4'b1010 : segment = ~(8'b01110111);
4'b1011 : segment = ~(8'b01111100);
4'b1100 : segment = ~(8'b00111001);
4'b1101 : segment = ~(8'b01011110);
4'b1110 : segment = ~(8'b01111001);
4'b1111 : segment = ~(8'b01110001);
default : segment = ~(8'b00000000);
endcase
endmodule
Introduction to Field-Programmable Gate Arrays 73
73
2021
74
37
12/2/2021
BLINK 2021
75
76
38
12/2/2021
77
78
39
12/2/2021
2021
THANK YOU!
[email protected] // [email protected]
79
40