- Decimal to Binary Encoder Definition: A decimal-to-binary encoder is a digital circuit that converts a decimal number into its binary equivalent.
- Working Principle: The encoder has 10 input lines for decimal digits and 4 output lines for the binary code, converting one active input at a time.
- Truth Table and Logic Expressions: The encoder’s truth table shows binary outputs for each decimal input, with logical expressions derived using Boolean algebra.
- Applications: These encoders are used in keyboards, seven-segment displays, and binary adders to process and display numerical data.
- Related Topics: Understanding encoders is linked to learning about decoders, multiplexers, demultiplexers, and the binary number system.
A decimal-to-binary encoder is defined as a digital circuit that converts a decimal number into its binary equivalent. Also known as a decimal to BCD (binary-coded decimal) encoder, it represents each decimal digit with a 4-bit binary code. This encoder is used to convert keyboard inputs, display outputs, or perform arithmetic operations in digital systems.
This article explains the basic principle, design, and applications of a decimal to binary encoder. We will cover essential concepts and provide unique explanations to help you understand this topic.
What is an Encoder?
An encoder is defined as a combinational logic circuit that converts a set of inputs into a unique output code. This output code shows the position or identity of the active input. An encoder typically has 2^n input lines and n output lines, where n is the number of bits in the output code. This means it can encode 2^n distinct inputs with n bits.
There are different types of encoders, such as priority encoders, which assign a priority to each input and ignore the lower priority inputs when more than one input is active, and binary-weighted encoders, which use a binary weighting system to assign output codes to inputs.
How Does a Decimal to Binary Encoder Work?
A decimal-to-binary encoder usually consists of 10 input lines and 4 output lines. Each input line corresponds to a decimal digit from 0 to 9, and each output line corresponds to a bit in the BCD code.

The encoder accepts one active input at a time and produces the corresponding 4-bit BCD code at the output.
For example, if the input line D3 is active, meaning that the decimal digit 3 is entered, the encoder will produce the BCD code 0011 at the output lines A3, A2 A1 A0. Similarly, if the input line D7 is active, meaning that the decimal digit 7 is entered, the encoder will produce the BCD code 0111 at the output.
The truth table for a decimal-to-binary encoder is shown below:

| Inputs | Outputs |
|---|---|
| D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 | A3 A2 A1 A0 |
| 0 0 0 0 0 0 0 0 0 1 | 0 0 0 0 |
| 0 0 0 0 0 0 0 0 1 0 | 0 0 0 1 |
| 0 0 0 0 0 0 0 1 0 0 | 0 0 1 0 |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| … | … |
| 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 00000000000000000000 |
Logical expressions for the output lines are derived from the truth table using Boolean algebra or Karnaugh maps. For instance, the output line A3 is high only when the input lines D8 or D9 are high, so we write:
A3 = D8 + D9
Similarly, we can obtain the expressions for A2, A1, and A0:
A2 = D4 + D5 + D6 + D7
A1 = D2 + D3 + D6 + D7
A0 = D1 + D3 + D5 + D7
The logic circuit for decimal to binary encoder can be implemented using OR gates as shown below:
What are Some Applications of Decimal to Binary Encoders?
Decimal to binary encoders are used in various digital systems to encode keyboard inputs, display outputs, or perform arithmetic operations. Some examples are:
- Keyboard encoders: These are used to convert the keystrokes on a keyboard into binary codes that can be processed by a computer or other devices. For example, a numeric keypad may use a decimal-to-binary encoder to convert the pressed keys into BCD codes that can be sent to a calculator or an ATM machine.
- Seven-segment display encoders: These are used to convert BCD codes into signals that can drive a seven-segment display.
- A seven-segment display is a device that can display digits from 0 to 9 using seven LED segments arranged in a rectangular shape. Each segment can be turned on or off by applying a voltage across it. To display a digit on a seven-segment display, we need to turn on or off certain segments according to a predefined pattern. For example, to display the digit “5”, we need to turn on segments A, F, G, C, and D; and turn off segments B and E. A seven-segment display encoder can generate these signals from the BCD codes of the digits.
- Binary adders: These are used to perform the addition of two binary numbers. A binary adder can be constructed using logic gates such as AND, OR, XOR, and NOT.
- To add two BCD numbers, we need to use a special type of binary adder called a BCD adder. A BCD adder can handle the carry-over from one digit to another and correct any invalid BCD results using additional logic circuits.

What are Some Related Topics?
Some related topics that you may want to explore further are:
- Binary number system: This is a system of representing numbers using only two symbols: “0” and “1”. Each symbol is called a bit (binary digit). Binary numbers can be converted into other number systems such as decimal (base-10), octal (base-8), or hexadecimal (base-16) using simple rules.
- Decoder: This is a digital circuit that performs the reverse operation of an encoder. It converts an n-bit input code into one of the possible outputs corresponding to that code. For example, a BCD decoder can convert an input BCD code into one of its ten possible outputs representing digits from “0” to “9”.
- Multiplexer: This is a digital circuit that selects one of several inputs and forwards it to the output based on some control signals. It acts like a switch that connects one of its inputs to its output. For example, an octal multiplexer can select one of its eight inputs based on three control signals.
- Demultiplexer: This is a digital circuit that distributes one input signal into several outputs based on some control signals. It acts like an inverse switch that connects its input to one of its outputs. For example, an octal demultiplexer can distribute its input signal into one of its eight outputs based on three control signals.
Conclusion
In this article, we have explained how to design a decimal-to-binary encoder using logic gates and truth tables. We have also discussed some applications and related topics of decimal to binary encoders. We hope you have learned something new and useful from this article.





