- Codice: Seleziona tutto
entity freq_variabile is
port(clk, reset, enable : in std_logic;
out_vf : out std_logic);
end freq_variabile;
architecture Behavioral of freq_variabile is
signal counter : integer:=0;
signal out_vf2 : std_logic;
begin
process(clk,reset,enable)
begin
if reset='1' then
out_vf2<='0';
counter <= 0;
elsif rising_edge(clk) then
if enable='1' then
if counter=0 then
out_vf2 <= clk;
counter<=counter+1;
end if;
if counter=1 then
out_vf2<='1';
counter<=counter+1;
end if;
if counter=2 then
out_vf2<='0';
counter<=counter+1;
end if;
if counter=3 then
out_vf2<= '1';
counter<=counter+1;
end if;
if counter=4 then
out_vf2<= '1';
counter<=counter+1;
end if;
if counter=5 then
out_vf2<= '0';
counter<=counter+1;
end if;
if counter=6 then
out_vf2<='0';
counter<=counter+1;
if counter=7 then
out_vf2<= '1';
counter<=counter+1;
end if;
if counter=8 then
out_vf2<= '0';
counter<=0;
end if;
elsif enable='0' then --enable disattivo
out_vf2<='X';
counter<=0;
end if;
end if;
end if;
end process;
out_vf<=out_vf2;
end Behavioral;
testbench relativo:

Elettrotecnica e non solo (admin)
Un gatto tra gli elettroni (IsidoroKZ)
Esperienza e simulazioni (g.schgor)
Moleskine di un idraulico (RenzoDF)
Il Blog di ElectroYou (webmaster)
Idee microcontrollate (TardoFreak)
PICcoli grandi PICMicro (Paolino)
Il blog elettrico di carloc (carloc)
DirtEYblooog (dirtydeeds)
Di tutto... un po' (jordan20)
AK47 (lillo)
Esperienze elettroniche (marco438)
Telecomunicazioni musicali (clavicordo)
Automazione ed Elettronica (gustavo)
Direttive per la sicurezza (ErnestoCappelletti)
EYnfo dall'Alaska (mir)
Apriamo il quadro! (attilio)
H7-25 (asdf)
Passione Elettrica (massimob)
Elettroni a spasso (guidob)
Bloguerra (guerra)



