Documente Academic
Documente Profesional
Documente Cultură
z(1)=Z(1)
clk
AS shown this is internal architecture of our project. When we declare these components into single structure some more things have to define. Final architecture has ports 1 > CLK it difine clk as-clk=>CLK. 2> RESET it define reset as- reset=>RESET. 3> last o/p Z as shown in signals before display z(0)=>Z(0) All 3 components first individually saved and compiledthen implemented into final structure. Plz make sure new project.
1)
library ieee;
use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity upcnt_dvid is port (clk:in std_logic; z:out std_logic_vector(23 downto 0)); end upcnt_dvid; architecture behav of upcnt_dvid is signal y:std_logic_vector(23 downto 0); begin process(clk) begin if clk='1' then y<=y+1; end if; end process; z<=y; end behav;
2) UP-COUNTER - upcnt
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity upcnt is port (clk,reset:in std_logic; z:out std_logic_vector(3 downto 0)); end upcnt; architecture behav of upcnt is signal y:std_logic_vector(3 downto 0); begin process(clk,reset) begin if reset='1' then y<="0000"; elsif clk='1' then y<=y+1; end if; end process; z<=y; end behav;
when "1010"=> z<="1110111"; when "1011"=> z<="0011111"; when "1100"=> z<="1001110"; when "1101"=> z<="0111101"; when "1110"=> z<="1001111"; when others=> z<="1000111"; end case; end process; end behav;
In this 0 to 9 & A,b,C,d,E,F are definedall hex numbers. Now after all these 3 the final structure will start.
begin E<='1'; comp1:upcnt_dvid port map (clk=>CLK,z(23)=>S0); comp2:upcnt port map (clk=>S0,reset=>RESET,z(0)=>S1,z(1)=>S2,z(2)=>S3,z(3)=>S4); comp3:hex7seg port map (A(0)=>S1,A(1)=>S2,A(2)=>S3,A(3)=>S4,z(0)=>Z(0),z(1)=>Z(1),z(2)=>Z(2), z(3)=>Z(3),z(4)=>Z(4),z(5)=>Z(5),z(6)=>Z(6)); end struct;
plz compile..before save file into same project by SAME name as ENTITY NAME. Now Asssign pins CLKsystem clock pin RESETsystem reset pin Epin 21 or any of 7seg display ENABLE pin Z[0] t0 Z[6] in 7 seg display pin. Now implement. Enjoy..ravindra mathanker(9993699838)