Home › Practice › RTL Design › Light up the volume bar

Light up the volume bar

EasyRTLcombinationalcodes

A 3-bit volume knob (0 to 7) drives a row of 7 LEDs. Volume 3 lights the first 3 LEDs, volume 0 lights none, volume 7 lights all.

Concept first. Binary is compact, but a bar graph needs a different code: a thermometer code, filled from the bottom like mercury in a thermometer. For 3 the thermometer is 0000111, for 5 it is 0011111. Write the thermometer for 1, 2 and 4 yourself, then look at one LED at a time: for which volumes is LED number 0 on? LED number 1? LED number 4?

What to build.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← Guard bits that find a flipElectronic dice →