当前位置:网站首页>Verilog 每日一题(VL2 异步复位的串联T触发器--牛客网)
Verilog 每日一题(VL2 异步复位的串联T触发器--牛客网)
2022-07-28 16:23:00 【别再出error了】
题目:实现两个串联异步复位的T触发器,具体结构及波形图如下:

这一题比较简单,只要知道了T触发器的特性就比较好解答了。即:输入为1时值翻转(0变成1\1变成0),输入为0时不变。
两个串联设置成两个always块就可以,代码如下
`timescale 1ns/1ns
module Tff_2 (
input wire data, clk, rst,
output reg q
);
//*************code***********//
reg data1;
always @(posedge clk,negedge rst)begin
if(!rst) data1<=0;
else if(data) data1<=~data1;
else data1<=data1;
end
always @(posedge clk,negedge rst)begin
if(!rst) q<=0;
else if(data1) q<=~q;
else q<=q;
end
//*************code***********//
endmodule顺便复习一下T触发器细节上的结构及特性:
逻辑功能:控制信号T=1时,翻转;T=0时,保持。特性表及特性方程如下:
特性表

特性方程:

而它的逻辑符号图形如下:

事实上,JK触发器的两个输入端连在一起作为T端就可以构成T触发器。

边栏推荐
- 数据库故障容错之系统时钟故障
- 充分利用----英文
- WPF command button transparent style
- 飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用
- Pytorch Foundation: similarities and differences between torch.mul, torch.mm and torch.matmul
- Jupyter notebook win installation record
- 利用SQL Server代理作业对数据库进行定时还原
- How to protect image security during construction
- Shopee code League 2022 - qualification round p3.connecting the numbers (segment tree / bipartite graph determination, to be discussed)
- 异步电路设计--同步脉冲器原理及例题
猜你喜欢

Application of Pegasus d200s UAV and airborne lidar in large-scale DEM construction

零基础利用Unity3D开发AR应用并远程下载3D模型

HTAP comes at a price

Re11: read EPM legal judgment prediction via event extraction with constraints

How to protect image security during construction

Verilog 每日一题(VL14 自动贩售机1--FSM常见题型)

Message Passing for Complex Question Answering over Knowledge Graphs

The practice of the beego framework for goweb development: Section V project construction and user registration

Unity3d shader achieves ablation effect

总数据量超万亿行,玉溪卷烟厂通过正确选择时序数据库轻松应对
随机推荐
在android开发过程中遇到.sqlite文件处理
The longest substring of sword finger offer without repeated characters
Easypoi --- excel file export
DGL Chapter 1 (official tutorial) personal notes
Ugui learning notes (II) Scrollview related
Unity shader realizes water wave effect with noise texture
Using MVC in the UI of unity
Code implementation additive attention
Algorithm learning: leetcode interview question 09. implement queue with two stacks
WPF command button transparent style
Use of influxdb2
Verilog 每日一题 (VL5 信号发生器)
Unity shader uses rendered texture to achieve glass effect
The 2021 ICPC ASIA Taipei Regional programming contest L. leadfoot (combinatorics /2-adic assignment function +kummer theorem)
微服务架构-服务注册中心和服务网关(6.8) (转载)
Ugui learning notes (IV) ugui event system overview and Usage Summary
Mysql database addition, deletion, modification and query (detailed explanation of basic operation commands)
How to use fail2ban to protect WordPress login page
Differences between CNSA and CASC and CASIC
2022 Niuke multi school second CDE