module top_module ( input sel, input [7:0] a, input [7:0] b, output [7:0] out ); wire sel_n = ~sel; assign out = ({8{sel_n}} & b) | ({8{sel}} & a); endmodule