Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Not a small mistake. The counter carry logic is completely erronous.There is a small mistake in there. Will change it soon.
process(clk) --period of clk is 1 second.
begin
if(clk'event and clk='1') then
sec <= sec+ 1;
if(sec = 59) then
min <= min + 1;
end if;
if(min = 60) then
hour <= hour + 1;
min <= 1;
end if;
if(hour = 24) then
hour <= 0;
end if;
if(sec = 60) then
sec <= 1;
end if;
end if;
end process;
sec <= sec+ 1;
if(sec = 59) then
sec <= 0;
min <= min + 1;
if(min = 59) then
min <= 0;
hour <= hour + 1;
if(hour = 23) then
hour <= 0;
end if;
end if;
end if;
if(sec < 59) then
sec <= sec+ 1;
else
sec <= 0;
if(min < 59) then
min <= min + 1;
else
min <= 0;
if(hour < 23) then
hour <= hour + 1;
else
hour <= 0;
end if;
end if;
end if;
Check this out, I have posted it on my Blog. its completely synthesizable. You can also check its video.
VHDL codes: Synthesizable RTC in VHDL