[an error occurred while processing this directive]
|
В Альтере все работает. Вот только по спаду rst Вы тоже формируете одиночный импульс ready. Зачем Вам это извращение на автомате.
Попробуйте так. Получается. Но я не анализировал. Нет желания влезать.
module trig(rst,clk,start,ready);
input rst,clk,start;
output ready;
reg ready;
reg [1:0] curr_state,next_state;
parameter s0 = 2'b00, s1 = 2'b01, s2 = 2'b10, s3 = 2'b11;
always @ ( curr_state or start)
case(curr_state)
s0:
begin
ready = 1'b0;
if (start)
next_state = s1;
else next_state = s0;
end
s1:
begin
ready = 1'b0;
if (start)
next_state = s1;
else next_state = s2;
end
s2:
begin
ready = 1'b1;
next_state = s3;
end
s3:
begin
ready = 1'b0;
if (start)
next_state = s1;
else next_state = s3;
end
endcase
always @ (posedge rst or posedge clk)
begin
if (rst)
curr_state <= s0 ;
else
curr_state <= next_state;
end
endmodule
E-mail: info@telesys.ru