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

📄 alu.v

📁 《Verilog HDL 程序设计教程》2
💻 V
字号:
`define add 3'd0
`define minus 3'd1
`define band 3'd2
`define bor 3'd3
`define bnot 3'd4
module alu(out,opcode,a,b);
output[7:0] out;
reg[7:0] out;
input[2:0] opcode;
input[7:0] a,b;

always@(opcode or a or b)
begin
case(opcode)
`add: 	out = a+b;
`minus: out = a-b;
`band: 	out = a&b;
`bor: 	out = a|b;
`bnot: 	out=~a;
default: out=8'hx;
endcase
end
endmodule

⌨️ 快捷键说明

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