module top_module(input a, input b, output y);
assign y = a;
assign y = b;
endmodule
โ ๏ธ Important Note: Multiple Drivers on a Wire
In this example, the wire y is driven by two continuous assignments:
assign y = a; assign y = b;
๐ What happens?
y takes that value.x (unknown).โ Best Practices for Real Designs
assign y = a & b; or assign y = a | b;assign y = sel ? a : b;z) carefully with arbitration.๐ Takeaway: In clean designs, each wire should have exactly one driver. Multiple drivers are for special cases only (like testbenches or controlled tri-state buses).