当前位置:网站首页>Verilog daily question (vl24 multi bit MUX synchronizer cross time domain output)
Verilog daily question (vl24 multi bit MUX synchronizer cross time domain output)
2022-07-28 17:22:00 【Don't make any more errors】
Title Description
stay data_en For the high period ,data_in Will remain unchanged ,data_en Keep at least 3 individual B Clock cycle . indicate , When data_en For the high time , Data can be synchronized .
In this question data_in The frequency of data change at the end is very low , The change between two adjacent data , At least at intervals 10 individual B Clock cycle .
The interface of the circuit is shown in the figure below . The port description is shown in the table below .


Problem solving :
The general idea of this question is to A Clock domain input signal , Synchronize to B Time domain , With B The rising edge of the clock comes and outputs . The idea here is to A The clock sets a valid signal data_en, When data_en When it is valid for three cycles ,data_out Read data_in Value , Realize an output across the clock domain .
Rounding out the following :
module mux(
input clk_a ,
input clk_b ,
input arstn ,
input brstn ,
input [3:0] data_in ,
input data_en ,
output reg [3:0] dataout
);
integer i; // Define a parameter to shoot
always @(posedge clk_b or negedge brstn) begin
if(!arstn) dataout <= 0;
else if(i>=4) dataout <= data_in;
else dataout <= dataout; // When data_en Low power level ,dataout remain unchanged , Instead of zeroing ( I made a mistake at first )
end
always @(posedge clk_a or negedge arstn)begin
if(!brstn) i<=0;
else if(data_en) i <= i+1; // Three a After the cycle ,i=4, Need full 3 A cycle ;
else i <= 0; // Low level i Zeroing , Wait for re counting
end
endmoduleThe idea here is to declare a parameter i Come and shoot , Looking at others' answers , It's interesting to see a method, which is worth learning :
...
else if(data_en)
data_a <= {data_a[11:0],data_in}; // Shooting , Using shift register
...
dataout <= data_a[15:12];
// Highest output 4 position , That is, it can be output only after three beats , And when en Low power level , No displacement
// To enter a new value, you need to shift it three times , It meets the requirements of the topic very well
...The end!
边栏推荐
- Role of Fortress machine
- influxdb2的使用
- 如何在构建阶段保护镜像安全
- The actual combat of the beego framework of goweb development: Section III program execution process analysis
- QR code generation of wechat applet with parameters
- Steps to configure V530 switch
- Codeforces round 770 (Div. 2) e. fair share
- 火了 2 年的服务网格究竟给微服务带来了什么?(转载)
- Unity shader screen post-processing
- Ugui learning notes (III) summary of the use of each control
猜你喜欢

总数据量超万亿行,玉溪卷烟厂通过正确选择时序数据库轻松应对

Verilog 每日一题(VL26 简易秒表)

Goweb开发之Beego框架实战:第四节 数据库配置及连接

UNIQUE VISION Programming Contest 2022(AtCoder Beginner Contest 248)G. GCD cost on the tree

Goweb开发之Beego框架实战:第四节 数据库配置及连接

Verilog 每日一题 (VL30 RAM的简单实现)

微服务架构-服务注册中心和服务网关(6.8) (转载)

带参数的微信小程序二维码生成

Vscode界面介绍

System clock failure of database fault tolerance
随机推荐
Unity shader procedural texture
Verilog 每日一题(VL14 自动贩售机1--FSM常见题型)
火了 2 年的服务网格究竟给微服务带来了什么?(转载)
Introduction to vscade interface
The practice of beego framework in goweb development: Section I Introduction to beego framework
Andthen of function interface
Goweb开发之Beego框架实战:第一节 Beego框架介绍
2022 Niuke multi school second CDE
How to protect image security during construction
Goweb开发之Beego框架实战:第三节 程序执行流程分析
Ugui learning notes (II) Scrollview related
飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用
充分利用----英文
Verilog 每日一题 (VL30 RAM的简单实现)
Verilog 每日一题 (VL24 多bit MUX同步器 跨时域输出)
GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification
Unity shader depth of field effect
Re10: are we really making much progress? Revisiting, benchmarking, and refining heterogeneous gr
Goweb开发之Iris框架实战:项目总结与回顾
配置V530交换机步骤