You are on page 1of 6

BCD to 7 Segment Display

Project Title: BCD to Seven-Segment Display Converter Using FPGA

Objective: To implement a Binary Coded Decimal (BCD) to Seven-Segment Display converter using
Hardware Description Language (HDL) in Xilinx.

Abstract: The software component of the "BCD to Seven-Segment Display Converter" project is aimed
at providing a user-friendly interface and control mechanism for converting 4-bit Binary Coded Decimal
(BCD) inputs into visually readable data on a common cathode seven-segment display.

Introduction: The "BCD to Seven-Segment Display Converter" project addresses the need for a user-
friendly and efficient software component to complement the FPGA-based hardware designed for
converting Binary Coded Decimal (BCD) data into a visual format on a common cathode seven-segment
display. This software plays a pivotal role in ensuring a seamless user experience, providing a
straightforward interface for BCD input, validating user entries, and overseeing the data conversion
process before sending it to the FPGA hardware for display. The objective of this software is to bridge
the gap between user inputs and the hardware, making it a practical solution for applications that
require numerical data visualization. In this report, we delve into the software's design,
implementation, and objectives, highlighting its vital role within the project.

Requirements:
• Software Used: Xilinx, Modelsim.
• Programming Language Used: HDL – Hardware Description Language.

Working Methodology:
Step 1: Project Initiation

Create a new project in Xilinx and specify the project name, location, and any necessary project
settings.

Step 2: Create the BCD to Seven-Segment Decoder

Design the BCD to Seven-Segment Decoder module using a Hardware Description Language (HDL) like
VHDL or Verilog. This module interprets the BCD input and generates control signals for the seven-
segment display.

Step 3: Programming In Xilinx

Write the Detailed HDL (Hardware Description Language) Program in Xilinx for BCD to & segment
Display.

Step 4: Simulation of Design

Create a test bench for the design to provide inputs for verification. Simulate the design to identify
and fix any issues.

Step 5: Output Generation

Generate the 7 segment Display by inputting a BCD Value.


Circuit/Logic Diagram:

Design Code:
module BCD_7segment (bcd, seg, cs);

input [3:0]bcd;

input cs;

output reg [6:0]seg;

always@(cs or bcd)

begin

if (~cs)

seg = 7'b0000_000;

else

begin

case(bcd)

0: seg = 7'b1111_110;

1: seg = 7'b0110_000;

2: seg = 7'b1101_101;

3: seg= 7'b1111_001;

4: seg = 7'b0110_011;

5: seg = 7'b1011_011;

6: seg = 7'b1110_111;
7: seg = 7'b1110_000;

8: seg = 7'b1111_111;

9: seg = 7'b1111_011;

endcase

end

end

endmodule

Test Bench:
module BCD_7segment_tb_v;

// Inputs

reg [3:0] bcd;

reg cs;

// Outputs

wire [6:0] seg;

// Instantiate the Unit Under Test (UUT)

BCD_7segment uut (

.bcd(bcd),

.seg(seg),

.cs(cs)

);

initial begin

// Initialize Inputs

bcd = 0;

cs = 0;

// Wait 100 ns for global reset to finish

#100;

// Add stimulus here

cs = 1'b1;

#10; bcd = 0;

#10; bcd = 1;
#10; bcd = 2;

#10; bcd = 3;

#10; bcd = 4;

#10; bcd = 5;

#10; bcd = 6;

#10; bcd = 7;

#10; bcd = 8;

#10; bcd = 9;

end

endmodule

Program on Xilinx:
Design Code Test Bench
Outputs:
BCD to 7-Segment Table:

Simulation Results:
Future Enhancements:
• Integration with input interfaces for dynamic BCD input.
• Support for additional display types (e.g., common anode seven-segment displays).
• Design optimization for power efficiency.

Results:
Upon successful implementation, the project BCD to 7-segment display effectively converted the BCD
input into a visual representation on the seven-segment display. The mapping correctly displayed the
decimal value corresponding to the BCD input, making it a practical solution for numerical data display
applications.

Conclusion:
The project demonstrated a successful conversion of BCD data to a visual representation on a seven-
segment display using FPGA technology. The design can be adapted and expanded for various
applications where numerical data needs to be displayed in a readable and user-friendly format.

You might also like