Cpe G4
Cpe G4
Cpe G4
FOR
GROUP 4
OBJECTIVES
• To design a BCD – a 7-segment decoder using VHDL coding.
• To show the truth table for this design.
• To show the 7-segment decoder display circuit and its Boolean expressions.
• To also show the VHDL Code using combinational logic and case statement.
APPARATUS:
1. Field Programmable Gate Array (FPGA).
2. Programmable Logic Devices (PLDs).
3. Computer Aided Design (CAD) Tool eg; Cyclone IV.
PROBLEM ANALYSIS:
The BCD to 7 Segment Decoder converts 4 bit binary to 7 bit control signal which can be
displayed on a 7 segment display. The 7 segment display consist of 7 LED Segments to display
the number 0 to 9 to F.
CODE
• VHDL CODE FOR A BCD TO 7 SEGMENT DISPLAY DECODER USING
COMBINATORIAL LOGIC.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity bcd_7seg is
end bcd_7seg;
begin
D <=
(NOT B1 AND NOT B3) OR (B2 AND NOT B3) OR (B1 AND NOT B2 AND B3) OR (NOT B1 AND B2) OR
B0;
F <= B0 OR (NOT B2 AND NOT B3) OR (B1 AND NOT B2) OR (B1 AND NOT B3);
G <= B0 OR (B1 AND NOT B2) OR ( NOT B1 AND B2) OR (B2 AND NOT B3);
end Behavioral;
use IEEE.STD_LOGIC_1164.ALL;
entity bcd_7segment is
end bcd_7segment;
begin
process(BCDin)
begin
case BCDin is
end process;
end Behavioral;
WAVEFORM FOR A BCD TO 7 SEGMENT DISPLAY DECODER.
To get the waveform for this design, we had to write a VHDL TESTBENCH Code for the
design.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY tb_bcd_7seg IS
END tb_bcd_7seg;
COMPONENT bcd_7segment
PORT(
);
END COMPONENT;
--Inputs
signal BCDin : std_logic_vector(3 downto 0) := (others => '0');
--Outputs
BEGIN
);
– Stimulus process
stim_proc: process
begin
end process;
END;