From e64c18d0e30c33fe4609c881620fa937da7b8ce3 Mon Sep 17 00:00:00 2001 From: Michael Abed Date: Sun, 2 Dec 2012 12:13:10 -0500 Subject: make git repo --- verilog/full_adder.v | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 verilog/full_adder.v (limited to 'verilog/full_adder.v') diff --git a/verilog/full_adder.v b/verilog/full_adder.v new file mode 100755 index 0000000..c669c6a --- /dev/null +++ b/verilog/full_adder.v @@ -0,0 +1,61 @@ +`timescale 1ns / 1ps +////////////////////////////////////////////////////////////////////////////////// +// Company: +// Engineer: +// +// Create Date: 12:24:15 10/04/2012 +// Design Name: +// Module Name: fa +// Project Name: +// Target Devices: +// Tool versions: +// Description: +// +// Dependencies: +// +// Revision: +// Revision 0.01 - File Created +// Additional Comments: +// +////////////////////////////////////////////////////////////////////////////////// +module fa( + output sum, + output cout, + input a, + input b, + input cin + ); + + +wire s1, s2, s3, s4; // sum wires +wire c1, c2, c3; // carry wires +wire ia, ib, ic; // inverted wires + +// invert wires ad needed for the sum +not n1(ia, a); +not n2(ib, b); +not n3(ic, cin); + +// SUM CALCULATION + +// compute relevant minterms +and a1(s1, ia, ib, cin); +and a2(s2, ia, b, ic); +and a3(s3, a, ib, ic); +and a4(s4, a, b, cin); + +// or minterm results +or o1(sum, s1, s2, s3, s4); + +// CARRY CALCULATION + +// compute minterms +and ca1(c1, a, b); +and ca2(c2, a, cin); +and ca3(c3, b, cin); + +// or results +or o2(cout, c1, c2, c3); + + +endmodule -- cgit v1.2.3