-
Simple FSM3 asy
module top_module(
input clk,
input in,
input areset,
output out); //parameter A=2'd0; parameter B=2'd1; parameter C=2'd2; parameter D=2'd3; reg[1:0] state; reg[1:0] next_state; // State transition logic always@(*) begin case(state) A: begin if(in==0) next_state = A; else next_state = B; end B: begin if(in==0) next_state = C; else next_state = B; end C: begin if(in==0) next_state = A; else next_state = D; end D: begin if(in==0) next_state = C; else next_state = B; end endcase end // State flip-flops with asynchronous reset always@(posedge clk or posedge areset) begin if(areset) state = A; else state = next_state; end // Output logic assign out = (state == D);endmodule
-
Simple FSM3 sy
module top_module(
input clk,
input in,
input reset,
output out); //parameter A=2'd0; parameter B=2'd1; parameter C=2'd2; parameter D=2'd3; reg[1:0] state; reg[1:0] next_state; // State transition logic always@(*) begin case(state) A: begin if(in==0) next_state = A; else next_state = B; end B: begin if(in==0) next_state = C; else next_state = B; end C: begin if(in==0) next_state = A; else next_state = D; end D: begin if(in==0) next_state = C; else next_state = B; end endcase end // State flip-flops with asynchronous reset always@(posedge clk ) begin if(reset) state = A; else state = next_state; end // Output logic assign out = (state == D);endmodule
Circuits--Sequential--Finite4
且听风吟5672024-04-27 16:35
相关推荐
Szime26 分钟前
国产高速ADC推荐与选型观察:从进口依赖到国产替代评估,深智微科技提供项目导入支持Cloud_Shy6182 小时前
解读《Effective Python 3rd Edition》:从练气到老魔(第五章 Item 33 - 35)做cv的小昊2 小时前
计算机图形学:【Games101】学习笔记08——光线追踪(辐射度量学、渲染方程与全局光照、蒙特卡洛积分与路径追踪)星恒随风2 小时前
C++ 类和对象入门(五):初始化列表、explicit 和 static 成员详解伊布拉西莫6 小时前
【流畅的Python】第20章:并发执行器 — 学习笔记AOwhisky8 小时前
学习自测与解析:MySQL第五、六、七期核心知识点详解niuniuyi~8 小时前
QT学习笔记咸甜适中8 小时前
rust语言学习笔记Trait(十六)Error(错误)xuhaoyu_cpp_java9 小时前
项目学习(三)代码生成器my_daling9 小时前
松下伺服驱动器参数保存流程(已在松下A5上验证)