Binary to Thermometer Decoder
Easy · Combinational · SystemVerilog
Thermometer (a.k.a. unary) coding is frequently used in digital systems applications to represent a natural number. In a thermometer code, a binary number is represented by a $2^N$-bit digital word with value $m$, which has $m$ zeros followed by $(N - m)$ ones or vice-versa.
In this question, implement a binary to thermometer decoder module, where the input {din} is a binary word, and the output {dout} is the thermometer code representation of the input at any time.