- UID
- 106665
- 性别
- 男
|
--***************************
--* 8 Bit UP Counter *
--* Filename : counter8 *
--***************************
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity counter8 is
port (
CLK: in STD_LOGIC;
Q: inout STD_LOGIC_VECTOR (0 to 7);
RESET: in STD_LOGIC
);
end counter8;
architecture counter8_arch of counter8 is
begin
process (CLK,RESET,Q)
begin
if RESET = '1' then
Q <= "00000000";
elsif CLK'event and CLK = '1' then
Q <= Q + 1;
end if;
end process;
end counter8_arch;
这是个升计数器,其计数范围为0-255;
大家看一下防真能不能得到结果,我是得不到.
是不是双向端口的问题,那位大峡能指点一下.
我用的是max+plusII |
|