if
module mux4 (sel, A, B, C, D, Y);
input [1:0] sel; // 2-bit control signal
reg Y; // target of assignment
always @(sel or A or B or C or D)
else if (sel == 2’b01) Y = B;
else if (sel == 2’b10) Y = C;
else if (sel == 2’b11) Y = D;
Same as C if statement
- Single if statements synthesize to multiplexers
- Nested if /else statements usually synthesize to logic