G
Georg Gläser
Guest
Hi there!
I've written a piece of VHDL-code in Xilinx ISE 8.1 WebPack, that should
hold an output high for 330 ns (clock 18MHz). I get an error that i have an
unsupported Clock statement in my code in a line where I'm only trying to
assign a value to a signal. Can you help me?
Here is my code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity lphold is
Port ( clk : in STD_LOGIC;
set : in STD_LOGIC;
lp : out STD_LOGIC);
end lphold;
architecture Behavioral of lphold is
signal count: std_logic_vector(0 to 1):="00";
signal lp_tmp: std_logic := '0';
begin
process(clk, set)
begin
if (set = '1') then
lp_tmp <= '1';
elsif (rising_edge(clk) and set = '1') then
count <= count + 1;
if (count = "10") then
count <= "00";
end if;
elsif (count = "00") then
lp_tmp <= '0';
end if;
end process;
lp <= lp_tmp;
Many Thx for each answer!
Georg
end Behavioral;
I've written a piece of VHDL-code in Xilinx ISE 8.1 WebPack, that should
hold an output high for 330 ns (clock 18MHz). I get an error that i have an
unsupported Clock statement in my code in a line where I'm only trying to
assign a value to a signal. Can you help me?
Here is my code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity lphold is
Port ( clk : in STD_LOGIC;
set : in STD_LOGIC;
lp : out STD_LOGIC);
end lphold;
architecture Behavioral of lphold is
signal count: std_logic_vector(0 to 1):="00";
signal lp_tmp: std_logic := '0';
begin
process(clk, set)
begin
if (set = '1') then
lp_tmp <= '1';
elsif (rising_edge(clk) and set = '1') then
count <= count + 1;
if (count = "10") then
count <= "00";
end if;
elsif (count = "00") then
lp_tmp <= '0';
end if;
end process;
lp <= lp_tmp;
Many Thx for each answer!
Georg
end Behavioral;