The encoders and decoders play an essential role in digital electronics projects; encoders & decoders are used to convert data from one form to another form. These are frequently used in communication system such as telecommunication, networking, etc..to transfer data from one end to the other end. Similarly, in the digital domain, for easy transmission of data, it is often encrypted or placed within codes, and then transmitted. At the receiver, the coded data is decrypted or gathered from the code and is processed in order to be displayed or given to the load accordingly.
Types of Encoders and Decoders
An encoder is an electronic device used to convert an analogue signal to a digital signal such as a BCD code. It has a number of input lines, but only one of the inputs is activated at a given time and produces an N-bit output code that depends on the activated input. The encoders and decoders are used in many electronics projects to compress the multiple number of inputs into smaller number of outputs. The encoder allows 2 power N inputs and generates N-number of outputs. For example, in 4-2 encoder, if we give 4 inputs it produces only 2 outputs.
Truth Table Of The Encoder
The decoders and encoders are designed with logic gate such as an OR-gate. There are different types of encoders and decoders like 4 , 8, and 16 encoders and the truth table of encoder depends upon a particular encoder chosen by the user. Here, a 4-bit encoder is being explained along with the truth table. The four-bit encoder allows only four inputs such as A0, A1, A2, A3 and generates the two outputs F0, F1, as shown in below diagram.
A normal encoder has a number of input lines amongst which only one of which is activated at a given time while a priority encoder has more than one input, which is activated based on priority. Which means that, the priority encoders are used to control interrupt requests by acting according to the highest priority request? If two or more inputs are equal to one – at the same time, the input having the highest priority will be preferred to take. Internal hardware will check this condition and priority, which is set.
The multiplexers and demultiplexers are digitalelectronic devices that are usedto control applications. A multiplexer is a device that allows multiple input signals and produces a single output signal. For example, sometimes we need to produce a single output from multiple input lines. Electronic multiplexer can be considered as a multiple input and single output lines. In this case, the multiplexer used selects the input line to be sent to the output. The digital code is applied to the selected inputs to generate respective output. The digital code is applied to the selected inputs to generate respective output A common application of multiplexing occurs when several embedded system devices share a single transmission line or bus line while communicating with the device. Each device in succession has a brief time to send and receive the data. This is the special advantage of using this MUX.
Introduction Of Decoder
The decoder is an electronic device that is used to convert digital signal to an analogue signal. It allows single input line and produces multiple output lines. The decoders are used in many communication projects that are used to communicate between two devices. The decoder allows N- inputs and generates 2 power N-numbers of outputs. For example, if we give 2 inputs that will produce 4 outputs by using 4 by 2 decoder.
Truth Table Of The Decoder
The encoders and decoders are designed with logic gates such as AND gate. There are different types of decoders like 4, 8, and 16 decoders and the truth table of decoder depends upon a particular decoder chosen by the user. The subsequent description is about a 4-bit decoder and its truth table. The four bit decoder allows only four outputs such as A0, A1, A2, A3 and generates two outputs F0, F1, as shown in the below diagram.
2-to-4 line Decoder
In this type of encoders and decoders, decoders contain two inputs A0, A1, and four outputs represented by D0, D1, D2, and D3. As you can see in the truth table – for each input combination, one output line is activated.
In this example, you can notice that, each output of the decoder is actually a minterm, resulting from a certain inputs combination, that is:
- D0 =A1 A0, ( minterm m0) which corresponds to input 00
- D1 =A1 A0, ( minterm m1) which corresponds to input 01
- D2 =A1 A0, ( minterm m2) which corresponds to input 10
- D3 =A1 A0, ( minterm m3) which corresponds to input 11
The circuit is implemented with AND gates, as shown in the figure. In this circuit, the logic equation for D0 is A1/A0, and so on. Thus, each output of the decoder will be generated to the input combination.
This type of decoder contains two inputs: A0, A1, A2; and four outputs represented by D0, D1, D2, D3, D4, D5, D6, and D7. As you can see in the truth table, for each input combination, one output line is activated. For example, an input will activate the line A0, A1, A3 as 01 at the input has activated line D1, and so on.
In this example, you can notice that, each output of the decoder is actually a minterm, resulting from a certain inputs combination, that is;
- D0 =A2 A1 A0, ( minterm m0) which corresponds to input 000
- D1 = A2 A1 A0, ( minterm m1) which corresponds to input 001
- D2 = A2 A1 A0, ( minterm m2) which corresponds to input 010
- D3 = A2 A1 A0, ( minterm m3) which corresponds to input 011
- D4 = A2 A1 A0, ( minterm m0) which corresponds to input 100
- D5 = A2 A1 A0, ( minterm m1) which corresponds to input 101
- D6 = A2 A1 A0, ( minterm m2) which corresponds to input 110
- D7 = A2 A1 A0, ( minterm m3) which corresponds to input 111
The circuit is implemented with AND gates, as shown in the figure. In this circuit, the logic equation for D0 is A2/A1/A0/, and so on. Thus, each output of the decoder will be generated to the input combination.
Decoder Design with NAND Gates
Some decoders are constructed with NAND rather than AND gates. In this case, all decoder outputs will be 1’s except the one corresponding to the input code which will be 0. 2-to-4 line decoder with an enable input constructed with NAND gates. The circuit operates with complemented outputs and enables input E’, which is also complemented to match the outputs of the decoder NAND gate. The decoder enabled when E’ is equal to zero. As represented by the truth table, only one output can be equal to zero at any given time, all other outputs being equal to one. The outputs represent minterm selected by the inputs A1 and A0. The circuit is disabled when E’ is equal to one, regardless of the values of the other two inputs. If the circuit is disabled, then none of the outputs are equal to zero.
Applications Of Decoder And Encoder
1) Speed Synchronization of Multiple Motors in Industries
This system is used to synchronize motor speed by using RF technology. This project is applicable to many industries like steel plants, paper plants and textile mills, where the motors are used to design simultaneously. All these motors used on conveyer are designed to be synchronized.
In this system, one motor output is given as the reference speed for the other motors to follow same speed. The proposed system consists of two blocks: transmitter and receiver blocks, which are built with encoder and decoder. A particular speed is sent by the transmitter with the help of the decoder. The receiver receives the data and converts the digital format to send the receiver system, and maintains same speed as it has received. Thus, if a particular speed is set by the transmitter, then other motors run with the same speed by utilizing radio-frequency communication.
2) War- Field -Flying Robort with a Night Vision Flying Camera
This system with a wireless camera can wirelessly transmit a real-time video with night vision capabilities using RF technology, which is for remote operation. This kind of robot can be helpful for spying in War fields.
In the transmitting end push buttons are used; commands are sent to the controller for controlling the movement of the robot either in forward, backward, left, right, directions. The RF transmitter acts as a RF remote control that has the advantage of adequate range (up to 200 meters) with proper antenna, while the receiver decodes before feeding it to another microcontroller to drive DC motors via motor-driver IC for necessary work. A wireless camera is mounted on the robot body for spying purposes, even in complete darkness by using infrared lighting. The basic schematic diagram is shown above.
3) Robotic Vehicle with Metal Detector
The project is designed to devolpa robotic vehicle that can sense metals ahead of it on its path similar to sensing land mines. The robot is controlled by a remote using RF technology. At the transmitting end, using push buttons, commands are sent to the receiver to control the movement of the robot either in forward, backward and left or right directions. At the receiving end, two motors are interfaced to the microcontroller where they are used for the movement of the vehicle.
The RF transmitter acts as a RF remote control that has the advantage of adequate range (up to 200 meters) with proper antenna, while the receiver decodes before feeding it to another microcontroller to drive DC motors via motor-driver IC for necessary work.
The RF transmitter acts as a RF remote control that has the advantage of adequate range (up to 200 meters) with proper antenna, while the receiver decodes before feeding it to another microcontroller to drive DC motors via motor driver IC for necessary work.
4) RF based Home Automation System
The main goal of this project is to develop a home automation system with an RF- controlled remote. As technology is advancing so houses are also getting smarter. Modern houses are gradually shifting from conventional switches to a centralized control system, involving RF controlled switches.
Presently, conventional wall switches located in different parts of the house make it difficult for the user to approach them for operations. Furthermore, it becomes more & more difficult for the elderly or physically handicapped people to do so. Remote controlled home automation system provides a simpler solution with RF technology.
5) Automatic Wireless Health Monitoring System in Hospitals for Patients
In this project, a wireless communication system is designed and developed for remote patient monitoring. The primary function of this system is to monitor the temperature of a patient’s body, and display the same to the doctor through RF communication. It is a very tedious method. In this proposed system, a transmitting module continuously reads patient’s body temperature through a digital temperature sensor; displays it on the LCD screen and sends it to the microcontroller, which then transmits the encoded serial data over the air by RF (radio frequency) through an RF module.
6) Secret Code Enabled Secure Communication using RF Technology
The project is designed to send secure message by using a secret code from a computer keyboard connected to the transmitting unit via RF technology. The message is retrieved at the receiver end only upon entering the secret code used by the transmitter. Thus, complete secrecy is maintained in this communication process. This project has a unique feature of tagging the message with a secret code as selected by the sender. The message is then transmitted through the RF transmitting module. At the receiver end, the signal is received by the RF receiver module. The message is then retrieved only if the secret code is known to the receiving personnel. In this project, the encoders and decoders are used to transmit and receive the information. Once the secret code is entered, then message is displayed on the receiving unit on the LCD display.
This is all about encoder & decoder, types of encoder and decoder and its applications in communication based projects. we believe that, you might have got a better idea about this concept, furthermore, any doubts regarding this article please give your valuable suggestions by commenting in the comment section below.