9086/cpu/alu.v

10 lines
206 B
Verilog

module ADDER16(input [15:0]A,input [15:0]B, input oe,output [15:0]OUT, output carry);
wire c;
wire [15:0]sum;
assign {c,sum} = A+B;
assign OUT = !oe ? sum : 16'hz;
assign carry = !oe ? c : 'hz;
endmodule