# Adders and Subtractors in Digital Logic

Block Diagram of Combinational Logic Circuit: Points to Remember on Combinational Logic Circuit:

1. Output depends upon the combination of inputs.
2. Output is pure function of present inputs only i.e., Previous State inputs won’t have any effect on the output. Also, It doesn’t use memory.
3. In other words,
`OUTPUT=f(INPUT)`
4. Inputs are called Excitation from circuits and outputs are called Response of combinational logic circuits.

Classification of Combinational Logic Circuits:

1. Arithmetic:

• Subtractors
• Multipliers
• Comparators

2. Data Handling:

• Multiplexers
• DeMultiplexers
• Encoders and Decoders

3. Code Converters:

• BCD to Excess-3 code and vice versa
• BCD to Gray code and vice versa
• Seven Segment

• A combinational logic circuit that performs the addition of two single bits is called Half Adder.
• A combinational logic circuit that performs the addition of three single bits is called Full Adder. • It is a arithmetic combinational logic circuit designed to perform addition of two single bits.
• It contain two inputs and produces two outputs.
• Inputs are called Augend and Added bits and Outputs are called Sum and Carry.

Let us observe the addition of single bits,

```0+0=0
0+1=1
1+0=1
1+1=10```

Since 1+1=10, the result must be two bit output. So, Above can be rewritten as,

```0+0=00
0+1=01
1+0=01
1+1=10```

The result of 1+1 is 10, where ‘1’ is carry-output (Cout) and ‘0’ is Sum-output (Normal Output). Next Step is to draw the Logic Diagram. To draw Logic Diagram, We need Boolean Expression, which can be obtained using K-map (karnaugh map). Since there are two output variables ‘S’ and ‘C’, we need to define K-map for each output variable.

K-map for output variable Sum ‘S’ : K-map is of Sum of products form. The equation obtained is

` S = AB' + A'B `

which can be logically written as,

`S = A xor B`

K-map for output variable Carry ‘C’ : The equation obtained from K-map is,

`C = AB`

Using the Boolean Expression, we can draw logic diagram as follows.. Limitations: • To overcome the above limitation faced with Half adders, Full Adders are implemented.
• It is a arithmetic combinational logic circuit that performs addition of three single bits.
• It contains three inputs (A, B, Cin) and produces two outputs (Sum and Cout).
• Where, Cin -> Carry In and Cout -> Carry Out K-map Simplification for output variable Sum ‘S’ : The equation obtained is,

`S = A'B'Cin + AB'Cin' + ABC + A'BCin' `

The equation can be simplified as,

```S = B'(A'Cin+ACin') + B(AC + A'Cin')
S = B'(A xor Cin) + B (A xor Cin)'
S = A xor B xor Cin ```

K-map Simplification for output variable ‘Cout The equation obtained is,

`Cout = BCin + AB + ACin ` 3. Half Subtractor: • It is a combinational logic circuit designed to perform subtraction of two single bits.
• It contains two inputs (A and B) and produces two outputs (Difference and Borrow-output).

Truth Table of Half Subtractor: K-map Simplification for output variable ‘D’ : The equation obtained is,

`D = A'B + AB'`

which can be logically written as,

`D = A xor B `

K-map Simplification for output variable ‘Bout‘ : The equation obtained from above K-map is,

`Bout = A'B `

Logic Diagram of Half Subtractor: 4. Full Subtractor: • It is a Combinational logic circuit designed to perform subtraction of three single bits.
• It contains three inputs(A, B, Bin) and produces two outputs (D, Bout).
• Where, A and B are called Minuend and Subtrahend bits.
• And, Bin -> Borrow-In and Bout -> Borrow-Out

Truth Table of Full Subtractor: K-map Simplification for output variable ‘D’ : The equation obtained from above K-map is,

`D = A'B'Bin + AB'Bin' + ABBin + A'BBin'`

which can be simplified as,

```D = B'(A'Bin + ABin') + B(ABin + A'Bin')
D = B'(A xor Bin) + B(A xor Bin)'
D = A xor B xor Bin ```

K-map Simplification for output variable ‘Bout‘ : The equation obtained is,

`Bout = BBin + A'B + A'Bin  `

Logic Diagram of Full Subtractor: Applications:

1. For performing arithmetic calculations in electronic calculators and other digital devices.
2. In Timers and Program Counters.
3. Useful in Digital Signal Processing.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.