OpenFPGA/vpr7_x2p/vpr/VerilogNetlists/adder.v

20 lines
487 B
Coq
Raw Normal View History

2019-04-26 13:23:47 -05:00
//------ Module: sram6T_blwl -----//
//------ Verilog file: sram.v -----//
//------ Author: Xifan TANG -----//
module adder(
input [0:0] a, // Input a
input [0:0] b, // Input b
input [0:0] cin, // Input cin
output [0:0] cout, // Output carry
output [0:0] sumout // Output sum
);
2019-05-10 15:07:32 -05:00
//wire[1:0] int_calc;
2019-04-26 13:23:47 -05:00
2019-05-10 15:07:32 -05:00
//assign int_calc = a + b + cin;
//assign cout = int_calc[1];
//assign sumout = int_calc[0];
assign sumout = a ^ b ^ cin;
assign cout = (a & b) | (a & cin) | (b & cin);
2019-04-26 13:23:47 -05:00
endmodule