function n = base4val(nbase4)
digits = size(nbase4,2);
n = 0;
for k = digits:-1:1
 n = n * 4 + nbase4(k);
end

