module counter4(clk,dout,en,oc);
input wire clk;
input wire en;
output reg [3:0] dout;
output reg oc;
reg [3:0] temp;
always @(posedge clk)
begin
if(en==1)
begin
temp<=temp+1;
if(temp=="1111")
oc<=1;
else
oc<=0;
dout<=temp; end
else
dout<=4'bz;
oc<="z";
end
endmodule
怎么进位信号老是没有呢!
请教下 |