Circuits--Sequential--FSM--Q6b~Q2b

【verilog学习22】HDLBits:Circuits_Sequential Logic_Building Larger Circuits 当count=4’b1111(4‘hf)时,防止delay=count+1=4’b0000溢出,设delay比count多1bit位。done,counting,shift_ena做输出,有处于Wait状态,处于Count状态,处于shift_ena状态之意。只需要在reset=1时产生4cycle的shift_ena=1即可,当reset连续等于1,这个输出是可以周期重叠的。(reset在n个cycle=1,则shift_ena在(n-1)+4个cycle为1,而非4*n个)。 阅读详情

1. Q6b

module top_module (
    input [3:1] y,
    input w,
    output Y2);
	
    assign Y2 = ((y==3'b001|y==3'b101)&~w)|((y==3'b001|y==3'b100|y==3'b101|y==3'b010)&w);

2.Q6c

module top_module (
    input [6:1] y,
    input w,
    output Y2,
    output Y4);
    
    assign Y2 = (y[1]) & ~w;
    assign Y4 = (y[2]&w)|(y[3]&w)|(y[5]&w)|(y[6]&w);

endmodule

3.Q6

module top_module (
    input clk,
    input reset,     // synchronous reset
    input w,
    output z);
    
    parameter A = 3'd0;
    parameter B = 3'd1;
    parameter C = 3'd2;
    parameter D = 3'd3;
    parameter E = 3'd4;
    parameter F = 3'd5;
    
    reg[2:0] state;
    reg[2:0] next_state;
    
    always@(*)
        begin
            case(state)
                A:
                    begin
                        if(w) next_state = A;
                        else  next_state = B;
                    end
                 B:
                    begin
                        if(w) next_state = D;
                        else  next_state = C;
                    end
                 C:
                    begin
                        if(w) next_state = D;
                        else  next_state = E;
                    end
                 D:
                    begin
                        if(w) next_state = A;
                        else  next_state = F;
                    end
                 E:
                    begin
                        if(w) next_state = D;
                        else  next_state = E;
                    end
                 F:
                    begin
                        if(w) next_state = D;
                        else  next_state = C;
                    end
            endcase
        end
    
    always@(posedge clk)
        begin
            if(reset)
                state = A;
            else
                state = next_state;
        end
    
    assign z = (state == E | state == F);

endmodule

4.Q2a_1

module top_module (
    input clk,
    input reset,     // synchronous reset
    input w,
    output z);
    
    parameter A = 3'd0;
    parameter B = 3'd1;
    parameter C = 3'd2;
    parameter D = 3'd3;
    parameter E = 3'd4;
    parameter F = 3'd5;
    
    reg[2:0] state;
    reg[2:0] next_state;
    
    always@(*)
        begin
            case(state)
                A:
                    begin
                        if(w) next_state = B;
                        else  next_state = A;
                    end
                 B:
                    begin
                        if(w) next_state = C;
                        else  next_state = D;
                    end
                 C:
                    begin
                        if(w) next_state = E;
                        else  next_state = D;
                    end
                 D:
                    begin
                        if(w) next_state = F;
                        else  next_state = A;
                    end
                 E:
                    begin
                        if(w) next_state = E;
                        else  next_state = D;
                    end
                 F:
                    begin
                        if(w) next_state = C;
                        else  next_state = D;
                    end
            endcase
        end
    
    always@(posedge clk)
        begin
            if(reset)
                state = A;
            else
                state = next_state;
        end
    
    assign z = (state == E | state == F);

endmodule

5.Q2b_1

module top_module (
    input [5:0] y,
    input w,
    output Y1,
    output Y3
);
    
    assign Y1 = (y[0]&w);
    assign Y3 = (y[1]&~w)|(y[2]&~w)|(y[4]&~w)|(y[5]&~w);
    

endmodule

6.Q2a_2

module top_module (
    input clk,
    input resetn,    // active-low synchronous reset
    input [3:1] r,   // request
    output [3:1] g   // grant
); 
    
    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;
  
    
    always@(*)
        begin
            case(state)
                A:
                    begin
                        
                        if(r[1])
                            next_state = B;
                        else if(r[2])
                            next_state = C;
                        else if(r[3])
                            next_state = D;
                        else
                            next_state = A;
                    end
               B:       next_state = r[1] ? B : A;
               C:       next_state = r[2] ? C : A;
               D:       next_state = r[3] ? D : A;
                default: next_state = A;
            endcase
        end
    
    always@(posedge clk)
        begin
            if(~resetn)
                state <= A;
            else
                state <= next_state;
        end
    
    assign g[1] = (state == B);
    assign g[2] = (state == C);
    assign g[3] = (state == D);
endmodule

7. Q2b_2

