惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
博客园_首页
博客园 - 【当耐特】
量子位
S
SegmentFault 最新的问题
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
博客园 - 聂微东
The Cloudflare Blog
小众软件
小众软件
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
H
Help Net Security
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享

博客园 - yf.x

超声波测距#倒车雷达#DE10-Lite 按键计数器#DE10-Lite 按键消抖#DE10-Lite 流水呼吸灯v2#DE10-Lite 流水呼吸灯-v1#DE10-Lite 呼吸灯-#DE10-Lite 流水灯#DE10-Lite#Verilog HDLBits_review 2015fsm 补码FSM-HDLbits 串行数据流输出其中的数据位-HDLbits 串行数据接收判断-HDLbits 输出PS2数据流-HDLbits PS2数据流检测状态机-HDLbits 旅鼠4-HDLbits 旅鼠游戏3-HDLbits 旅鼠游戏2-HDLbits 旅鼠游戏--HDLbits 水库水位控制问题-HDLbits 康威生命游戏-hdlbits
独热码状态机-HDLbits
yf.x · 2025-12-17 · via 博客园 - yf.x

要求用等式实现,独热码编码。

image

module top_module(
input in,
input [9:0] state,
output [9:0] next_state,
output out1,
output out2);

assign next_state[0]=~in&(state[0]|state[1]|state[2]|state[3]|state[4]|state[7]|state[8]|state[9]);
assign next_state[1]=in&(state[0]|state[8]|state[9]);
assign next_state[2]=in&state[1];
assign next_state[3]=in&state[2];
assign next_state[4]=in&state[3];
assign next_state[5]=in&state[4];
assign next_state[6]=in&state[5];
assign next_state[7]=in&(state[6]|state[7]);
assign next_state[8]=~in&state[5];
assign next_state[9]=~in&state[6];

assign out1=state[8]|| state[9];
assign out2=state[7] || state[9];

endmodule