刚刚学习的时候经常用到case语句实现,导致有很多毛刺产生,下面小程序可以避免这种现象发生。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity ww is
port(
clk:in std_logic;
inda:in std_logic_vector(4 downto 0);
data:out std_logic);
end ww;
architecture one of ww is
begin
process(clk)
variable d:integer range 0 to 4 :=0;
begin
if clk'event and clk='1' then
data<=inda(d);
d:=d+1;
end if;
end process;
end one;
短小,但是很好用哦~
