当前位置:网站首页>序列检测器
序列检测器
2022-06-29 17:12:00 【长水曰天】
此处用“11010”序列检测器来举例。
序列检测器就是将一个指定的序列从数字码流中检测出来,当输入端出现序列11010时,输出为1,否则输出为0。在此不考虑重复序列,即出现指定序列后就重新开始序列检测,不再考虑以前的数据。
该序列检测器的状态转移图如下图所示:

代码如下:
module seqdet(D_out, D_in, rst_n, clk);
parameter IDLE = 3'b0, A = 3'b1, B = 3'b2, C = 3'b3, D = 3'b4, E = 3'b5;
output D_out;
input D_in, rst_n, clk;
reg[2:0]state, next_state;
wire D_out;
assign D_out = (state == E)?1:0;
[email protected](state or D_in)
case(state)
IDLE:if(D_in)
next_state = A;
else
next_state = IDLE;
A:if(D_in)
next_state = B;
else
next_state = IDLE;
B:if(D_in)
next_state = B;
else
next_state = C;
C:if(D_in)
next_state = D;
else
next_state = IDLE;
D:if(D_in)
next_state = B;
else
next_state = E;
E:if(D_in)
next_state = IDLE;
else
next_state = A;
default: next_state = IDLE;
endcase
[email protected](posedge clk)
state <= next_state;
endmodule
可以看到,当到达E状态时,11010序列检测完成,同时D_out输出1。接下来若检测到1则转到A状态继续进行下一个序列的检测,若检测到0则返回IDLE状态等待。
边栏推荐
猜你喜欢

Review of mathematical knowledge: curve integral of type I

ICML 2022 | 基于解耦梯度优化的可迁移模仿学习方法

微信小程序开发储备知识

机器学习7-支持向量机

I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it

元代理模型可迁移对抗攻击

mysql数据库扫盲,你真的知道什么是数据库嘛

Redis 原理 - Sorted Set (ZSet)

Shenzhen internal promotion | Shenzhen Institute of computing science recruits assistant machine learning Engineer (school recruitment)

Why is informatization ≠ digitalization? Finally someone made it clear
随机推荐
Issue 42: is it necessary for MySQL to have multiple column partitions
垃圾收集器
Possible reasons for not triggering onreachbutton
What are the project management systems suitable for small and medium-sized enterprises?
High landing pressure of "authorization and consent"? Privacy computing provides a possible compliance "technical solution"
Naacl 2022 | distillation of machinetranslation SOTA model
Pancakeswap Technology: development principle of gripper robot system
Solid state storage manufacturer Yilian joins dragon dragon community to build a new open source ecosystem
关于KALI使用xshell连接
Real test = "half product + Half development"?
Gradle下载慢或无法下载
PancakeSwap技术:夹子机器人系统开发原理
如何创建虚拟形象
“授权同意”落地压力大?隐私计算提供一种可能的合规“技术解”
解题元宇宙,网络游戏中的多元通信方案
Advanced webgl performance optimization
Information | Zuckerberg was rated as the most careless CEO in the global IT industry; China Mobile R & D tethered UAV emergency communication high altitude base station
深度剖析monai(一) Data和Transforms部分
自学结构体(小甲鱼c语言)
6.25atcoderabc257e - addition and multiplication 2