verylsi
Full Member level 2
Hey,
I was looking to implement different statements at every rising edge of a clock.
I can think of using a counter, incrementing at every rising edge of the clock and assigning different statements at every counter value using case statements.
Any better logic for better realization ?
Cheers .
I was looking to implement different statements at every rising edge of a clock.
I can think of using a counter, incrementing at every rising edge of the clock and assigning different statements at every counter value using case statements.
Any better logic for better realization ?
Code:
Process (clk)
Begin
if rising_edge(clk) then
if count_x <= "111" then
count_x <= "000";
else
count_x <= count_x + 1;
end if;
end if;
end process;
Process (count_x )
Begin
if rising_edge(count_x(0)) then
case count_x is
when "001" =>
SDA <= data_reg (0);
when "010" =>
SDA <= data_reg (1);
when "011" =>
SDA <= data_reg (2);
when others => null ;
end case;
end process;
Cheers .