Well well well .... you understand that your code does not make any good sence ..don't you ... q just follows the clk !!!! process will execute every time clk changes that is once at positive edge and again at negative edge and positvie edge you want q to go high and at negative edge you want to q to go low ... this would end up in q just equal to clk .. but if you just want to know this is how it gets translated ... I HOPE THIS IS FOR SIMULATION ONLY !!!!
//////////////////////////////////////////
always @ (clk)
begin
if (clk)
q = 1;
else
q= 0 ;
end
////////////////////////////////////////////
Or you could do it as
///////////////////////////////////////////
always
begin
@(posedge clk);
q = 1 ;
@ (negedge clk);
q = 0 ;
end
//////////////////////////////////////////