Python program to implement Full Adder
Prerequisite : Full Adder in Digital Logic
Given three inputs of Full Adder A, B,C-IN. The task is to implement the Full Adder circuit and Print output i.e sum and C-Out of three inputs.
Full Adder : A Full Adder is a logical circuit that performs an addition operation on three one-bit binary numbers. The full adder produces a sum of the three inputs and carry value.
Logical Expression :
SUM = C-IN XOR ( A XOR B ) C-0UT= A B + B C-IN + A C-IN
Truth Table :
Input : 0 1 1 Output: Sum=0, C-Out=1
According to logical expression Sum= C-IN XOR (A XOR B ) i.e 1 XOR (0 XOR 1) =0 , C-Out= A B + B C-IN + A C-IN i.e., 0 AND 1 + 1 AND 1 + 0 AND 1 = 1
Input : 1 0 0 Output: Sum=1, C-Out=0
- We take three inputs A ,B and C-in .
- Applying C-IN XOR (A XOR B ) gives the value of sum
- Applying A B + B C-IN + A C-IN gives the value of C-Out
Below is the implementation :
Sum = 1 C-Out = 0