prashanthi999
Member level 1
- Joined
- Nov 19, 2014
- Messages
- 39
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 287
hello every one, i have a doubt how to increment a counter for every 5 cycles not that
" for single cycle the count will be incrementing " i want to increment a counter for every 5 cycles ,
for eg: here in my code i have incremented for every single clock cycle but i want to increment a count for 5 clock cycles , so that it will stay as "5" for the first 5 clock cycles and "10" for the next five clock cycles and so on. plz guide me.
" for single cycle the count will be incrementing " i want to increment a counter for every 5 cycles ,
for eg: here in my code i have incremented for every single clock cycle but i want to increment a count for 5 clock cycles , so that it will stay as "5" for the first 5 clock cycles and "10" for the next five clock cycles and so on. plz guide me.
Code:
process(clk,reset)
begin
if(clk'event and clk='1') then
if(reset ='1') then
temp <= (others=>'0');
temp1<= (others=>'0');
else
temp<=temp1;
temp1<=temp1 + 5;
end if;
end if;
end process;