PRASHNIKAप्रश्निका
Back to the paper

How is a decoder different from a multiplexer? Write the truth table and draw the logic circuit…

Computer Science20195 marksLong answer
How is a decoder different from a multiplexer? Write the truth table and draw the logic circuit diagram for a 3 to 8 decoder and explain its working.

Answer

Answer

AI
A decoder is a combinational circuit with n input lines and up to $2^n$ output lines; for each input combination it activates exactly one unique output line, i.e. it converts (decodes) a binary code into an individual output signal. A multiplexer (MUX) is a combinational circuit with $2^n$ data input lines, n select lines and a single output line; based on the binary value on the select lines it selects one of the many data inputs and routes it to the single output. So a decoder is a 1-input-code-to-many-output device, while a multiplexer is a many-input-to-1-output (selector) device - they perform opposite (complementary) operations. 3-to-8 decoder truth table (inputs A2 A1 A0; outputs D0..D7, only one output is 1 for each input row):
A2A1A0D0D1D2D3D4D5D6D7
00010000000
00101000000
01000100000
01100010000
10000001000
10100000100
11000000010
11100000001
Logic circuit: Inputs A2, A1, A0 and their complements A2', A1', A0' (obtained via NOT gates) are fed into eight 3-input AND gates, one per output line, each wired to the unique combination of true/complemented inputs matching its minterm, e.g. $D0=A2'.A1'.A0'$, $D1=A2'.A1'.A0$, $D2=A2'.A1.A0'$, ..., $D7=A2.A1.A0$. Working: For any given 3-bit binary input on A2 A1 A0, only the one AND gate whose input combination exactly matches that pattern produces an output of 1; all other AND gates output 0 because at least one of their inputs is 0. Thus the decoder 'decodes' the binary value present on its 3 input lines by activating exactly the corresponding one of its 8 output lines.
Computer Hardware

From ISC 2019 Computer Science Paper 1, question 5(a).