Skip to main content

Encoder; NAND and XOR truth tables

Short answer

An encoder converts 2ⁿ input lines to an n-bit binary code, only one input active at a time. NAND gate output is (AB)' : 1,1,1,0 for inputs 00,01,10,11. XOR gate output is A⊕B: 0,1,1,0 for those inputs.

Define encoder. Draw truth tables of NAND and XOR gates.

Encoder

An encoder is a combinational circuit that converts up to 2ⁿ input lines into an n-bit binary code at the output. Only one input is active at a time, and the output is the binary code of that input. Examples: an 8-to-3 encoder, or a decimal-to-BCD encoder (10 inputs, 4 outputs). It does the opposite of a decoder.

I3I2I1I0Y1Y0
000100
001001
010010
100011

(4-to-2 encoder: Y1 = I3 + I2, Y0 = I3 + I1.)

Truth table of NAND gate (Y = (AB)')

ABY
001
011
101
110

Truth table of XOR gate (Y = A⊕B = A'B + AB')

ABY
000
011
101
110

✓ Answer checked by Claude Opus 5.5 (high effort)

All Basic Electronics Engineering chapter 6 questions →