Encoder Decoder Calculator
Calculate digital encoder output, decoder one-hot outputs, priority encoder result, BCD to 7-segment segments and truth tables for common logic circuits.
๐Ÿ”ฃ Digital Logic Rule: A decoder expands binary address bits into one selected output line. An encoder compresses one active input line into a binary code. Use this with the Truth Table Generator, MUX / DEMUX Calculator, Logic Gate Calculator and K-Map Solver.
๐Ÿ”ฃ Binary Code โ†” One Active Line
BINARY INPUT A=010 3 input bits 3 TO 8 DECODER Y2 = 1 one selected output OUTPUTS 00100000 one-hot output
Decoder Size
Binary Input / Index
Enable Input
Output Logic
A decoder converts n binary input lines into 2โฟ output lines. Only one output line is active when enable is ON.
Presets:
Encoder Size
Encoder Type
Priority Direction
For a normal encoder, only one input should be active. A priority encoder can handle multiple active inputs by selecting one according to priority.
Presets:
Decimal / BCD Digit
Display Type
Format
A BCD to 7-segment decoder converts a 4-bit BCD digit into the a, b, c, d, e, f, g segment signals for a display.
Digits:
Table Type
Size / Bits
Active Logic
Generate a quick reference truth table for decoder, encoder or BCD to 7-segment outputs.

๐Ÿ“ Formula Reference

Decoder Outputs
n inputs โ†’ 2โฟ outputs
selected output = binary input index
Encoder Outputs
2โฟ inputs โ†’ n output bits
binary output = active input index
Priority Encoder
if multiple inputs are active, output = highest or lowest priority active index
BCD to 7 Segment
BCD digit โ†’ segment pattern a,b,c,d,e,f,g

๐Ÿ“‹ Quick Reference

Decoder Sizes
2-to-42 in, 4 out
3-to-83 in, 8 out
4-to-164 in, 16 out
Encoder Sizes
4-to-24 in, 2 out
8-to-38 in, 3 out
16-to-416 in, 4 out
Common ICs
74HC1383-to-8 decoder
74HC1544-to-16 decoder
74HC1488-to-3 priority encoder
CD4511BCD to 7-seg

๐Ÿ“š Digital Logic Notes

Decoder expands address bitsA 3-bit binary input can select one of 8 output lines. This is why decoders are common in memory addressing.
Encoder compresses one-hot inputIf input line I5 is active in an 8-to-3 encoder, the binary output is 101.
Priority encoder prevents ambiguityWhen more than one input is active, a priority encoder chooses one input based on priority instead of giving an invalid normal encoder result.
Active LOW outputs are commonMany decoder ICs use active-low outputs, so the selected output becomes 0 while unselected outputs stay 1.

What is an Encoder Decoder Calculator?

An encoder decoder calculator helps convert between binary input codes and selected output lines. It can calculate decoder one-hot outputs, encoder binary output, priority encoder result and BCD to 7-segment display segment patterns.

Encoder vs decoder in digital electronics

A decoder converts n input bits into 2โฟ output lines. An encoder does the reverse: it converts one active input line into an n-bit binary output code. A decoder is often used for selection, addressing and display logic, while an encoder is used for keypads, interrupt lines and input compression.

How many outputs does a decoder have?

A decoder with n input bits has 2โฟ output lines. A 2-to-4 decoder has 4 outputs, a 3-to-8 decoder has 8 outputs and a 4-to-16 decoder has 16 outputs.

What is a priority encoder?

A priority encoder is an encoder that can accept more than one active input. It outputs the binary code of the highest-priority or lowest-priority active input depending on the design.

โ“ Frequently Asked Questions

A decoder is a combinational logic circuit that converts binary input bits into one selected output line. For example, a 3-to-8 decoder activates one of eight output lines.
An encoder converts one active input line into a binary code. For example, an 8-to-3 encoder outputs three binary bits representing the active input number.
A decoder expands binary code into one selected output line. An encoder compresses one selected input line into a binary code.
A 3-to-8 decoder has 8 outputs because 2ยณ = 8. The three input bits select one of the eight output lines.
A priority encoder is used when multiple inputs may be active at the same time. It chooses the input with the highest priority and outputs its binary code.
The 74HC138 is commonly used as a 3-to-8 decoder/demultiplexer with active-low outputs. That means the selected output goes low while unselected outputs remain high.
A BCD to 7-segment decoder converts a 4-bit BCD digit into the seven segment control signals needed to show numbers on a 7-segment display.