function b = binario(n)
    b = "";
    while (n > 0)
        c = "0" + mod(n,2);
        b = [b c];
        n = fix(n / 2);
    end
    i = 1;
    while (i <= length(b) / 2)
        tmp = b(i);
        b(i) = b(length(b) + 1 - i);
        b(length(b) + 1 - i) = tmp;
        i = i + 1;
    end
end