module top_module (
    input clk,
    input resetn,    // active-low synchronous reset
    input x,
    input y,
    output f,
    output g
); 
    
    parameter[3:0] S = 4'd0; 
    parameter[3:0] F = 4'd01; 
    parameter[3:0] XA = 4'd2; 
    parameter[3:0] XB = 4'd3; 
    parameter[3:0] XC = 4'd4;
    parameter[3:0] X1 = 4'd5;
    parameter[3:0] YA = 4'd6; 
    parameter[3:0] YB1 = 4'd7; 
    parameter[3:0] YB2 = 4'd8; 
    parameter[3:0] YC = 4'd9; 
    
    reg[3:0] state;
    reg[3:0] next_state;
    
    always@(*)
        begin
            case(state)
                S:
                    next_state = F;
                F:
                    next_state = XA;
                XA:
                    begin
                        if(x) next_state = XB;
                        else  next_state = XA;
                    end
                XB:
                    begin
                        if(x) next_state = XB;
                        else  next_state = XC;
                    end
                XC:
                    begin
                        if(x) next_state = X1;
                        else  next_state = XA;
                    end
                X1:
                    next_state = YA;
               
                YA:
                    begin
                        if(y) next_state = YB1;
                        else  next_state = YB2;
                    end
                YB2:
                    begin
                        if(y) next_state = YB1;
                        else  next_state = YC;
                    end
            endcase
        end
    
    always@(posedge clk)
        begin
            if(~resetn)
                state <= S;
            else
                state <= next_state;
        end
    
    assign f = (state == F);
    assign g = (state == X1)|(state == YA)|(state == YB1);
    
   

endmodule

【信息科学与工程学】【安全领域】第三十五篇 网络安全算法表 编号算法名称算法的逐步骤思考推理的数学方程式和分解的数学方程式参数/变量列表复杂度(时间/空间)1​AES (高级加密标准)​1. 密钥扩展:从初始密钥生成轮密钥。 2. 初始轮: 3. 主轮循环(Nr-1轮):  - SubBytes:(非线性字节替换)  - ShiftRows:对状态矩阵的行进行循环移位。  - MixColumns:(在GF(2⁸)上的矩阵乘法)  - AddRoundKey: 4. 最终轮:执行SubBytes、ShiftRows、AddR 阅读详情

相关推荐

OpenBmc开发2:构建开发环境

编译环境VMware + ubuntu 18.04 编译环境构建:参考OpenBmc开发1:构建开发环境 1、打开一个Ternimal,进入openbmc目录下 2、查看有哪些不同的编译配置 find meta-* -name local.conf.sample 可以看到如下编译配置 3、生成编译配置 插入TEMPLATECONF,上边查询到的配置有很多,但是有一些...

master 2万+

Circuits--Sequential--FSM-Q3b~Q3c

【代码】Circuits--Sequential--FSM-Q3b~Q3c。

kamo 420

Pinocchio 安装教程|机器人学的必备库

安装pinocchio,不要安装pip3 install pinocchio!

darcsdn 1663

Circuits--Sequential--FSM--q5b~q3a

【代码】Circuits--Sequential--FSM--q5b~q3a。

kamo 254

dreamerv3复现教程

由于dreamerv3存在很多版本冲突问题,所以很难直接使用和复现。

无人机飞啊飞啊飞 2838

centos8 安装新版bind9源码

bind一直在更新,使用了比较多的新架构 本文记录新版本的bind怎么安装,以及其依赖库的安装 1. 在https://www.isc.org/download/ 下载最新stable版本bind,本文以bind-9.17.9.tar.xz为例。将软件传到/root目录下。 也可以到https://ftp.isc.org/isc/bind9/ 下载更多历史版本 2. 安装基本的依赖库,像gcc、amake等 3. 需要安装libuv库,但直接用yum时可能安装不全 建议使用源码安装,需要安..

linggang_123的博客 2540

【verilog学习23】HDLBits:Circuits_Sequential Logic_Finite State Machines

2.提交结果 SuccessThis is a Moore state machine with two states, one input, and one output. Implement this state machine. Notice that the reset state is B.This exercise is the same as fsm1s, but using asynchronous reset. 本题引导我们用了个三段式的。 一段式:在一个时序电路完成所有工作。 两段式:时

weixin_48052679的博客 3329

高项49个过程,输入、工具技术、输出的思维导图

为了制定项目章程的管理方法主要是采用了数据收集技术,例如通过头脑风暴,通过召集主题专家和团队成员收集信息、解决方案,并在短时间内获得大量创意,并对大量创意进行分析和排序,选出最优化最适合本项目方案,并对项目成员的不同差异观点,进行了引导和对冲突的管理,最终有助于项目干系人的目标、成功标准的内容达成一致意见,形成完善的项目章程。在本过程中得到项目章程,在制定项目章程中需要包括信息有:项目名称、项目目标、项目总里程碑进度表、项目经理、主要干系人及财务预算信息。本过程在仅开展一次,或仅在项目的预定义点开展。

Legend_Jiang的博客 6187

