Decoder and Encoder

Updated 4 Oct 2026

Decoder

  • A decoder takes nn input lines and produces 2n2^n output lines. — แต่อย่าง 7447 เป็นเหมือน Type พิเศษออกแค่ 7
  • It converts binary or encoded data into a specific output, typically activating one output based on the input combination.
  • Example: A BCD to 7-segment decoder (like the 7447) converts a 4-bit Binary-Coded Decimal (BCD) input into a signal that controls a 7-segment display.

ง่าย ๆ ก็คือ Decoder จะ Output มากกว่า Input

Encoder

  • An encoder does the opposite: it takes **2n2^n input lines and produces nn output lines.
  • It compresses or encodes multiple active inputs into a smaller set of binary outputs.
  • Example: A priority encoder (like the 74147) takes multiple inputs (like 10 decimal digits) and converts the highest-priority active input into a 4-bit binary output.

ง่าย ๆ ก็คือ Encoder จะ Input มากกว่า Output