嗨,我正在写一个8位同步计数器的代码,使用t_flipflops与异步清除。这里是我的代码:总是在Verilog中的语句
module T_ff(CLK,E,CLEAR,T,Q);
input CLK,E,CLEAR,D;
output reg Q;
[email protected](posedge CLK, negedge CLEAR,E,T)
begin:
if(~CLEAR)
Q<=1b'0;
else if (E == 1)
Q<=Q^T;
end:
endmodule
然而,我在if语句说
Error (10170): Verilog HDL syntax error at lab5.v(25) near text "if"; expecting an identifier ("if" is a reserved keyword)
任何帮助,得到一个错误?我也可以把E和T放在灵敏度列表中以及posedge和negedge函数吗?