verilog/cpu/alu.v

13 lines
163 B
Coq
Raw Normal View History

2017-02-08 08:09:28 -06:00
module alu(a,b,op,r);
input [3:0] a,b;
input op;
output [3:0] r;
wire a,b,op;
reg r;
always @(*)
if (op==0) begin
r=a+b;
end else begin
r=a-b;
end
2017-02-19 06:50:41 -06:00
endmodule