还是写 verilog快一点,可以转换为 VHDL;很简单的~~
module test01(CP,q0,q1,q2,q3,q4,q5,q6,q7); // input CP; output q0,q1,q2,q3,q4,q5,q6,q7; reg q0,q1,q2,q3,q4,q5,q6,q7; reg [2:0]cc; always @ (posedge CP ) begin // if( cc == 3'd0 )begin q0 <= ~q0; end q1 <= q0; q2 <= q1; q3 <= q2; q4 <= q3; q5 <= q4; q6 <= q5; q7 <= q6; // cc <= cc + 3'd1; end
endmodule
|