CHAPTER 036 SECTIONS · 4 CHECKS

Adders, multiplier, and ALU

Binary representation, half/full adders, subtraction, multiplication, and ALU construction.

Contents
  1. 1. Binary numbers
  2. 2. Half-adder
  3. 3. Full-adder
  4. 4. Ripple-carry adder
  5. 5. Binary multiplier
  6. 6. ALU and subtraction

01

Binary numbers

An unsigned n-bit value ranges from 0 to 2ⁿ−1. Two's complement ranges from −2ⁿ⁻¹ to 2ⁿ⁻¹−1. To form −x, invert positive x and add 1.

1400001110invert11110001+111110010= −14
−14 in 8-bit two's complement (Midterm 2023).

02

Half-adder

A half-adder adds A and B: Sum=A XOR B and Carry=A AND B. It has no carry-in.

ABSumCarryXORAND
Sum = A⊕B, Carry = A·B.

03

Full-adder

A full-adder adds A, B, and Cin: Sum=A XOR B XOR Cin; Cout=(A AND B) OR (Cin AND (A XOR B)). It can be built from two half-adders and an OR gate.

ABCinSCoutHA₁HA₂
Two half-adders and an OR for the carry.

04

Ripple-carry adder

In a multi-bit adder, each lower Cout feeds the next Cin. Carry ripple forms a long critical path; delay grows roughly linearly with width.

FAA3B3S3C3FAA2B2S2C2FAA1B1S1C1FAA0B0S0Cin=0Cout
The carry ripples right to left — that is the critical path.

05

Binary multiplier

Each partial product is an AND of one A bit and one B bit. Shifted partial products are added. Multiplying two n-bit unsigned values may require 2n bits.

a0a1b0b1Half-AdderHalf-Adderq0q1q2q3S / C
ANDs form partial products, half-adders add them (Midterm 2025).

06

ALU and subtraction

An ALU computes logic and arithmetic candidates and a MUX selects one. Subtraction reuses the adder: A−B=A+NOT(B)+1.

AB+0−1×2==3MUXOp (2 bit)Result
The Lab 6 ALU: a MUX selects the operation result.
FAA3B3S3FAA2B2S2FAA1B1S1FAA0B0S0MCinM=0: A+B · M=1: A−B = A + B̄ + 1
Subtraction: XORs invert B and M=1 enters as Cin.

SELF-CHECK

Check your understanding

Half-adder for 1+1?

Sum=0, Carry=1.

−14 in 8 bits?

11110010.

What does a full-adder add?

A, B, and Cin.

How is A−B performed?

A+NOT(B)+1.