当前位置:网站首页>[Verilog quick start of Niuke online question brushing series] ~ one out of four multiplexer
[Verilog quick start of Niuke online question brushing series] ~ one out of four multiplexer
2022-06-28 05:14:00 【AI is very good】
0. Preface
Starting today , Decide to start a new board , That's for Niuke online Verilog Make a complete study of the topic , There are two purposes here , One is to record your learning process ; The second is to provide a reference for the students who study this aspect later , Try to update one article every day on average , Ha ha ha ! I hope we can keep going , Welcome criticism ( Like collection and follow )!!!
1. One out of four multiplexer
Fairy directions , Click the source address to send
1.1 Title Description
Make a one out of four multiplexer , The output is required to be defined as the wire network type .
1.1.1 State transition
d0 11
d1 10
d2 01
d3 00
1.1.2 Signal schematic diagram


1.1.3 Input description
Input signal d1,d2,d3,d4 sel
type wire
1.1.4 Output description
The output signal mux_out
type wire
1.2 Their thinking
First , Yes 5 Input signals , among sel Control which data output is , It's simple , You can see by looking at the waveform , Don't talk much , Go straight to the code !!!
1.3 Code implementation
`timescale 1ns/1ns
module mux4_1(
input [1:0]d1,d2,d3,d0,
input [1:0]sel,
output[1:0]mux_out
);
//*************code***********//
reg [1:0] mux_out_temp;
always @ (*) begin
case (sel)
2'b00 : mux_out_temp = d3;
2'b01 : mux_out_temp = d2;
2'b10 : mux_out_temp = d1;
2'b11 : mux_out_temp = d0;
default : mux_out_temp = d3;
endcase
end
assign mux_out = mux_out_temp;
//*************code***********//
endmodule
1.3.1 Code instructions
Q1: Why define a reg Type of 2 Bit variables ?
A: because always The assignment statement in the block must be reg Type ,wire Type is not allowed ,wire It's like a thread , and reg It is equivalent to a register .
========================================================================
Ongoing update .....
边栏推荐
- JS text box loses focus to modify width text and symbols
- 2022西式面点师(高级)考试试题模拟考试平台操作
- Learning Tai Chi Maker - mqtt Chapter II (VI) mqtt wills
- 整理网上蛋糕商城项目
- The short video local life section has become popular. How to grasp the new opportunities?
- RxSwift --(1)创建一个项目
- 2022新版nft源码中国元宇宙数字藏品艺术品交易平台源码
- Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid
- How to learn programmable logic controller (PLC)?
- Analysis of distributed transaction TCC
猜你喜欢

Lumiprobe细胞成像分析:PKH26 细胞膜标记试剂盒

Extjs library management system source code intelligent library management system source code

Excel将一行的内容进行复制时,列与列之间是用制表符“\t”进行分隔的
![[JVM series] JVM tuning](/img/e1/086f76ec6c9b56d97430b1e073f5a6.png)
[JVM series] JVM tuning

The latest examination questions and answers for the eight members (standard members) of Liaoning architecture in 2022

Redis 的 最新windows 版本 5.0.14

2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案

cgo+gSoap+onvif学习总结:8、arm平台交叉编译运行及常见问题总结

Dart learning - functions, classes

A guide to P2P network penetration (stun) for metartc5.0 programming
随机推荐
Unity out ref params
Analysis of distributed transaction solution Seata golang
如何从零设计一款牛逼的高并发架构(建议收藏)
证明素数/质数有无限多个
短视频本地生活版块成为热门,如何把握新的风口机遇?
109. simple chat room 12: realize client-side one-to-one chat
The latest examination questions and answers for the eight members (standard members) of Liaoning architecture in 2022
gorm事务体验
How high is the gold content of grade II cost engineer certificate? Just look at this
MySQL export query results to excel file
DH parameters of robotics and derivation using MATLAB symbolic operation
2022年最新辽宁建筑八大员(标准员)考试试题及答案
使用class toplevel的messagebox时,窗口弹出问题。
Organize the online cake mall project
Leetcode 88: merge two ordered arrays
Biovendor sRAGE antibody solution
Latest Windows version 5.0.14 of redis
禁用右击、键盘打开控制台事件
QCOM LCD调试
2022新版nft源码中国元宇宙数字藏品艺术品交易平台源码