Vlsi Reoprt
Vlsi Reoprt
1. Introduction
In digital design, especially when working with FPGA systems, it is
often useful to display computed results in real-time. This project
demonstrates the design and implementation of a 4-bit binary adder on
an FPGA, with the result shown on a 7-segment display embedded in
the FPGA board. This setup provides an efficient way to visually verify
the outcome of the addition operation directly from the hardware.
2. Objectives
The primary objectives of this project are:
• To design and implement a 4-bit binary adder circuit on an FPGA.
• To convert the binary output of the adder to a format suitable for
driving a 7-segment display.
• To use the embedded 7-segment display on the FPGA board for
real-time visualization of the addition result.
1
3. FPGA-Embedded 7-Segment Display
The FPGA board’s 7-segment display provides an immediate visual
interface to observe the output of the 4-bit adder. This display consists
of seven LEDs arranged in a pattern to represent decimal numbers (0-
9) and hexadecimal characters (A-F).
Each LED segment (labeled A to G) is controlled by a specific signal
to illuminate the segments that form each character. The display on
the FPGA board is commonly configured for active-low control signals,
where a ‘0’ lights up the segment, and a ‘1’ turns it off.
2
4.3 Implementation on FPGA
The design was coded in Verilog and verified through simulation to
ensure accurate addition and display. After successful simulation,
the code was synthesized and implemented on the FPGA. Once pro-
grammed, the addition results were displayed in real-time on the FPGA
board’s embedded 7-segment display, enabling a straightforward ver-
ification of the adder’s functionality by observing each possible sum
directly on the hardware.
5. Code:
module top_module(
input [3:0] a,
input [3:0] b,
input cin,
input enable,
output [6:0] seg,
output [15:0] led
);
four_bitadder u4 (
.a(a),
.b(b),
.cin(cin),
.sum(sum),
.cout(cout)
);
seven_segment_decoder u6 (
.sum(sum),
.enable(enable),
.seg(seg)
);
3
assign led[4] = b[0];
assign led[5] = b[1];
assign led[6] = b[2];
assign led[7] = b[3];
assign led[8] = cin;
assign led[9] = cout;
assign led[10] = enable;
assign led[11] = 0;
assign led[12] = 0;
assign led[13] = 0;
assign led[14] = 0;
assign led[15] = 0;
endmodule
‘timescale 1ns / 1ps
module one_bit_fulladder(
input a,
input b,
input cin,
output sum,
output cout
);
assign sum = (a ^ b) ^ cin;
assign cout = b & cin | a & cin | a & b;
endmodule
module four_bitadder(
input [3:0] a,
input [3:0] b,
input cin,
output [3:0] sum,
output cout
);
endmodule
module seven_segment_decoder (
4
input [3:0] sum,
input enable,
output reg [6:0] seg
);
5
# Assign switches b[0] to b[3] (for inputs b[3:0])
set_property PACKAGE_PIN W15 [get_ports {b[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports {b[0]}]
6
# Assign LEDs led[8] to led[10] for cin, cout, and enable
set_property PACKAGE_PIN V13 [get_ports {led[9]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[9]}]
7
set_property PACKAGE_PIN W7 [get_ports {seg[6]}]
set_property IOSTANDARD LVCMOS33 [get_ports {seg[6]}]
5. Results
The 4-bit adder and decoder performed accurately, correctly comput-
ing the sum of two 4-bit binary numbers and displaying the result on
the embedded 7-segment display of the FPGA. This integration allowed
for real-time monitoring of the adder’s performance, with all possible
sums (from 0 to 15) correctly represented in hexadecimal format. The
FPGA board, which hosted both the adder logic and the display, served
as an effective platform for computation and output display, ensuring
8
that the entire process from calculation to visualization was seamless.
This functionality was verified through simulation and FPGA pro-
gramming, with results observed directly on the hardware. The ability
to see the sum in real-time on the 7-segment display made it easier
to troubleshoot and confirm that the adder was working as expected.
Additionally, the display’s active-low configuration was validated, en-
suring that each segment of the display was correctly illuminated based
on the binary sum.
Overall, the project demonstrated the FPGA’s capabilities in per-
forming both computational tasks and displaying results, making it a
valuable platform for real-time embedded systems.
6. Conclusion
The project successfully demonstrated the design, implementation, and
testing of a 4-bit binary adder circuit, with the results displayed on an
FPGA’s embedded 7-segment display. This integration allowed for
efficient and accurate real-time monitoring of the computation, show-
casing the ability of FPGA systems to handle both arithmetic compu-
tations and output visualization simultaneously.
The use of a ripple-carry adder, combined with the 7-segment dis-
play decoder, provided a simple yet effective solution to the problem of
visualizing computation results on hardware. Furthermore, the flexibil-
ity and reconfigurability of the FPGA were key factors in the project’s
success, offering the potential for further enhancements, such as the
addition of more complex arithmetic operations or user interfaces.
This project highlights the versatility of FPGA technology for em-
bedded system design, especially for applications requiring real-time
computation and feedback. It serves as a solid foundation for more ad-
vanced embedded system projects, providing insight into the potential
of FPGA-based solutions for computational tasks, data visualization,
9
and hardware interfacing.
7. References
• Brown, S., & Vranesic, Z. (2009). Fundamentals
of Digital Logic with Verilog Design. McGraw-
Hill Education.
This textbook provides a solid foundation in digital logic design principles and offers detailed
tutorials on FPGA-based design using Verilog. It includes explanations of arithmetic circuits,
such as adders, and how to interface with display modules like 7-segment displays, making it
a crucial reference for FPGA design projects.
10