Implementation-of-Full-Adder-and-Full-subtractor-circuit
AIM:
To design a Full Adder and Full Subtractor circuit and verify its truth table in Quartus using Verilog programming.
Equipments Required:
Hardware – PCs, Cyclone II , USB flasher
Software – Quartus prime
Full Adder and Full Subtractor
Full Adder
Full adder is a digital circuit used to calculate the sum of three binary bits. It consists of three inputs and two outputs. Two of the input variables, denoted by A and B, represent the two significant bits to be added. The third input, Cin, represents the carry from the previous lower significant position. Two outputs are necessary because the arithmetic sum of three binary digits ranges in value from 0 to 3, and binary 2 or 3 needs two digits. The two outputs are sum and carry.
Sum =A’B’Cin + A’BCin’ + ABCin + AB’Cin’ = A ⊕ B ⊕ Cin
Carry = AB + ACin + BCin
Figure -1 FULL ADDER
Full Subtractor
A full subtractor is a combinational circuit that performs subtraction involving three bits, namely minuend, subtrahend, and borrow-in . It accepts three inputs: minuend, subtrahend and a borrow bit and it produces two outputs: difference and borrow.
Diff = A ⊕ B ⊕ Bin
Borrow out = A'Bin + A'B + BBin
Truthtable FULL ADDER: FULL SUBTRACTOR:
Procedure Full Adder: https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip Quartus II and create a new project. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip schematic design entry to draw the full adder circuit. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip circuit consists of XOR, AND, and OR gates. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip the design, verify its functionality through simulation. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip the design on the target device and program it.
Full Subtractor: https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip the same steps as for the full adder. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip the full subtractor circuit using schematic design. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip circuit includes XOR, AND, OR gates to perform subtraction. https://github.com/MITHUN8521/FULL_ADDER_SUBTRACTOR/raw/refs/heads/main/simulation/FUL_ADDE_SUBTRACTOR_3.8.zip, simulate, implement, and program the design similarly to the full adder.
Program:
Developed by: MITHUN KUMAR S
RegisterNumber: 212223050029
## Full_adder
module fulladd_top(a,b,cin,sum,carry);
input a,b,cin;
output sum,carry;
wire w1,w2,w3,w4;
xor(w1,a,b);
xor(sum,w1,cin);
and(w2,a,b);
and(w3,b,cin);
and(w4,cin,a);
or(carry,w2,w3,w4);
endmodule
## Full_subtractor
module fullsub_top(a,b,Bin,BO,DIFF);
input a,b,Bin;
output BO,DIFF;
assign DIFF = a ^ b ^ Bin;
assign BO = (a & b) | ((a ^ b) & Bin);
endmodule
Result:
Thus the Full Adder and Full Subtractor circuits are designed and the truth tables is verified using Quartus software.