VHDL kodas

A

akrlot

Guest
Hi;
Noriu kodas automatas su counter.there 'ai 10 ciklų tarp valstybės k_fv
ir k_fo (incerement Couter 0-9) bei 15 ciklų skaičius tarp k_fo ir k_fr ir
1cycle tarp k_fr ir k_fv.Thanks in advance.

tai mano kodas, o jei tai nepadės imituoti norėjo duoti result.thx
Biblioteka IEEE;
naudoti ieee.std_logic_1164.all;

subjektas feu_ctl yra
generic (size: integer: = 15);
uostas (CLK: in std_logic;
rst_n: in std_logic;
o_fv: iš std_logic;
o_fo: iš std_logic;
o_fr: iš std_logic);
pabaigos feu_ctl;

architektūra arka feu_ctl yra
tipo feu_state yra (k_fv, k_fo, k_fr);
signalas feu_fsm_d, feu_fsm_q: feu_state;

signalas cpt_q, cpt_d: integer;
pradėti
P1: procesas (CLK, rst_n)
pradėti
if (rst_n = '0 ') tada feu_fsm_q <= k_fr;
cpt_q <= 0;
elsif CLK = '1 'ir clk'event tada feu_fsm_q <= feu_fsm_d;
cpt_q <= cpt_d;
end if;
pabaigos procesą P1;

P2: procesas (feu_fsm_q, cpt_q)
pradėti
jei cpt_q = dydis-1, tada cpt_d <= 0;
kitas cpt_d <= cpt_q 1;
end if;
atveju feu_fsm_q yra
kai k_fv => o_fv <= '1 '; o_fo <= '0'; o_fr <= '0 '; feu_fsm_d <= k_fo;
kai k_fo => jei cpt_q = 10 tada
o_fo <= '1 '; o_fr <= '0'; o_fv <= '0 '; feu_fsm_d <= k_fr; cpt_d <= 0;
end if;
kai k_fr => jei cpt_q = 1 tada
o_fr <= '1 '; o_fv <= '0'; o_fo <= '0 '; feu_fsm_d <= k_fv; cpt_d <= 0;
end if;
pabaigos atveju;
pabaigos procesą p2;
pabaigos Arch;

 
Čia yra ištaisyti kodą ....

Kodas

Biblioteka IEEE;

naudoti ieee.std_logic_1164.all;subjektas feu_ctl yra

generic (size: integer: = 15);

uostas (CLK: in std_logic;

rst_n: in std_logic;

o_fv: iš std_logic;

o_fo: iš std_logic;

o_fr: iš std_logic);

pabaigos feu_ctl;architektūra arka feu_ctl yra

tipo feu_state yra (k_fv, k_fo, k_fr);

signalas feu_fsm_d, feu_fsm_q: feu_state;signalas cpt_q, cpt_d: integer;

pradėti

P1: procesas (CLK, rst_n)

pradėti

if (rst_n = '0 '), tada

feu_fsm_q <= k_fr;

cpt_q <= 0;

elsif CLK = '1 'ir clk'event tada

feu_fsm_q <= feu_fsm_d;

cpt_q <= cpt_d;

end if;

pabaigos procesą P1;

- There's 10 ciklų tarp valstybės k_fv

- Ir k_fo (incerement Couter 0-9) bei 15 ciklų skaičius tarp k_fo ir k_fr ir

- 1cycle tarp k_fr ir k_fv.

P2: procesas (feu_fsm_q, cpt_q)

pradėti

jei cpt_q = dydis-1, tada

cpt_d <= 0;

kitas

cpt_d <= cpt_q 1;

end if;atveju feu_fsm_q yra

kai k_fv =>

if (cpt_q = 9), tada

feu_fsm_d <= k_fo;

cpt_d <= 0;

end if;

kai k_fo =>

if (cpt_q = 14) tada

feu_fsm_d <= k_fr;

end if;

kai k_fr =>

feu_fsm_d <= k_fv;

cpt_d <= 0;

pabaigos atveju;

pabaigos procesą p2;- Valstybės aparatas O / P dekoderis

P3: procesas (feu_fsm_q)

Pradžia - procesas P3

atveju feu_fsm_q yra

kai k_fv =>

o_fv <= '1 ';

o_fo <= '0 ';

o_fr <= '0 ';

kai k_fo =>

o_fo <= '1 ';

o_fr <= '0 ';

o_fv <= '0 ';

kai k_fr =>

o_fr <= '1 ';

o_fv <= '0 ';

o_fo <= '0 ';

pabaigos atveju;

pabaigos procesą P3;

pabaigos Arch;
 

Welcome to EDABoard.com

Sponsor

Back
Top