Vhdl Code For 3x8 Decoder



A decoder is a combinational logic circuit which is used to change the code into a set of signals. It is the reverse process of an encoder. A decoder circuit takes multiple inputs and gives multiple outputs. A decoder circuit takes binary data of ‘n’ inputs into ‘2^n’ unique output. In addition to input pins, the decoder has a enable pin. This enables the pin when negated, makes the circuit inactive. in this article, we discuss 3 to 8 line Decoder and Multiplexer.

The below is the truth table for simple 1 to 2 line decoder where A is the input and D0 and D1 are the outputs.

VHDL Code for a 8 x 3 Encoder library ieee; use ieee.stdlogic1164.all; entity enc is port(i0,i1,i2,i3,i4,i5,i6,i7:in bit; o0,o1,o2: out bit); end enc; architecture vcgandhi of enc is begin o0VHDL Code for a 3 x 8 Decoder. Here is the code for 3: 8 Decoder using basic logic gates such as AND,NOT,OR etc.The module has one 3-bit input which is decoded as a 8-bit output.libraries to be used are specified here library IEEE.


The circuit shows the 1 to 2 decoder logic.

A demultiplexer is a device that takes a single input and gives one of the several output lines. A demultiplexer takes one single input data and then selects any one of the single output lines one at a time. It is the reverse process of a multiplexer. It is also called as a DEMUX or a data distributor. A DEMUX converts the input serial data line into output parallel data. A DEMUX gives ‘2n’ outputs for ‘n’ selection lines with a single input.

DEMUX is used when the circuit wishes to send the data signal to one of the many devices. A decoder is used to select among many devices whereas a demultiplexer is used to send the signal to many devices.

The below is the truth table for 1 to 2 demultiplexer with “I” as input data, D0 and D1 are the output data line and A is the selection line.


The circuit shows the 1 to 2 demultiplexer schematic.

3 Line to 8 Line Decoder

This decoder circuit gives 8 logic outputs for 3 inputs and has a enable pin. The circuit is designed with AND and NAND logic gates. It takes 3 binary inputs and activates one of the eight outputs. 3 to 8 line decoder circuit is also called as binary to an octal decoder.

Vhdl code for 3 to 8 decoder using if else statementVhdl code for 3 to 8 decoder using case statement

The decoder circuit works only when the Enable pin (E) is high. S0, S1 and S2 are three different inputs and D0, D1, D2, D3. D4. D5. D6. D7 are the eight outputs.

Circuit Diagram

3 to 8 Line Decoder Truth Table

The below table gives the truth table of 3 to 8 line decoder.

S0S1S2ED0D1D2D3D4D5D6D7
xxx000000000
000100000001
001100000010
010100000100
011100001000
100100010000
101100100000
110101000000
111110000000

When the Enable pin (E) is low all the output pins are low.

1 to 8 Demultiplexer

A 1 line to 8 line demultiplexer has one input, three select input lines and eight output lines. It distributes the one input data into 8 output lines depending on the selected input. Din is the input data, S0, S1, and S2 are select inputs and Y0, Y1, Y2, Y3, Y4, Y5, Y6, Y7 are the outputs.

Circuit Diagram

3 to 8 Decoder/Demultiplexer

IC 74HC238 is used is used as decoder/ demultiplexer. 3 to 8 line decoder demultiplexer is a combinational circuit that can be used as both a decoder and a demultiplexer. IC 74HC238 decodes three binary address inputs (A0, A1, A2) into eight outputs (Y0 to Y7). The device also has three Enable pins. The same combination is used as a demultiplexer.

Pin Configuration

The below is the pin configuration for the IC74HC238 3 to 8 line decoder or demultiplexer. It is a 16 pin DIP.

Circuit

The logical circuit explains the working of the IC 74HC238.

Features of 74HC238 IC

  • Demultiplexing capability
  • Multiple inputs enable for easy expansion
  • Ideal for memory chip select decoding
  • Active HIGH mutually exclusive outputs
  • Multiple package option

Vhdl Code For 3 To 8 Decoder Using Dataflow Modelling

Application of Decoder

Vhdl Code For 3x8 Decoder Tool

  • The Decoders were used in analog to digital conversion in analog decoders.
  • Used in electronic circuits to convert instructions into CPU control signals.
  • They mainly used in logical circuits, data transfer.

Vhdl Code For 3 To 8 Decoder Using Structural Modelling

Applications of Demultiplexer

3x8 Decoder Truth Table

  • Used to connect a single source to multiple destinations.
  • The Demux is used in communication systems to carry multiple data signals into a single transmission line.
  • Used in Arithmetic Logic Units
  • Used in serial to parallel converters in data communications.

Therefore, this is the basic information about 3 to 8 line decoder and demultiplexers. Hope you might have got some fundamental concepts about this topic by observing the digital logic circuits and truth tables and their applications. Furthermore, any doubts regarding this article or Latest electronics projects, You can write your views about this topic in the comment section below.

Related Content