Forum Discussion
Altera_Forum
Honored Contributor
13 years agoQuirk with my clocks
I'm building a Binary Game for my final project in Digital Logic and Design and a small portion of this game I'm building uses a countdown timer to show how much time you have left in your round. ...
Altera_Forum
Honored Contributor
13 years agoIf I understood your requirement, you want to get maximum of a stream of values. Then you can use a register with a bit of logic(assuming your stream is reg1 with positive values only):
process(reset,clk)
begin
if reset = '1' then
reg2 <= (others => '0');
elsif rising_edge(clk) then
if reg1 > reg2 then
reg2 <= reg1;
end if;
end if;
end process;
Good luck with your scores