题解 | #根据RTL图编写Verilog程序#

根据RTL图编写Verilog程序

https://www.nowcoder.com/practice/41a06522d8b242808c31a152bf948b5e

`timescale 1ns/1ns

module RTL(
	input clk,
	input rst_n,
	input data_in,
	output reg data_out
	);
reg data,temp;

always @(posedge clk or negedge rst_n)
begin
if (!rst_n)
begin
data<=1'b0;
end
else
begin
data<=data_in;
end
end

always@(*)
begin
temp=data_in&~data;
end

always @(posedge clk or negedge rst_n)
begin
if (!rst_n)
begin
data_out<=1'b0;
end
else
begin
data_out<=temp;
end
end
endmodule

全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 16:22
主包是26应届生,投大厂简历一直过不了初筛,想问问大家有必要花钱改简历吗
Java抽象带篮子:我之前专门发个帖子说不要付费改简历的,里面还详细写了简历怎么写,你可以去看看
点赞 评论 收藏
分享
06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
大飞的诡术妖姬:之前看b站多明海有个说法,日本就业竞争非常低的原因不光是毕业学生少,还有很多人干两年不喜欢职场氛围就辞职躺平,位置也空了很多,论吃苦耐劳还得看咱们
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务