always @(posedge clk or posedge rst)
begin
if(rst == 1'b1)
COUNTER <= 5'h0_0;
else
if(en == 1'b0)
COUNTER <= 5'h0_0;
else
COUNTER <= COUNTER + 5'h0_1;
end
和“ 5'h0 ” 有什么区别啊,谢谢!
always@(negedge en or posedge rst)
begin
if(rst == 1'b1)
STAT <= 2'B00;//write data -> address 0
else
case(COUNTER)
0: STAT <= STAT;
1: STAT <= 2'B00;//write data
2: STAT <= 2'b01;//write address
default: if(COUNTER > TTLATCH)
STAT <= 2'B11;//long time high level
else
STAT <= 2'B10;//the content of data or address
endcase
end