You are on page 1of 2

constant Clock_period: time := 20ns; Clock_process :process begin Clock <= wait for Clock <= wait for

end process;

'0'; Clock_period/2; '1'; Clock_period/2;

cont1cent: process(clock) begin if(reset = '1') then contclocks <=0; p1cent<='1'; elsif clock' event and clock = '1' then if stop = '0' then p1cent<='0'; if contclocks = 0 then contclocks <= 499999; p1cent<='0'; elsif contclocks = 1 then p1cent<='1'; contclocks <= contclocks -1; else contclocks <= contclocks -1; p1cent<='0'; end if; end if; end if; end process; contcent:process(clock,p1cent,stop) begin if prim_cent = '1' then contcents <= 9; prim_cent <= '0'; end if; if(reset = '1') then contcents <= 0; p1seg <= '0'; elsif(clock' event and clock = '1') then if(stop = '0') then p1seg <= '0'; if (p1cent = '1') then if(contcents = 0) then contcents <= 99; p1seg <= '0'; elsif(contcents = 1) then p1seg <= '1'; contcents <= contcents - 1; else contcents <= contcents - 1; p1seg <= '0'; end if; end if; end if; end if;

ocent<=contcents; end process; end Behavioral; process(clock,stop,p1seg) begin if prim_segundo = '1' then contseg <= 4; prim_segundo <= '0'; end if; if(reset = '1') then -- Reset On contseg <= 0; p1min <= '0'; elsif(clock' event and clock = '1') then if(stop = '0') then -- Stop p1min <= '0'; if(p1seg = '1')then if(contseg = 0) then contseg <= 10; p1min <= '0'; elsif(contseg = 1) then p1min <= '1'; contseg <= contseg - 1; else contseg <= contseg - 1; p1min <= '0'; end if; end if; end if; elsif(carga = '1') then contseg<= contseg +1; end if; oseg<=contseg; end process

-- Clk

You might also like