AIM:
To develop a BCD counter and display and its output in a seven segment display using FPGA kit.
APPARATUS REQUIRED:
Xilinx V14.7 software
FPGA Trainer kit
CONNECTION DIAGRAMS:
TRUTH TABLE:
FLOW CHART:
PROGRAMS CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity code_m is
Port ( clock : in STD_LOGIC;
reset : in STD_LOGIC;
seg : out STD_LOGIC_VECTOR (6 downto 0));
end code_m;
architecture Behavioral of code_m is
begin
process (clock, reset)
variable bcd: STD_LOGIC_VECTOR (3 downto 0);
begin
if (reset='1') then
bcd := "0000";
elsif clock'event and clock = '1' then
if bcd < 9 then
bcd := bcd + '1';
else
bcd := "0000";
end if;
end if;
case bcd is
when "0000" => seg <= "0111111";
when "0001" => seg <= "0000110";
when "0010" => seg <= "1011011";
when "0011" => seg <= "1001111";
when "0100" => seg <= "1100110";
when "0101" => seg <= "1101101";
when "0110" => seg <= "1111101";
when "0111" => seg <= "0000111";
when "1000" => seg <= "1111111";
when "1001" => seg <= "1110111";
when others => seg <= "0000000";
end case;
end process;
end Behavioral;
SIMULATION OUTPUT:
To develop a BCD counter and display and its output in a seven segment display using FPGA kit.
APPARATUS REQUIRED:
Xilinx V14.7 software
FPGA Trainer kit
CONNECTION DIAGRAMS:
TRUTH TABLE:
FLOW CHART:
PROGRAMS CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity code_m is
Port ( clock : in STD_LOGIC;
reset : in STD_LOGIC;
seg : out STD_LOGIC_VECTOR (6 downto 0));
end code_m;
architecture Behavioral of code_m is
begin
process (clock, reset)
variable bcd: STD_LOGIC_VECTOR (3 downto 0);
begin
if (reset='1') then
bcd := "0000";
elsif clock'event and clock = '1' then
if bcd < 9 then
bcd := bcd + '1';
else
bcd := "0000";
end if;
end if;
case bcd is
when "0000" => seg <= "0111111";
when "0001" => seg <= "0000110";
when "0010" => seg <= "1011011";
when "0011" => seg <= "1001111";
when "0100" => seg <= "1100110";
when "0101" => seg <= "1101101";
when "0110" => seg <= "1111101";
when "0111" => seg <= "0000111";
when "1000" => seg <= "1111111";
when "1001" => seg <= "1110111";
when others => seg <= "0000000";
end case;
end process;
end Behavioral;
SIMULATION OUTPUT:
Step1: Open xilinx software > go to file > new project > create source file name> select specific folder> next > select proper project settings> we use spartan 3E trainer kit.
Step2: next > finish > go to project > new source > select VHDL module > create file name> next > select input and output > next > finish> write program > if done write programs > click synthesis > right click> run.
Step3: go to user constraints > select I/O pin planning and right click > run > yes. wait few seconds. will open new tap like this.
Step3: go to user constraints > select I/O pin planning and right click > run > yes. wait few seconds. will open new tap like this.
Step4: Assign input and output of the trainer kit pinouts > go to file > select save to constraints and close that tap. select implementation design and right click > run. select generate programming and right click > run. if you completed those three option with green tik. select configure device and right click >run. will open new tap. double click boundary scan > ok. connect FPGA Trainer kit to PC system through parallel port or usb > right click centre point of the blue colour line > select initialize chain > then connected your FPGA Trainer kit.
Step5: open .bit file and load it > now you check the output result of the FPGA Trainer kit.
NOTE: if you want image file > click print screen > open MS paint > cnt +v > save
if you want PDF file > file > print > select doPDF printer > create pdf file name + quality> ok
Step5: open .bit file and load it > now you check the output result of the FPGA Trainer kit.
NOTE: if you want image file > click print screen > open MS paint > cnt +v > save
if you want PDF file > file > print > select doPDF printer > create pdf file name + quality> ok
VHDL implementation of bcd counter with 7 segment display
ReplyDelete