I want to build a T-flip flop in Verilog. So far I have written the following code, but I wish they could see if it is correct please. The machine I was using to make the code is in the image.
module flopJK(q,j,k,c); input j,k,c; output q; reg q; always @(posedge c) begin case ({j,k}) {1'b0,1'b0}:begin q=q; end {1'b0,1'b1}:begin q=1'b0; end {1'b1, 1'b0}:begin q=1'b1; end {1'b1, 1'b1}:begin q=~q; end endcase end endmodule