Published by: Dikshya
Published date: 10 Jul 2023
A half adder is a combinational logic circuit that adds two binary digits (bits) together and produces a sum and a carry output. It does not consider any previous carry input. A half adder consists of two inputs (A and B) and two outputs (Sum and Carry).
The truth table for a half adder is as follows:
A | B | Sum | Carry |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
The sum output represents the least significant bit of the addition, while the carry output represents the carry that is propagated to the next higher-order bit position.
A full adder is an extension of a half adder and considers both the current inputs and any carry input from the previous bit. It adds three binary digits (two inputs and a carry) and produces a sum and a carry output. A full adder has three inputs (A, B, and Carry-in) and two outputs (Sum and Carry-out).
The truth table for a full adder is as follows:
A | B | Carry-in | Sum | Carry-out |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 1 | 1 |
The sum output represents the least significant bit of the addition, while the carry-out represents the carry that is propagated to the next higher-order bit position.
A half subtractor is a combinational logic circuit used to subtract two single-bit binary numbers and produce a difference (subtraction result) and a borrow output. It operates similar to a half adder but with an additional borrow output. A half subtractor has two inputs (minuend and subtrahend) and two outputs (difference and borrow).
A | B | Difference | Borrow |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
The difference output represents the result of the subtraction, while the borrow output indicates whether a borrow (1) is required from the next lower-order bit during subtraction.
4. Full Subtractor:
A full subtractor is an extension of a half subtractor and considers not only the current inputs but also any borrow input from the previous bit position. It subtracts three single-bit binary numbers (minuend, subtrahend, and borrow) and produces a difference and a borrow output. A full subtractor has three inputs (A, B, and Borrow-in) and two outputs (Difference and Borrow-out).
The truth table for a full subtractor is as follows:
A | B | Borrow-in | Difference | Borrow-out |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 | 1 |
0 | 1 | 0 | 1 | 1 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 0 |
1 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 1 | 1 |
The difference output represents the result of the subtraction, while the borrow-out indicates whether a borrow (1) is required from the next lower-order bit during subtraction.
Half subtractors and full subtractors can be cascaded together to perform subtraction on multi-bit binary numbers. They are crucial components in arithmetic circuits, such as subtractors, arithmetic logic units (ALUs), and other applications involving binary subtraction.