当前位置:网站首页>FPGA中的D触发器
FPGA中的D触发器
2022-04-22 20:15:00 【jk_101】
四种基本触发器
基本D触发器
module DFF(D,Q,CLK);
input D,CLK;
output Q;
always @(posedge CLK)
begin
Q <= D;
end
endmodule
带异步清0、异步置1的D触发器
module DFF1(q,qn,d,clk,set,reset);
input d,clk,set,reset;
output reg q,qn;
always @(posedge clk or negedge set or negedge reset)
begin
if(!reset) // 异步清0,低电平有效
begin
q <= 0;
qn <= 1;
end
else if(!set) //异步置1,低电平有效
begin
q <=1;
qn <= 0;
end
else
begin
q <= d;
qn <= ~d;
end
end
endmodule
带同步清0;同步置1的D触发器
module DFF2(q,qn,d,clk,set,reset);
input d,clk,set,reset;
output reg q,qn;
always @(posedge clk)
begin
if(reset) // 异步清0,高电平有效
begin
q <= 0;
qn <= 1;
end
else if(set) //异步置1,高电平有效
begin
q <=1;
qn <= 0;
end
else
begin
q <= d;
qn <= ~d;
end
end
endmodule
带异步清0、异步置1的JK触发器
module JK_FF(CLK,J,K,Q,RS,SET);
input CLK,J,K,SET,RS;
output Q;
reg Q;
always @(posedge CLK or negedge RS or negedge SET)
begin
if(!RS)
begin
Q <= 0;
end
else if(!SET)
begin
Q <= 1;
end
else
begin
case({J,K})
2'b00: Q<=Q;
2'b01: Q<= 0;
2'b10: Q<= 1;
2'b11: Q<= x;
endcase
end
end
endmodule
版权声明
本文为[jk_101]所创,转载请带上原文链接,感谢
https://blog.csdn.net/jk_101/article/details/112188785
边栏推荐
- Podcasts about the universe
- 第二章 数组
- Self built CA center to issue certificates for different applications of the company
- Redis cluster 6.2.6
- 做运营好,还是做软件测试好?
- Timestamp conversion
- How to break the midlife crisis? Internet people look at it
- The new pytorch library by the author of "lottery hypothesis" is popular
- day29
- Conditions for judging whether plastic deformation occurs: Von Mises yield criterion
猜你喜欢

新一代代理利器 - traefik

Household intelligent projector is the first choice, entering the polar meter h3s projection

Linux下安装Mysql 8.0 + eclipse配置详细教程

Activity Result API 使用与源码分析

The WiFi next door, I break every second

金仓数据库KingbaseES的连接方法

Android面试题之屏幕适配+AIDL篇

What kind of headphones do you wear for sports? The best equipment for running and listening to music

判断是否发生塑性变形的条件:von Mises屈服准则

Connection method of Jincang database kingbasees
随机推荐
redis如何使用命令清空所有key
Why do I suggest you work in a technical position instead of a clerical position, sales
常类型的使用 常成员函数(设计一个日期类和时间)
Format for creating Zimbra LDAP users using LDAP clients
What is browser homology policy?
2022-01-12 wechat applet debugging
金仓数据库KingbaseES之null和“ ”的区别
Selenium automatic pop-up processing
微日记:那些看起来并不起眼的细节体验
dbus客户端使用指南
时间戳转换
金仓数据库KingbaseES的安全特性
Design of high performance and high availability architecture for microservices
播客丨元宇宙那些事儿
Redis cluster 6.2.6
[untitled] leetcode 396 rotation function [finding laws in mathematics] the way of leetcode in heroding
Acrobat Pro DC tutorial, how to use password to protect PDF files?
解决金仓数据库KingbaseES无法打开锁文件的问题
The WiFi next door, I break every second
Biography: Ali Dharma Institute layoffs 30%! Internal staff: rumors! Netizen: why not cut 29.99%...