I am trying to code a generic one-hot binary decoder in VHDL. The following is the current code that I have come up with:
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
This code generates a comparator (is-equal) in series with a multiplexer to choose between '0' or '1' according to the output of the comparator for each of the final output bits, as in inferred from the 'when' statement. However, if I use the following architecture, a decoder component will be correctly inferred, but also a latch for the output bits, which I presume is due to incomplete assignment to the output vector.
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
So my question is, if there is any way to produce only a primitive decoder component without latched output? or the above series of comparators and multiplexers are close enough equivalents of a binary decoder in gate level terms?

