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

📄 mux_unit.v

📁 用verilog编写的4位ALU
💻 V
字号:
`timescale 1ns/10ps   module mux_unit(	mux_out,	//Output, output of the Unit, and is also the final output of ALU	logic_in,	//Input, 4-bit data input	arithmetic_in,//Input, 4-bit data input	m,	//Input, the selecting signal to select the desired output   	rst_n);     //Input, synchoronous reset signal, effect LOW //Parameter declarations:    parameter LOGIC = 1'b0;//    parameter ARITHMETIC = 1'b1;//	//IO signals declarations:	    output [3:0] mux_out;      input [3:0] logic_in;    input [3:0] arithmetic_in;    input m;    input rst_n;    reg [3:0] mux_out;      wire [3:0] logic_in;    wire [3:0] arithmetic_in;    wire m;    wire rst_n;////Internal signals declarations:    wire  output_sel;            assign output_sel=m;   	//Internal signal definition//************** Main Logic Functions *********************        always@(m or logic_in or arithmetic_in or rst_n)    if(rst_n==1'b0)    	mux_out <= 4'b0;    else    	case(output_sel)//Select the Logic Function according to signals s1 and s0;    	LOGIC://Select the Logic Unit output as the ALU ouput    		mux_out <= logic_in ;    	ARITHMETIC://Select the Arithmetic Unit output as the ALU ouput    		mux_out <= arithmetic_in;    	endcase     endmodule

⌨️ 快捷键说明

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