⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bin2gry.v

📁 verilog 代码. 经验证成功,可以作为标准单元库,为FPGA设计者使用.
💻 V
字号:
module binarytogray (clk, reset, binary_input, gray_output);
input 		clk, reset;
input	[3:0]	binary_input;
output 		gray_output;
reg		[3:0] 	gray_output;

always @ (posedge clk or posedge reset)
	if (reset)
	begin
		gray_output	<=	4'b0;
	end

	else begin
	gray_output[3] <=	binary_input[3];
	gray_output[2] <=	binary_input[3] ^ binary_input[2];
	gray_output[1] <=	binary_input[2] ^ binary_input[1];
	gray_output[0] <=	binary_input[1] ^ binary_input[0];	

	end
	endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -