← ProblemsVerification: Reading Simulations / Finding bugs in code

Mux

36%debuggingmuxvectors

This 8-bit wide 2-to-1 multiplexer is supposed to output a when sel is 0 and b when sel is 1. Unfortunately, the code below doesn't work — find and fix the bug(s).

Hint for debugging: think carefully about what each operator does when its operands have different widths.