Verilog刷题笔记49——Fsm1同步复位

题目:

解题:

bash 复制代码
module top_module(clk,reset,in,out);
    input clk;
    input reset;
    input in;
    output out;
    
    parameter A=0,B=1;
    reg [1:0]current_state,next_state;
    
    always@(posedge clk)begin
        if(reset)
            current_state=B;
        else
            current_state=next_state;
    end
    
    always@(*)begin
        case(current_state)
            A:next_state=(in==0)?B:A;
            B:next_state=(in==0)?A:B;
        endcase
    end
    
    assign out=(current_state==A)?0:1;
endmodule

结果正确:

相关推荐
西岸行者2 天前
学习笔记:SKILLS 能帮助更好的vibe coding
笔记·学习
ZPC82102 天前
docker 镜像备份
人工智能·算法·fpga开发·机器人
ZPC82102 天前
docker 使用GUI ROS2
人工智能·算法·fpga开发·机器人
starlaky2 天前
Django入门笔记
笔记·django
勇气要爆发2 天前
吴恩达《LangChain LLM 应用开发精读笔记》1-Introduction_介绍
笔记·langchain·吴恩达
悠哉悠哉愿意2 天前
【单片机学习笔记】串口、超声波、NE555的同时使用
笔记·单片机·学习
勇气要爆发2 天前
吴恩达《LangChain LLM 应用开发精读笔记》2-Models, Prompts and Parsers 模型、提示和解析器
android·笔记·langchain
qianshanxue112 天前
计算机操作的一些笔记标题
笔记
土拨鼠烧电路2 天前
笔记11:数据中台:不是数据仓库,是业务能力复用的引擎
数据仓库·笔记
土拨鼠烧电路2 天前
笔记14:集成与架构:连接孤岛,构建敏捷响应能力
笔记·架构