题解 | #序列发生器#

序列发生器

https://www.nowcoder.com/practice/1fe78a981bd640edb35b91d467341061

`timescale 1ns/1ns

module sequence_generator(
	input clk,
	input rst_n,
	output reg data
	);
	reg [5:0] ref;
	always @ (posedge clk or negedge rst_n)
		if (!rst_n)
			ref <= 6'b001011;
		else
			ref <= {ref[4:0],ref[5]};
	always @ (posedge clk or negedge rst_n)
		if (!rst_n)
			data <= 0;
		else
			data <= ref[5];
						
endmodule

全部评论

相关推荐

求问!考研下岸,打算参加春招,我这个bg能进啥厂,或者需要搞点深度项目再投吗
Java抽象带篮子_...:直接海投,可以看看我的考研失利速成冲春招贴,里面详细写了简历怎么写,学哪些项目可以速成
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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