vvt 发表于 2011-8-22 13:22:12

大家帮忙分析一下 问什么不能生成状态图 谢谢

always @ (posedge clk50M, posedge rst)
begin
        case (state)
                S0 :
                        begin
                                cnt<=cnt+32'd1;
                                if (cnt == 32'd49)
                                        begin
                                                state <= S1;
                                                cnt<=32'd0;
                                        end
                                else
                                        state <= S0;
                        end
                S1 :
                        begin
                                if(rst==1)
                                        begin
                                                rdaddress<=3'd0;
                                        end
                                else
                                        begin
                                               rden<=1'b1;
                                               wr<=1'b0;
                                               rdaddress<=rdaddress+4'd1;
                                               if(rdaddress == 4'd15)
                                                       begin
                                                                        rdaddress <= 4'd0;
                                                                        rden<=1'b0;
                                                                        wr<=1'b1;
                                                                        state <= S0;
                                                               
                                                       end
                                               else
                                                        state <= S1;       
                                        end
                        end   
        endcase
end

离场悲剧 发表于 2011-8-27 12:30:01

初始状态的定义。。。
复位信号你没用?

liujilei311 发表于 2011-9-2 08:19:35

应该是的!!!!
页: [1]
查看完整版本: 大家帮忙分析一下 问什么不能生成状态图 谢谢