The Decoder

De la WikiLabs
Versiunea din 10 mai 2018 06:57, autor: Cbira (discuție | contribuții) (Pagină nouă: The decoder is a combinational circuit which is used to identify the specified input value by setting the output of the bit on the corresponding index to the input. The decoder is...)
(dif) ← Versiunea anterioară | Versiunea curentă (dif) | Versiunea următoare → (dif)
Jump to navigationJump to search

The decoder is a combinational circuit which is used to identify the specified input value by setting the output of the bit on the corresponding index to the input. The decoder is equivalent to a 1-bit multiplexer and the constant data input of 1.

For example, for a 4-bit decoder, the port table is shown below (the _ character can be used in Verilog to separate bits or numbers belonging to a base in writing a constant, for ease of reading; 16'b0100_0011_0100_0111)

- bgcolor = "# ddeeff" align = "center" 'INTRARE' 'EXIT' - bgcolor = "# ddffdd" align = "center" 0000 0000_0000_0000_0001 - bgcolor = "# ddffdd" align = "center" 0001 0000_0000_0000_0010 - bgcolor = "# ddffdd" align = "center" 0010 0000_0000_0000_0100 - bgcolor = "# ddffdd" align = "center" 0011 0000_0000_0000_1000 - bgcolor = "# ddffdd" align = "center" 0100 0000_0000_0001_0000 - bgcolor = "# ddffdd" align = "center" 0101 0000_0000_0010_0000 - bgcolor = "# ddffdd" align = "center" 0110 0000_0000_0100_0000 - bgcolor = "# ddffdd" align = "center" 0111 0000_0000_1000_0000 - bgcolor = "# ddffdd" align = "center" 1000 0000_0001_0000_0000 - bgcolor = "# ddffdd" align = "center" 1001 0000_0010_0000_0000 - bgcolor = "# ddffdd" align = "center" 1010 0000_0100_0000_0000 - bgcolor = "# ddffdd" align = "center" 1011 0000_1000_0000_0000 - bgcolor = "# ddffdd" align = "center" 1100 0001_0000_0000_0000 - bgcolor = "# ddffdd" align = "center" 1101 0010_0000_0000_0000 - bgcolor = "# ddffdd" align = "center" 1110 0100_0000_0000_0000 - bgcolor = "# ddffdd" align = "center" 1111 1000_0000_0000_0000

Interface

The interface of a decoder is made up of two signals:

  • input of n bits;
  • output of 2 n </ sup> bits.

Implementation

There are several possible implementations for the decoder:

  • using blocks generated for;
  • using blocks always combinational and case;
  • using a block assign and the left shift operator.

Although the last variant is not optimal from the point of view of the synthesized circuit, we will use this method because of the ease and short dimension of the description.