Jump to content

Binary decoder: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
adding link to artist
m Reverting possible vandalism by 2600:1015:A113:5417:161:A852:7784:AC7 to version by Remsense. Report False Positive? Thanks, ClueBot NG. (4340524) (Bot)
 
(267 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
{{Short description|Combinational logic circuit}}
:'' For the drum and bass musician, see [[Decoder (artist)]]''
{{More references|date=May 2009}}


In [[digital electronics]], a '''binary decoder''' is a [[combinational logic]] circuit that converts binary information from the n coded inputs to a maximum of 2<sup>n</sup> unique outputs. They are used in a wide variety of applications, including instruction decoding, data multiplexing and data demultiplexing, seven segment displays, and as [[address decoder]]s for [[memory]] and [[port-mapped I/O]].
[[Image:DCC_Decoder.jpg|thumb|A [[Digitrax]] DH163AT [[Digital Command Control|DCC]] decoder in an [[Athearn]] locomotive before the shell goes on.]]


There are several types of binary decoders, but in all cases a decoder is an electronic circuit with multiple input and multiple output signals, which converts every unique combination of input states to a specific combination of output states. In addition to integer data inputs, some decoders also have one or more "enable" inputs. When the enable input is negated (disabled), all decoder outputs are forced to their inactive states.
A '''decoder''' is a device which does the reverse of an [[encoder]], undoing the encoding so that the original information can be retrieved. The same method used to encode is usually just reversed in order to decode.


Depending on its function, a binary decoder will convert binary information from n input signals to as many as 2<sup>n</sup> unique output signals. Some decoders have less than 2<sup>n</sup> output lines; in such cases, at least one output pattern may be repeated for different input values.
In digital electronics this would mean that a decoder is a multiple-input, multiple-output [[logic gate|logic circuit]] that converts coded inputs into coded outputs, where the input and output codes are different. e.g. n-to-2<sup>n</sup>, BCD decoders.


A binary decoder is usually implemented as either a stand-alone [[integrated circuit]] (IC) or as part of a more complex IC. In the latter case the decoder may be synthesized by means of a [[hardware description language]] such as [[VHDL]] or [[Verilog]]. Widely used decoders are often available in the form of standardized ICs.
Enable inputs must be on for the decoder to function, otherwise its outputs assume a single "disabled" output code word. Decoding is necessary in applications such as data [[multiplexing]], 7 segment display and [[memory]] address decoding.


==Types of decoders==
The simplest decoder circuit would be an [[logic gate|AND gate]] because the output of an AND gate is "High" (1) only when all its inputs are "High".


===1-of-n decoder===
[[Image:Decoder_Example.svg|thumb|right|Example: A 2-to-4 Line Single Bit Decoder]]
[[File:Decoder Example.svg|thumb|A 2-to-4 line decoder]]
A slightly more complex decoder would be the n-to-2<sup>n</sup> type [[Binary coding|binary]] decoders. These type of decoders are combinational circuits that convert binary information from 'n' coded inputs to a maximum of 2<sup>n</sup> unique outputs. We say a ''maximum'' of 2<sup>n</sup> outputs because in case the 'n' bit coded information has unused [[bit]] combinations, the decoder may have less than 2<sup>n</sup> outputs. We can have 2-to-4 decoder, 3-to-8 decoder or 4-to-16 decoder. We can form a 3-to-8 decoder from two 2-to-4 decoders (with enable signals).


A 1-of-n binary decoder has n output bits. This type of decoder asserts exactly one of its n output bits, or none of them, for every integer input value. The "address" (bit number) of the activated output is specified by the integer input value. For example, output bit number 0 is selected when the integer value 0 is applied to the inputs.
==See also==
* [[endec]]


Examples of this type of decoder include:
[[Category:Electronics]]
*A ''3-to-8 line decoder'' activates one of eight output bits for each input value from 0 to 7 — the range of integer values that can be expressed in three bits. Similarly, a ''4-to-16 line decoder'' activates one of 16 outputs for each 4-bit input in the integer range [0,15].
[[Category:Telecommunications]]
*A ''BCD to decimal decoder'' has ten output bits. It accepts an input value consisting of a [[binary-coded decimal]] integer value and activates one specific, unique output for every input value in the range [0,9]. All outputs are held inactive when a non-decimal value is applied to the inputs.
*A [[demultiplexer]] is a 1-of-n binary decoder that is used to route a data bit to one of its n outputs while all other outputs remain inactive.


===Code translator===
[[de:Decoder]]
Code translators differ from 1-of-n decoders in that multiple output bits may be active at the same time. An example of this is a ''seven-segment decoder'', which converts an integer into the combination of segment control signals needed to display the integer's value on a [[seven-segment display]] digit.
[[fa:رمزگشا]]

[[id:Dekoder]]
One variant of seven-segment decoder is the ''BCD to seven-segment decoder'', which translates a binary-coded decimal value into the corresponding segment control signals for input integer values 0 to 9. This decoder function is available in standard ICs such as the CMOS [[4511]].
[[nl:Decoder]]

[[sr:Декодер]]
===Binary to Unary Decoder===
[[fi:Dekooderi]]

A binary to unary decoder converts each binary value to its associated [[Unary coding|unary]] representation. Unlike the 1-of-n (one-hot) decoder, multiple output bits can be asserted for each input value. These decoders can be used in [[Digital-to-analog converter|DACs]] where each bit is equally weighted, and circuits that require a binary [[Mask (computing)|mask]] or window.<ref>{{Cite patent|country=US|number=5313300A|status=patent|title=Binary to unary decoder for a video digital to analog converter|gdate=1992-08-10|url=https://patents.google.com/patent/US5313300A/en}}</ref>

==See also==
{{Wiktionary|decoder}}
*[[Multiplexer]]
*[[One-hot]], the format of the 1-of-n decoder's output (or the unencoded output of a ring counter)
*[[Priority encoder]]
*[[Sum-addressed decoder]]


==References==
{{Reflist}}


[[Category:Digital circuits]]
{{tech-stub}}

Latest revision as of 23:22, 18 August 2024

In digital electronics, a binary decoder is a combinational logic circuit that converts binary information from the n coded inputs to a maximum of 2n unique outputs. They are used in a wide variety of applications, including instruction decoding, data multiplexing and data demultiplexing, seven segment displays, and as address decoders for memory and port-mapped I/O.

There are several types of binary decoders, but in all cases a decoder is an electronic circuit with multiple input and multiple output signals, which converts every unique combination of input states to a specific combination of output states. In addition to integer data inputs, some decoders also have one or more "enable" inputs. When the enable input is negated (disabled), all decoder outputs are forced to their inactive states.

Depending on its function, a binary decoder will convert binary information from n input signals to as many as 2n unique output signals. Some decoders have less than 2n output lines; in such cases, at least one output pattern may be repeated for different input values.

A binary decoder is usually implemented as either a stand-alone integrated circuit (IC) or as part of a more complex IC. In the latter case the decoder may be synthesized by means of a hardware description language such as VHDL or Verilog. Widely used decoders are often available in the form of standardized ICs.

Types of decoders

[edit]

1-of-n decoder

[edit]
A 2-to-4 line decoder

A 1-of-n binary decoder has n output bits. This type of decoder asserts exactly one of its n output bits, or none of them, for every integer input value. The "address" (bit number) of the activated output is specified by the integer input value. For example, output bit number 0 is selected when the integer value 0 is applied to the inputs.

Examples of this type of decoder include:

  • A 3-to-8 line decoder activates one of eight output bits for each input value from 0 to 7 — the range of integer values that can be expressed in three bits. Similarly, a 4-to-16 line decoder activates one of 16 outputs for each 4-bit input in the integer range [0,15].
  • A BCD to decimal decoder has ten output bits. It accepts an input value consisting of a binary-coded decimal integer value and activates one specific, unique output for every input value in the range [0,9]. All outputs are held inactive when a non-decimal value is applied to the inputs.
  • A demultiplexer is a 1-of-n binary decoder that is used to route a data bit to one of its n outputs while all other outputs remain inactive.

Code translator

[edit]

Code translators differ from 1-of-n decoders in that multiple output bits may be active at the same time. An example of this is a seven-segment decoder, which converts an integer into the combination of segment control signals needed to display the integer's value on a seven-segment display digit.

One variant of seven-segment decoder is the BCD to seven-segment decoder, which translates a binary-coded decimal value into the corresponding segment control signals for input integer values 0 to 9. This decoder function is available in standard ICs such as the CMOS 4511.

Binary to Unary Decoder

[edit]

A binary to unary decoder converts each binary value to its associated unary representation. Unlike the 1-of-n (one-hot) decoder, multiple output bits can be asserted for each input value. These decoders can be used in DACs where each bit is equally weighted, and circuits that require a binary mask or window.[1]

See also

[edit]

References

[edit]
  1. ^ US patent 5313300A, "Binary to unary decoder for a video digital to analog converter", issued 1992-08-10