This Article is yet to be approved by a Coordinator.
Task 5: 4 Bits to Rule Them All
Objective:
- To design and implement a 4-bit Arithmetic Logic Unit (ALU) in CircuitVerse such that the ALU should perform the following operations: addition, subtraction (using 2’s complement), and logical operations (AND, OR, XOR).
- To design a control unit to select the desired operation based on input signals and display the result along with any carry/overflow flags when applicable.
1 Bit Full Adder
A 1-bit full adder is a digital circuit that adds two binary digits and also takes in a carry from a previous addition. It gives two outputs: a sum and a carry out.

Truth Table:
A | B | Cin | Sum | Cout |
---|
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 |
Click here to redirect to the 1 bit Full Adder
4 bit full Adder:
A 4-bit full adder can be built by connecting four 1-bit full adders in series, where the carry-out of each adder becomes the carry-in of the next.
The subtraction (2's complement) operation is implemented in the same full adder circuit by by XORing the B with Subtraction bit (1).
4 Bit ALU

Components Used:
- 4 bit Full Adder: Used in arithmetic operations like addition and subtraction.
- Multiplexer (MUX): Select between different operations (e.g., AND vs ADD).
- Selects the operation to perform AND, OR, ADD, SUB, etc.
- Based on the control inputs, it routes the correct operation's output to the final ALU output.
- MUX implements operation control, but only for data selection.
- Logic gates: Perform bitwise operations like AND, OR, NOT.
How It Works:
- Inputs: Two 4-bit numbers (
A[3:0]
, B[3:0]
) and control signals.
- 1-bit ALU: Each bit of A and B is processed by a 1-bit ALU (4 in total, chained together).
- Operation Selection: Logic operations like AND, OR, NOT use logic gates and Arithmetic operations like ADD, SUB use full adders.
- Carry Handling: The carry-out from one bit is passed as carry-in to the next FA block.
- Zero Flag: Returns the status output from the ALU that tells whether the result of the operation is zero.
- Output: Final result is a 4-bit output.
Click here to redirect to the 4 bit ALU