【自用向 刷题笔记/答案】HDLBITS: Circuits - Sequential Logic(不包括FSM

2、由于大多数的逻辑器件的目标库内的 DFF 都只有异步复位端口,所以,倘若采用同步复位的话,综合器就会在寄存器的数据输入端口插入组合逻辑,这样就会一方面额外增加FPGA内部的逻辑资源,另一方面也增加了相应的组合逻辑门时延。1、使用异步复位的最大好处就是复位路径上没有延时,如上面的图所示,复位信号一直连接到触发器的复位端口,而不是像同步复位那样需要经过一个复位控制逻辑(如与门),这样子就减少了外界信号的影响。低电平的复位信号到达触发器的复位端时,触发器进入复位状态,直到复位信号撤离。

weixin_46928582的博客 1078

【Bug已解决】openclaw max turns reached / Tool calls exceeded limit — OpenClaw 最大轮次超限解决方案

OpenClaw 在执行过程中达到最大轮次限制任务未完成,本质是 --max-turns 设置过小或任务过于复杂。文中给出增加轮次、--continue 继续、分步执行等完整方案。

一键难忘的博客 5505

Arcgis加载在线地图(内涵各种在线地图)

这三个在线地图是最常用的在线地图,其他几个类型的在线地图请自行查看。,加载出在线图层说明连接成功,点击。1、首先打开Arcgis,找到。

爱吃雪糕的小布丁的博客 1万+

HDLBits个人刷题详解合集15-Circuits-Sequential Logic-Finite State Machines2-HDBits题目分析

HDLBits个人刷题详解合集15-Circuits-Sequential Logic-Finite State Machines2-HDBits题目分析

weixin_49100631的博客 381

39、高频 LLC 谐振转换控制系统动态优化算法分析与研究

本文针对高频下LLC谐振转换器动态性能差的问题,提出一种基于谐振电容器充放电估计动态切换时间的优化控制算法。通过改进状态轨迹控制方法,突破传统算法在谐振频率与开关频率相等条件下的限制,并结合新型采样策略有效抑制电压过冲。算法在MATLAB和SABER中完成仿真验证,并搭建基于STM32F407的原型系统进行测试,结果表明该方法显著缩短动态响应时间,提升系统稳定性。研究为高频、高功率密度开关电源的动态优化提供了可行解决方案。

linux6sysadmin的博客 113

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q6: FSM

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q6: FSM。

学习笔记 151

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q2b: Another FSM

有报错, 没看出来错在哪。

学习笔记 159

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q6b: FSM next-state logic

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q6b: FSM next-state logic。

学习笔记 151

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q2a: FSM

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q2a: FSM。

学习笔记 126

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q2b: one-hot FSM equations

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q2b: one-hot FSM equations。

学习笔记 138

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q6c: FSM one-hot next-state logic

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q6c: FSM one-hot next-state logic。

学习笔记 150

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q3a:FSM

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q3a:FSM。

学习笔记 149

hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q8: Design a Mealy FSM

【代码】hdlbits.01xz.net /Circuits/Sequential Logic/Finite State Machines/Q8: Design a Mealy FSM。

学习笔记 153

FPGA时序约束从入门到入土:Input/Output Delay 与 Slack及避坑一文讲透

FPGA 时序约束就是这样一门"懂的人觉得简单,不懂的人怎么填都违例"的手艺。尤其是 DDR 接口—中心对齐还是边沿对齐?要不要移相?rise 和 fall 为什么必须分开设?数据手册里那个 tCO 到底对应公式里的哪一项?本文把系统同步、源同步、DDR 双边沿、PLL 移相​ 四种场景的 Input/Output Delay 和 Slack 公式一次性推导清楚,附带 数据手册参数提取方法​ 和 40+ 条避坑指南。不求你看完就能闭眼写约束,但至少下次时序违例的时候,你能一眼看出问题所在

xklee的博客 218

去马赛克算法FPGA实现

1.底层基本方法:Hamilton 方向性 G 插值 + 色差域 R/B 插值。2.在上述插值算法的基础上+色度去伪彩算法。二、逻辑资源使用情况。

dong6016的博客 267

LabVIEW 测滚珠丝杠:0.004 度分辨率

一根精密滚珠丝杠的步距误差,本质是螺母位移与丝杠转角之间的关系。这个测试台把转角测到 1/10 000 度、把直线位移测到 1/100 微米,后来换上 FPGA 卡,又靠编码器信号五倍插值,把测量触发的分辨率做到 0.004 度。 要表征一

bjcyck的博客 305

TMS320F28335 学习笔记(二):系统时钟、PLL 与看门狗

本文系统介绍F28335的时钟架构与看门狗应用,涵盖外部晶振、PLL倍频生成系统时钟(SYSCLKOUT)、高速/低速外设时钟分频配置,以及看门狗的启用、关闭与喂狗机制。强调时钟配置准确性对延时、PWM、通信等外设的重要性,指出常见错误如晶振不匹配、未等待PLL锁定、随意修改PLL或喂狗周期过长等问题,并提供初始化框架与验证方法,帮助开发者正确配置时钟系统,确保程序稳定运行。

2403_83044722的博客 386
上一篇: Writing testbench
下一篇: Circuits--Build large --FSM
且听风吟567
博客等级 码龄7年 231粉丝 77原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值