Binary to Thermometer Decoder
Easy · Combinational · SystemVerilog
Implement a binary to thermometer decoder module, where the input {din} is an $N$-bit binary word and the output {dout} is the $2^N$-bit thermometer code representation of the input at any time.
Thermometer (a.k.a. unary) coding is frequently used in digital systems to represent a natural number. The thermometer code of a value $m$ on a $2^N$-bit word sets the lowest $m$ bits to 1 and all remaining bits to 0, like mercury rising from the bottom of a thermometer.