当前位置:网站首页>[Verilog quick start of Niuke network question brushing series] ~ priority encoder circuit ①
[Verilog quick start of Niuke network question brushing series] ~ priority encoder circuit ①
2022-07-01 17:03:00 【AI is very good】
0. Preface
The previous ten questions are Verilog Basic grammar of , I think we must master , But in the second part, these questions of combinatorial logic are suddenly a little disgusting , So I chose to do this question , What kind of questions can I do ?
I will share the questions that involve important knowledge points .
0.1 Knowledge point
0.1.1 About case、casex、casez The difference between
Let's look at it first case、casex、casez Corresponding truth table 
0.1.2 explain :
stay case In the sentence , The comparison between sensitive expressions and values is a congruent comparison , Only when everyone is the same will it be considered a match .
stay casez In the sentence , If the value of some bits of the branch expression is high impedance z, Then the comparison of these bits will be ignored , Don't consider , And only focus on the comparison results of other bits .
stay casex In the sentence , Then this processing method is further extended to x To deal with , That is, if the value of some bits of one side of the comparison is z or x, Then the comparison of these bits will not be considered .
0.1.3 matters needing attention
- Commonly used is casez sentence , Better use less casex
- case/casez/casex In fact, they are all integrable
- In the circuit , It can be used ? To represent irrelevant values z
- case Description of , Matching is done from top to bottom
1. VL13 Priority encoder circuit ①
1.1 Title Description
The following table is the truth table of a priority encoder .
① Please use Verilog Implement this priority encoder 
1.1.1 Signal schematic diagram
nothing
1.1.2 Waveform diagram
nothing
1.1.3 Input description
input [8:0] I_n
1.1.4 Output description
output reg [3:0] Y_n
1.2 Their thinking
The truth table given by the title , Write out the corresponding input and output in turn ( Pay attention to high and low position ).
1.3 Code implementation
`timescale 1ns/1ns
module encoder_0(
input [8:0] I_n ,
output reg [3:0] Y_n
);
always @(*)begin
casez(I_n)
9'b111111111 : Y_n = 4'b1111;
9'b0zzzzzzzz : Y_n = 4'b0110;
9'b10zzzzzzz : Y_n = 4'b0111;
9'b110zzzzzz : Y_n = 4'b1000;
9'b1110zzzzz : Y_n = 4'b1001;
9'b11110zzzz : Y_n = 4'b1010;
9'b111110zzz : Y_n = 4'b1011;
9'b1111110zz : Y_n = 4'b1100;
9'b11111110z : Y_n = 4'b1101;
9'b111111110 : Y_n = 4'b1110;
default : Y_n = 4'b1111;
endcase
end
endmodule
1.4 The test file
To be changed ...
1.5 Simulation waveform
To be changed ...
Statement
All my series of articles , Just for learning , Not for commercial use , If there is any infringement , Please inform , To delete !!!
I mainly record the learning process , For myself to review , Then it is to provide reference for future generations , No joy, no spray. !!!
If it's useful to you , Remember to collect + Comment on !!!
边栏推荐
- [wrung Ba wrung Ba is 20] [essay] why should I learn this in college?
- Activity的生命周期和启动模式详解
- 想做软件测试的女孩子看这里
- libcurl下载文件的代码示例
- Leetcode records - sort -215, 347, 451, 75
- Basic usage of Frida
- Vulnhub range hacksudo Thor
- 求求你们,别再刷 Star 了!这跟“爱国”没关系!
- PETRv2:一个多摄像头图像3D感知的统一框架
- AI college entrance examination volunteer filling: the gods of Dachang fight, and candidates pay to watch
猜你喜欢

Redis 分布式锁
![[mathematical modeling] [matlab] implementation of two-dimensional rectangular packing code](/img/de/1f572c62a0d034da9a8acb5c2f9602.jpg)
[mathematical modeling] [matlab] implementation of two-dimensional rectangular packing code

Gold, silver and four want to change jobs, so we should seize the time to make up

如何使用 etcd 实现分布式 /etc 目录

Oom caused by improper use of multithreading

Iommu/smmuv3 code analysis (10) page table operation

String class

剑指 Offer 20. 表示数值的字符串

Flux d'entrées / sorties et opérations de fichiers en langage C

SQL question brushing 627 Change gender
随机推荐
字节跳动数据平台技术揭秘:基于 ClickHouse 的复杂查询实现与优化
SystemVerilog structure (II)
Encryption and decryption of tinyurl in leetcode
Activity的生命周期和启动模式详解
[flask introduction series] cookies and session
英特尔开源深度学习工具库 OpenVINO,将加大与本土软硬件方合作,持续开放
Template Engine Velocity Foundation
Leetcode 216 combined summation III -- backtracking method
String类
Today, at 14:00, 15 ICLR speakers from Hong Kong University, Beihang, Yale, Tsinghua University, Canada, etc. continue!
Chinese diosgenin market forecast and investment strategy report (2022 Edition)
[mathematical modeling] [matlab] implementation of two-dimensional rectangular packing code
存在安全隐患 起亚召回部分K3新能源
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
如何使用 etcd 实现分布式 /etc 目录
C語言輸入/輸出流和文件操作
Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
What is the effect of choosing game shield safely in the game industry?
Yyds dry inventory MySQL RC transaction isolation level implementation
China sorbitol Market Forecast and investment strategy report (2022 Edition)