fj.vhd
资源名称:fj.rar [点击查看]
上传用户:whhc027
上传日期:2022-08-10
资源大小:410k
文件大小:3k
源码类别:
VHDL/FPGA/Verilog
开发平台:
VHDL
- library IEEE;
- use IEEE.std_logic_1164.all;
- use IEEE.std_logic_unsigned.all;
- use IEEE.std_logic_arith.all;
- entity fj is
- port(
- clk:in std_logic;
- s:in std_logic;
- fmc: buffer std_logic;
- fmc1: buffer std_logic;
- sh:out std_logic;
- ah:out std_logic;
- sv:out std_logic;
- av:out std_logic;
- oe:out std_logic
- );
- end fj;
- architecture a of fj is
- signal fmca: std_logic;
- signal fmcb: std_logic;
- signal fmcc: std_logic;
- signal cf1: integer range 0 to 255;
- signal csh1: integer range 0 to 255;
- signal cs0: integer range 0 to 255;
- signal cs1: integer range 0 to 255;
- signal cv1: integer range 0 to 4000:=3560;
- signal sh1: std_logic;
- signal ah1: std_logic;
- signal sv1: std_logic;
- signal sv11: std_logic;
- signal av1: std_logic;
- signal oe1: std_logic;
- begin
- process
- begin
- wait until clk = '1';
- if (s='0' and cf1>0) then
- fmca <= '0';
- else
- fmca <= '1';
- end if;
- end process;
- process(clk)
- begin
- if clk'event and clk = '1' then
- if cf1<159 then
- cf1 <= cf1 + 1;
- else
- cf1 <= 0;
- end if;
- end if;
- end process;
- process(clk)
- begin
- if clk'event and clk = '0' then
- if (fmca = '1' and cf1 = 0) then
- fmcb <= '0';
- else
- fmcb <= '1';
- end if;
- end if;
- end process;
- fmc <= fmcb;
- process(clk)
- begin
- if clk'event and clk = '0' then
- if (fmc = '0') then
- csh1 <= 0;
- else
- csh1 <= csh1 + 1;
- end if;
- if (csh1 < 10 or csh1 > 157 ) then
- sh1 <= '0';
- else
- sh1 <= '1';
- end if;
- end if;
- end process;
- sh <= sh1;
- process(clk)
- begin
- if clk'event and clk = '0' then
- if (csh1 < 24 or csh1 > 153) then
- ah1 <= '0';
- else
- ah1 <= '1';
- end if;
- end if;
- end process;
- ah <= ah1;
- process(clk)
- begin
- if clk'event and clk = '1' then
- if (s = '1') then
- cs0 <= cs0 + 1;
- else
- cs0 <= 0;
- end if;
- end if;
- end process;
- process
- begin
- wait until s = '0';
- if(cs0=74 or cs0=12) then
- if (cs1<14) then
- cs1<=cs1+1;
- end if;
- else
- cs1<=0;
- end if;
- if (cs1>3 and cs1<9) then
- sv1<='0';
- else sv1<='1';
- end if;
- end process;
- sv <= sv1;
- process
- begin
- wait until sv1 = '0';
- if (ah1 = '1') then
- oe1 <= '0';
- else
- oe1 <= '1';
- end if;
- end process;
- oe <= oe1;
- process
- begin
- wait until clk = '1' ;
- sv11<=sv1;
- end process;
- fmcc <= not(not(sv1) and sv11);
- fmc1 <= fmcc;
- process(clk)
- begin
- if clk'event and clk = '0' then
- if (fmcc = '0') then
- cv1 <= 0;
- else
- cv1 <= cv1 +1;
- end if;
- if (cv1>0 and cv1<3440) then
- av1 <= '0';
- else
- av1 <= '1';
- end if;
- end if;
- end process;
- av <= av1;
- end a;