当前位置:网站首页>[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 .....
边栏推荐
- 整理网上蛋糕商城项目
- Based on the order flow tool, what can we see?
- Study on modified triphosphate: lumiprobe amino-11-ddutp
- Realizing color detection with OpenCV
- Understanding the source of innovation II
- Unity delegate
- Biovendor sRAGE antibody solution
- A guide to P2P network penetration (stun) for metartc5.0 programming
- Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid
- Binary sort tree: BST
猜你喜欢

二级造价工程师考试还没完?还有资格审核规定!

羧酸研究:Lumiprobe 磺基花青7二羧酸

MySQL export database dictionary to excel file

Reactive dye research: lumiprobe af594 NHS ester, 5-isomer

Analysis of distributed transaction solution Seata golang

Based on the order flow tool, what can we see?

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

Docker安装Mysql5.7并开启binlog

Sqlmap tool user manual

Gorm transaction experience
随机推荐
Severe tire damage: the first rock band in the world to broadcast live on the Internet
IP datagram sending and forwarding process
MySQL export query results to excel file
IP数据报的发送和转发过程
Study on chemical properties and technology of biovendor rage ELISA Kit
Unity delegate
Store inventory management system source code
[microservices openfeign] openfeign quick start service invocation based on feign
基于微信小程序的婚纱影楼门户小程序
The short video local life section has become popular. How to grasp the new opportunities?
DPDK 源码测试时性能下降问题
Operation of simulated examination platform of G3 boiler water treatment recurrent training question bank in 2022
Function reentry caused by Keil C51's data overlaying mechanism
Have you finished the examination of level II cost engineer? There are also qualification regulations!
Cgo+gsoap+onvif learning summary: 8. Summary of arm platform cross compilation operation and common problems
[leetcode] 12. Integer to Roman numeral
gsap的简单用法
The latest examination questions and answers for the eight members (standard members) of Liaoning architecture in 2022
Interview: what are the similarities and differences between abstract classes and interfaces?
2022烟花爆竹经营单位安全管理人员特种作业证考试题库及模拟考试