A **full adder** is a digital circuit that performs addition of binary numbers. It takes three inputs: two significant bits (A and B) and a carry-in bit (C_in) from a previous less significant stage. The full adder produces two outputs: a sum (S) and a carry-out (C_out) to the next higher significant stage.
### Logic Diagram
The logic diagram of a full adder can be represented using basic logic gates: AND, OR, and XOR gates.
![Full Adder Logic Diagram](
https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Full_adder.svg/512px-Full_adder.svg.png)
### Explanation of the Logic Diagram:
- **Inputs:**
- A: First bit to be added.
- B: Second bit to be added.
- C_in: Carry input from the previous addition.
- **Outputs:**
- S: Sum output.
- C_out: Carry output to the next addition.
- **Gates Used:**
- **XOR Gates**: Used to compute the sum.
- **AND Gates**: Used to determine if a carry should be generated.
- **OR Gate**: Combines the carry outputs from the AND gates.
### Truth Table
The truth table for a full adder is as follows:
| A | B | C_in | S (Sum) | C_out (Carry) |
|---|---|-------|---------|----------------|
| 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 |
### Output Derivation
1. **Sum (S)**:
- The sum output can be derived from the following logic:
\[
S = A \oplus B \oplus C_{in}
\]
This means the sum is the XOR of the two inputs and the carry-in.
2. **Carry-out (C_out)**:
- The carry-out can be derived as follows:
\[
C_{out} = (A \land B) \lor (C_{in} \land (A \oplus B))
\]
This means the carry-out occurs if either:
- Both A and B are 1 (producing a carry), or
- One of A or B is 1, and the carry-in is also 1.
### Applications
Full adders are widely used in digital circuits, particularly in:
- Arithmetic logic units (ALUs).
- Building more complex adders like ripple-carry adders and carry-lookahead adders.
- Digital signal processing.
By understanding the workings of a full adder, you can grasp how binary addition is performed at the hardware level, forming the basis for more complex arithmetic operations in computing systems.