这个就是同步时钟的!!!!!
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity scanselect is
port(clk:in std_logic;
in1,in2,in3,in4,in5,in6:in std_logic_vector(3 downto 0);
sel:buffer std_logic_vector(2 downto 0);
daoutut std_logic_vector(3 downto 0));
end entity;
architecture bhv of scanselect is
begin
P1:process(clk)
begin
if clk'event and clk='1' then
if sel<5 then
sel<=sel+1;
else sel<="000";
end if;
end if;
end process P1;
P2:process(sel)
begin
case sel is
when "000"=>daout<=in1;
when "001"=>daout<=in2;
when "010"=>daout<=in3;
when "011"=>daout<=in4;
when "100"=>daout<=in5;
when "101"=>daout<=in6;
when others=>daout<="0000";
end case;
end process P2;
end bhv;
最新回复
giyim (2008-7-22 10:32:04)
liufengyi (2008-7-22 10:37:19)
心海的一滴泪 (2008-7-22 11:18:12)
giyim (2008-7-22 11:23:04)
wwxiaobing (2008-7-22 11:23:17)
看看这个 应该对你有点帮助吧
hagelee (2008-7-22 13:04:59)
changqingteng (2008-7-22 14:10:03)
liufengyi (2008-7-22 15:25:00)
liufengyi (2008-7-22 15:30:56)
liufengyi (2008-7-22 15:33:56)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity scanselect is
port(clk:in std_logic;
in1,in2,in3,in4,in5,in6:in std_logic_vector(3 downto 0);
sel:buffer std_logic_vector(2 downto 0);
daout
end entity;
architecture bhv of scanselect is
begin
P1:process(clk)
begin
if clk'event and clk='1' then
if sel<5 then
sel<=sel+1;
else sel<="000";
end if;
end if;
end process P1;
P2:process(sel)
begin
case sel is
when "000"=>daout<=in1;
when "001"=>daout<=in2;
when "010"=>daout<=in3;
when "011"=>daout<=in4;
when "100"=>daout<=in5;
when "101"=>daout<=in6;
when others=>daout<="0000";
end case;
end process P2;
end bhv;
wwxiaobing (2008-7-22 16:05:04)
liufengyi (2008-7-22 20:31:51)
shun23puppy (2008-7-25 09:09:48)
outuo (2008-7-25 09:21:49)
tanglu5003328 (2008-8-16 19:15:38)
tangguoge (2008-8-16 19:56:16)
evador_afren (2008-8-16 21:44:38)
时序仿真时需要确定电路的最高工作频率是多少,时序波形仿真时时钟的频率不应高于此。
数字系统中竞争冒险(毛刺)现象是必然的,有效的避免毛刺影响的手段主要有:(1)同步法:加入对毛刺不敏感器件(如DFF);(2)选通法;(3)输出RC滤波法。后面的两种方法在《数字电路与系统设计》教材中应该有详细的介绍。
根据自己的实际情况合理选择避免毛刺影响的解决手段。