sherifhansol
Newbie level 1
always it gives me error in that code & can any one help me even with giving other codes for timer
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity timer is
port( input: in std_logic;
output: out time );
end timer;
architecture Behavioral of timer is
begin
p1rocess
variable time_elapsed: time:=0ns ;
begin
wait until input'event and input='1';
loop
wait until (input'event and input='0');
time_elapsed := input'last_event;
output <= time_elapsed;
end loop;
end process p1;
end behavioral ;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity timer is
port( input: in std_logic;
output: out time );
end timer;
architecture Behavioral of timer is
begin
p1rocess
variable time_elapsed: time:=0ns ;
begin
wait until input'event and input='1';
loop
wait until (input'event and input='0');
time_elapsed := input'last_event;
output <= time_elapsed;
end loop;
end process p1;
end behavioral ;