primitive ffjk (Q, Clk, set, reset, J, K);
output Q;
input Clk, set, reset, J, K;
reg Q;
table
// Clk set reset J K : Q : Qnew
? 1 0 ? ? : ? : 1;
? 0 1 ? ? : ? : 0;
? 10 0 ? ? : ? : -;
? 0 10 ? ? : ? : -;
01 0 0 0 0 : ? : -;
01 0 0 0 1 : ? : 0;
01 0 0 1 0 : ? : 1;
01 0 0 1 1 : 0 : 1;
01 0 0 1 1 : 1 : 0;
? 0 0 ?? ?? : ? : -;
endtable
endprimitive
module ff(Q, Clk, set, reset, J, K);
input Clk, set, reset, J, K;
output reg Q;
ffjk M1(Q,Clk,set,reset,J,K);
endmodule
I have made a primitive of JK FF. Then I have made a module and used the primitive inside it. I have also written a test bench to execute this code. I am constantly getting syntax error in 2nd line.
jkff.v:2: syntax error
I give up.