K
Kaiserin
Guest
Joku auttaa minua tämän koodin VHDL ..... Haluan cnvert tämä koodi verilog koodi ja i-kirjain dont osata kuinka .... HEELLLPPP
Tämä on koodi VHDL:
Koodi:
yksikkö vhdlmodule on
Port (CLKIN: in std_logic;
AN3: InOut std_logic;
AN2: InOut std_logic;
AN1: InOut std_logic;
AN0: InOut std_logic;
LED: out std_logic_vector (6 downto 0));
lopussa vhdlmodule;architecture Behavioral of vhdlmodule onsignaali CTR: std_logic_vector (12 downto 0);
aloittaa
Process (CLKIN)
aloittaa
jos CLKIN'event ja CLKIN = '1 'then
if (CTR = "0000000000000") niin
jos (AN0 = '0 ') then
AN0 <= '1 ';
LED <= "0101011";
AN1 <= '0 ';
elsif (AN1 = '0 ') then
AN1 <= '1 ';
LED <= "0101011";
AN2 <= '0 ';
elsif (AN2 = '0 ') then
AN2 <= '1 ';
LED <= "0001000";
AN3 <= '0 ';
elsif (AN3 = '0 ') then
AN3 <= '1 ';
LED <= "0000110";
AN0 <= '0 ';
end if;
end if;
CTR <= CTR "0000000000001";
jos (CTR> "1000000000000") jälkeen
CTR <= "0000000000000";
end if;
end if; - CLK'event ja CLK = '1 '
End process;
End Behavioral
Tämä on koodi VHDL:
Koodi:
yksikkö vhdlmodule on
Port (CLKIN: in std_logic;
AN3: InOut std_logic;
AN2: InOut std_logic;
AN1: InOut std_logic;
AN0: InOut std_logic;
LED: out std_logic_vector (6 downto 0));
lopussa vhdlmodule;architecture Behavioral of vhdlmodule onsignaali CTR: std_logic_vector (12 downto 0);
aloittaa
Process (CLKIN)
aloittaa
jos CLKIN'event ja CLKIN = '1 'then
if (CTR = "0000000000000") niin
jos (AN0 = '0 ') then
AN0 <= '1 ';
LED <= "0101011";
AN1 <= '0 ';
elsif (AN1 = '0 ') then
AN1 <= '1 ';
LED <= "0101011";
AN2 <= '0 ';
elsif (AN2 = '0 ') then
AN2 <= '1 ';
LED <= "0001000";
AN3 <= '0 ';
elsif (AN3 = '0 ') then
AN3 <= '1 ';
LED <= "0000110";
AN0 <= '0 ';
end if;
end if;
CTR <= CTR "0000000000001";
jos (CTR> "1000000000000") jälkeen
CTR <= "0000000000000";
end if;
end if; - CLK'event ja CLK = '1 '
End process;
End Behavioral