--vhdl code for 111 to 444 counter..
library ieee;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_arith.all;
entity counter111to444 is
port(clk:in std_logic;
count1:out integer);
end counter111to444;
architecture Behavioral of counter111to444 is
begin
process(clk)
variable a:integer:=1;
variable b:integer:=1;
variable c:integer:=1;
begin
if(clk' event and clk='1') then
a:=a+1;
if(a=10) then
b:=b+1;
a:=0;
if(b=10) then
c:=c+1;
b:=0;
end if;
end if;
if(c=4 and b=4 and a=5) then
a:=1;
b:=1;
c:=1;
end if;
end if;
count1<= (c*100)+(b*10)+a;
end process;
end Behavioral;
the above code has been verified..! :)
0 comments:
Post a Comment