# How does one form an equation for adder/subtractor?

1. Jan 19, 2017

### AilingLore21

I understand the concept of Kmaps, Quine method and forming a logic diagram but I'm lost at forming an equation from an addition and subtraction equation

For example: a 2 bit plus a 3 bit binary integer. I would have a 4 bit sum and 3 carries. However, how does one form the appropriate equation in order to convert it to a proper logic circuit?

2. Jan 19, 2017

### Staff: Mentor

Write a truth table for each output based on the inputs. Then do a K-map for each of the outputs and design the logic from the minterms... Can you show us what you have been reading about how to do this?

3. Jan 19, 2017

### Svein

4. Jan 20, 2017

### AilingLore21

Doesn't explain how subtraction works. What I don't get is why does three inputs of 1 yields an output of 1 carry and 1 sum?

5. Jan 21, 2017

### AilingLore21

So these sites currently

http://www.electronics-tutorials.ws/combination/comb_7.html

Nobody explains how the truth table for multiple bits work. I assume they're half adders and full adders clumped together but how to form an equation from it? Like where did the AND gate come from? And why put the AND gate for the carries separately instead of putting it in one 3 input AND gate for the 3 bit addition?

Last edited: Jan 21, 2017
6. Jan 22, 2017

### Svein

The answer to both questions: Write up the addition and subtraction tables completely with carry and borrow. Then deduce the logical gate combination.