I was trying to concatenate 3 2-to-1 AND gates to get a 4-to-1 AND gate using a more behavioral design. I keep getting errors, and I can't get a module to compile.
Can someone help ? (I am aware of the possibility of using y = &x, but I was trying a different method :))
module and4_gateb(x, y);
input [3:0] x;
reg y;
output y;
integer i;
y = x[0];
initial begin
for(i=1; i<4; i= i+1) begin
y = y&x[i];
end
end
endmodule
