function m = binaryCombinations(bits)
m = repmat((1:2^bits)',1,bits)-1;
for bit = 1:bits,
	m(:,bit) = bitand(m(:,bit), (2^(bits-bit)))>0;
end
