4-Bit Adder and Subtractor

 One Circuit, Two Jobs: The 4-bit Adder-Subtractor Unlocked

Modern digital systems don’t just calculate 1s and 0s — they crunch multiple bits at once at blazing speed. That’s where 4-bit parallel arithmetic circuits come into play. From microcontrollers to CPUs, these circuits handle binary operations efficiently and accurately.

In this blog, we’ll break down:

  • How a 4-bit Parallel Adder works (with & without carry-in)
  • How a 4-bit Subtractor performs bitwise subtraction using full subtractors
  • How a single circuit can switch between addition and subtraction based on a control signal

1. 4-bit Parallel Adder:

4-bit parallel adder is a combinational circuit that adds two 4-bit binary numbers. It uses four full adders, one per bit, connected in a ripple-carry configuration.

Inputs:

  • A – 4 bit binary number

  • B – 4 bit binary number

  • C_in – Optional carry-in input (usually 0)

Outputs:

  • S – 4 bit binary sum

  • C_out – Final carry-out

Ripple-Carry Logic – Step by Step:

Let’s say:

  • A = 1011

  • B = 0110

  • C_in = 0

Here’s how the addition works:

  1. First Full Adder (LSB): A₀ + B₀ + Cin → S₀ + Carry₁

  2. Second Full Adder: A₁ + B₁ + Carry₁ → S₁ + Carry₂

  3. Third Full Adder: A₂ + B₂ + Carry₂ → S₂ + Carry₃

  4. Fourth Full Adder (MSB): A₃ + B₃ + Carry₃ → S₃ + C_out

With vs Without Carry-In:

Case 1: No Carry-In (Cin = 0)

This is a basic 4-bit addition with no previous carry.

Structure:

  • First Stage (LSB):
    Uses a Half Adder (HA) — because there's no carry-in at the first stage.

  • Remaining Stages (Bits 1 to 3):
    Use Full Adders (FA) — since they need to account for both input bits and the carry from the previous bit.

Case 2: With Carry-In (Cin = 1)

When a carry-in is provided (e.g., for multi-byte addition or in an adder-subtractor combo), all stages must handle carry.

Structure:

  • All 4 Stages (Bits 0 to 3):
    Use Full Adders (FA) — including the LSB — because carry-in (C_in) is treated as the third input to the first adder.

Why This Design?

  • Half Adder = Simpler, used only when no carry-in is needed.

  • Full Adder = Handles 3 inputs (A, B, Cin), required when carry propagation is involved.

Real-World Use:

Used in arithmetic logic units (ALUs), calculators, embedded controllers — anywhere binary addition is needed.

2. 4-bit Parallel Subtractor:

This circuit subtracts B from A using full subtractors in a ripple-borrow chain.

Inputs:

  • A – Minuend

  • B – Subtrahend

  • Bin – Initial borrow input (usually 0)

Outputs:

  • D – Binary difference

  • Bout – Final borrow-out

Subtraction – Step by Step:

Assume A = 1100 and B = 0011:

  1. First Subtractor (LSB): A₀ − B₀ − Bin → D₀ + Borrow₁

  2. Second Subtractor: A₁ − B₁ − Borrow₁ → D₁ + Borrow₂

  3. Continue till MSB...

Borrow Propagation:

Each subtractor passes its borrow to the next stage, just like a carry in addition.

Real-World Use:

Used in down counters, digital comparators, memory address calculations, and ALUs.

3. 4-bit Adder/Subtractor Combo Circuit:

Why build two circuits when one can do both addition and subtraction?

This circuit uses XOR gates and full adders to perform either operation based on a control signal.

Circuit Behavior:

Inputs: A, B, Control

Modified_B = B ⊕ Control  

Cin = Control  

  • If Control = 0 → Performs A + B
  • If Control = 1 → Performs A − B using 2’s complement method

Internal Structure:

  • 4 XOR gates to conditionally invert B

  • 4 full adders for the actual addition

  • One control input to switch modes

Real-World Use:

Used in ALUs, embedded processors, and compact arithmetic logic blocks.

Why This Matters?

These circuits lay the groundwork for:

  • ALUs in processors

  • High-speed digital systems

  • FPGA/Verilog-based design

  • Efficient use of logic gates and space

Mastering these 4-bit circuits opens the door to advanced VLSI, computer architecture, and embedded development.

We’re not done yet! Next, we’ll explore:

  • Carry Look-Ahead Adders (CLA) — speed up your addition
  • Borrow Look-Ahead Subtractors — smarter subtraction

Whether you're a student, hobbyist, or aspiring VLSI designer, these topics will upgrade your digital logic skills!

Stay tuned to Hobitronics.blog — where circuits don’t just add up… they subtract too!

Missed our previous blog on Application of subtractors

Comments

Popular posts from this blog

Why Does My Old Phone Charge Slowly But Heat Up More?

Controlling RGB LEDs with PWM Using Arduino

Why Do Phone Chargers Get Hot While Charging?

How MOSFETs Work with Arduino: PWM Control, Applications, and Pro Tips

Why Does Tea Taste Weird on an Induction Stove?

Understanding Masking, Enabling, and Disabling of Logic Gates

🎧 Sampling and Quantization Explained

Pulse Code Modulation (PCM): The Digital Backbone of Modern Communication