Hi bertulus ,
The first part the logic gate output i did same as you , at my photo i call to the signal And_out and you called it rise .
About the second part - counter , i have some questions :
1.Does the process end after end if as mentioned below ? and the last 4 lines arent at the process ?
proces...
if(clk'event and clk='1' )then
c_reg <= c_next;
end if;
end process ;
2.At the process c_reg is the output of the F.F and c_next is the input of the F.F ,
after that c_next ( input ) gets c_reg (output) as mentioned below, why does the signal returns back to the input ?
c_next <=
c_reg + 1 when (
c_reg = "00" and rise = '1' ) else
c_reg when ( c_reg = "00" ) else
c_reg + 1 when ( c_reg < 3 ) else
"00";
3.does c_next means
count and rise means
and_ out at my attached photo design?
4.i didn't understand the condition :
c_next <= c_reg + 1 when ( c_reg = "00" and rise = '1' ) else
c_reg when ( c_reg = "00" ) else
c_reg + 1 when ( c_reg < 3 ) else
"00";
why does c_next gets c_reg+1 when ( c_reg = "00" and rise = '1' ) ? c_reg is std_logic of one bit only , why does it has to be equal to "00" in order that the counter will inc by 1 ?
I did not understand the following conditions as well ...
can you please explain each step please ?
my design purpose is that for every time that the And_out signal rise for '1' the counter need to count 4 clocks and when he finish the counting he gets 0 and wait for the next pulse .
Thanks .