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

`timescale 1ns/1ns

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

reg q1;

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

always @(posedge clk or negedge rst_n) begin
       if (~rst_n) begin
			data_out <= 1'b0;
	   end else begin
			data_out <= data_in & ~q1;
	   end
end
endmodule

全部评论

相关推荐

头顶尖尖的程序员:我是26届的不太懂,25届不应该是找的正式工作吗?为什么还在找实习?大四还实习的话是为了能转正的的岗位吗
点赞 评论 收藏
分享
06-20 17:42
东华大学 Java
凉风落木楚山秋:要是在2015,你这简历还可以月入十万,可惜现在是2025,已经跟不上版本了
我的简历长这样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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