?? da_tran.vhd
字號:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY da_tran IS
PORT(clk1:in STD_LOGIC;
rst:in std_logic;
qin:in std_logic_vector(9 downto 0);
cs,dsclk: out STD_LOGIC
);
END da_tran;
architecture rtl of da_tran is
signal count:integer range 0 to 3;
signal counter:integer;
signal clk:std_logic;
signal clkout:std_logic;
begin
process(clk1)
begin
if(clk1'event and clk1='1') then
if(count=5)then
count<=0;
else
count<=count+1;
if (count<3) then
clk<='0';
else
clk<='1';
end if;
end if;
end if;
dsclk<=clk;
end process;
process(rst,clk)
variable counter1:integer;
begin
if (clk'event and clk='1') then
if (rst='1')then
counter1:=counter1+1;
else
counter1:=0;
end if;
end if;
counter<=counter1;
end process;
process(rst,counter)
begin
if counter<12 and rst='1' then
cs<='0';
else
cs<='1';
--else
--cs<='1';
end if;
end process;
end rtl;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -