百度首页 | 百度空间
 
查看文章
 
VHDL--4位加计数器
2007年06月06日 星期三 20:55


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity CNT4 is
     Port ( CLK : in   STD_LOGIC;
            Q : out   STD_LOGIC_VECTOR (3 downto 0);
      fn:out std_logic_vector(1 downto 0);
      en:out std_logic_vector(1 downto 0));
end CNT4;

architecture Behavioral of CNT4 is
signal q1:std_logic_vector(3 downto 0);
begin
process(clk)
begin
if CLK'event and CLK='1' then
q1<=q1+1;
end if;
end process;
Q<=q1;
fn<="10";
en<="00";
end Behavioral;


类别:Vhdl | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码:
 

     

©2008 Baidu