Home › Practice › RTL Design › A rotary switch for data
A rotary switch for data
EasyRTLcombinational
A TV has four inputs and one screen. The remote picks which input is shown.
Concept first. A multiplexer (mux) copies one of several inputs to its output. The select lines carry the number of the input you want. With 2 select bits you can choose between 4 inputs, because 2 bits count 0, 1, 2, 3. A 2-input mux needs one select bit. There are two ways to think about a 4-input mux: say what happens for each value of the select number, or build it from smaller muxes that each make one choice.
What to build.
mux4(d0, d1, d2, d3, sel): each data input is 4 bits wide,selis 2 bits.- Output
y[3:0]equalsd0,d1,d2ord3whenselis 0, 1, 2 or 3. - No clock.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.