2009年11月16日 星期一

11月16日

module and4_algo(y_out,x_in);
input [3:0] x_in;
output y_out;
reg y_out;
integer k;
always@(x_in)
begin:and_loop
y_out=1;
for(k=0;k<=3;k=k+1)
if(x_in[k]==0)
begin
y_out=0;
disable and_loop;
end
end
endmodule

沒有留言:

張貼留言