news 2026/8/6 23:17:27

verilog HDLBits刷题[Building Larger Circuits]“Exams/review2015 fsmshi”---FSM :Enable shift register

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
verilog HDLBits刷题[Building Larger Circuits]“Exams/review2015 fsmshi”---FSM :Enable shift register

1、题目

This is the third component in a series of five exercises that builds a complex counter out of several smaller circuits. See the final exercise for the overall design.

As part of the FSM for controlling the shift register, we want the ability to enable the shift register for exactly 4 clock cycles whenever the proper bit pattern is detected. We handle sequence detection in Exams/review2015_fsmseq, so this portion of the FSM only handles enabling the shift register for 4 cycles.

Whenever the FSM is reset, assert shift_ena for 4 cycles, then 0 forever (until reset).

2、分析

说实话,我不太理解这个题目,觉得题目和所给的时序对不上,根据题目“Whenever the FSM is reset, assert shift_ena for 4 cycles, then 0 forever (until reset).”,我会以为是复位开始的四个周期为高,看了网上其它答案,才发现原来是:复位有效,使能shift_ena为高,复位无效后,使能shift_ena为高四个时钟周期,之后如果复位还是无效,那么shift_ena将保持为0

3、代码

module top_module ( input clk, input reset, output reg shift_ena ); reg [1:0] cnt; always @(posedge clk) begin if(reset) begin cnt <= 2'b00; shift_ena <= 1'b1; end else if(cnt == 2'd3) begin shift_ena <= 1'b0; cnt <= cnt; end else begin shift_ena <= 1'b1; cnt <= cnt + 1'b1; end end endmodule
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/8/6 23:16:23

scene-editor:基于vis-three框架的Web 3D场景编辑器架构深度解析

scene-editor&#xff1a;基于vis-three框架的Web 3D场景编辑器架构深度解析 【免费下载链接】scene-editor vis-three框架衍生出的全自定义web3D场景编辑器 项目地址: https://gitcode.com/GitHub_Trending/sc/scene-editor scene-editor是基于vis-three框架开发的全自…

作者头像 李华
网站建设 2026/8/6 23:15:58

从2D图像到3D人体网格:HybrIK混合逆运动学算法终极指南

从2D图像到3D人体网格&#xff1a;HybrIK混合逆运动学算法终极指南 【免费下载链接】HybrIK Official code of "HybrIK: A Hybrid Analytical-Neural Inverse Kinematics Solution for 3D Human Pose and Shape Estimation", CVPR 2021 项目地址: https://gitcode.…

作者头像 李华
网站建设 2026/8/6 23:15:35

掌握AI学习捷径:Python机器学习完整知识体系指南 [特殊字符]

掌握AI学习捷径&#xff1a;Python机器学习完整知识体系指南 &#x1f680; 【免费下载链接】AiPy Python机器学习、深度学习算法开发等学习资源分享 项目地址: https://gitcode.com/gh_mirrors/ai/AiPy 你是否曾为机器学习知识体系庞杂而感到迷茫&#xff1f;是否在寻找…

作者头像 李华
网站建设 2026/8/6 23:15:34

AMAT 0100-01321 数字输入 / 输出板

AMAT 0100-01321 数字输入/输出板是应用材料半导体设备专用的I/O接口板卡&#xff0c;以下为其核心特点与应用领域概述。产品特点 属于AMAT设备的标准OEM部件。 基于VME总线架构设计。 集成多个数字输入/输出通道。 采用光电隔离技术&#xff0c;抗干扰能力强。 支持板载故障诊…

作者头像 李华
网站建设 2026/8/6 23:14:05

免费开源针织设计工具:从创意到成品的完整数字化编织方案

免费开源针织设计工具&#xff1a;从创意到成品的完整数字化编织方案 【免费下载链接】kniteditor Kniteditor 项目地址: https://gitcode.com/gh_mirrors/kn/kniteditor 你是否曾经在纸上手绘复杂的针织图案&#xff0c;却发现修改一处错误就需要重头再来&#xff1f;或…

作者头像 李华