Vgu Ece DSDL Lab2 Adders
Vgu Ece DSDL Lab2 Adders
Revision
Version Modified date Modified by Description
v0r0 03/02/2023 Thuyet N. New creation
Description
This lab is to design and implement the basic digital circuits (parity circuit, adders, counters etc.) on
an FPGA board by Verilog HDL (hardware description language).
Hardware
Files: Quartus lite + ModelSim-IntelFPGA setup files, Cyclone IV and Cyclone V device files
Note: Put all files in the same folder and then run Quartus set-up file.
LabDocs:Lab guidelines
Preparation:It has to be finished before each lab session
RefDocs:References
1) 00_fpgas_for_dummies_ebook.pdf: an book for beginners
2) 01_VGU_ECE_BasicsofFPGAandVerilog.pdf: basics of FPGA and Verilog HDL
3) 02_VGU_ECE_DigitalSystemsDesignLab_slides.pdf : introduction slides
4) 04_DE10-Nano_User_manual.pdf: hardware manual
Lab content
Important note:
In this lab exercise, students learn how to design and implement 1-bit full adder (FA) and 4-bit
adders (combination of 4 FAs) on an FPGA with Verilog HDL.
Prerequisite
C = xy + xz + yz
S=x^y^z
The implementation of 4-bit adder by connecting four of 1-bit adder as below circuit.
fa.v
module lab2(
x,
y,
z,
c,
s
);
input x; //in 1
input y; //in 2
input z; //carry in
endmodule
fa.v
module lab2(
x,
y,
z,
c,
s
);
input x; //in 1
input y; //in 2
input z; //carry in
endmodule
Pin assignments
fourbitadder.v
module lab2(
a,
b,
cout,
s
);
fa fa_00(
.x(a[0]),
.y(b[0]),
.z(1'b0),
.c(c1),
.s(s[0])
);
fa fa_01(
.x(a[1]),
.y(b[1]),
.z(c1),
.c(c2),
.s(s[1])
);
fa fa_02(
.x(a[2]), //a2
.y(b[2]), //b2
.z(c2),
.c(c3),
.s(s[2])
);
fa fa_03(
.x(a[3]), //a3
.y(b[3]), //b3
.z(c3),
.c(cout),
.s(s[3])
);
endmodule
fourbitadder.v
module lab2(
a,
b,
cout,
s
);
fa fa_00(
.x(a[0]),
.y(b[0]),
.z(1'b0),
.c(c1),
.s(s[0])
);
fa fa_01(
.x(a[1]),
.y(b[1]),
.z(c1),
.c(c2),
.s(s[1])
);
fa fa_02(
.x(1'b0), //a2
.y(1’b0), //b2
.z(c2),
.c(c3),
.s(s[2])
);
fa fa_03(
.x(1'b0), //a3
.y(1’b0), //b3
.z(c3),
.c(cout),
.s(s[3])
);
endmodule
No Description Completed
1 Create an empty Quartus project for task 1
2 Implement task 1
3 Simulate task 1
4 Test logic of task 1 on FPGA board (board test)
5 Create an empty Quartus project for task 2
6 Implement task 2
7 Simulate task 2
8 Test logic of task 2 on FPGA board (board test)