Digital Logic · AI215

Half Adder, Full Adder, Multiplexer and Decoder Explained

Digital Logic Study guides

Combinational circuits have outputs that depend only on current inputs. Adders, multiplexers and decoders are the standard building blocks.

Note for AI215 students: this topic is beyond this year's syllabus (coverage ends at lecture 3). It stays here for reference. A half adder adds two bits A and B: Sum = A XOR B and Carry = A AND B. It cannot take a carry-in. A full adder adds A, B and a carry-in Cin: Sum = A XOR B XOR Cin and Cout = AB + Cin(A XOR B). Chaining n full adders gives an n-bit ripple-carry adder, where each carry-out feeds the next stage. A full adder can be built from two half adders and an OR gate.

A multiplexer (MUX) selects one of several data inputs and sends it to a single output. A 2^n-to-1 MUX needs n select lines: a 4-to-1 MUX has 2 select lines, an 8-to-1 has 3. A decoder does the reverse kind of job: an n-to-2^n decoder activates exactly one of its 2^n outputs for each n-bit input. For a 2-to-4 decoder with inputs A, B and active-high outputs, output Z0 is high only when A = 0 and B = 0, output Z1 only when A = 0, B = 1, and so on, so each output is a minterm of the inputs.

Because every decoder output is a minterm, an OR gate on the right outputs can implement any function. Encoders do the opposite of decoders, turning one active line into a binary code.

Key points

  • Half adder: Sum = A XOR B, Carry = A AND B.
  • Full adder: Sum = A XOR B XOR Cin; has a carry-in.
  • 2^n-to-1 MUX has n select lines.
  • n-to-2^n decoder: one output active per input code; outputs are minterms.
  • Combinational: no memory.

Worked example

Full adder with A = 1, B = 1, Cin = 1: Sum = 1 XOR 1 XOR 1 = 1 and Cout = 1. So 1 + 1 + 1 = 11 in binary (3).

Common questions

What is the difference between a half adder and a full adder?

A full adder also accepts a carry-in; a half adder adds only two bits.

How many select lines does an 8-to-1 multiplexer need?

3, since 2^3 = 8.

Practice questions on this topic

Try these, then open the app to check your answers with explanations.

  1. Combinational circuits are .
    • A. circuits made up of different types of NAND gates
    • B. circuits made up of different types of logic gates
    • C. circuits made up of different types of adder gates
    • D. combined adders and multiplexers circuits