Yes. If none of the coefficients of powers is greater than 1 (i.e., if you don't have sums like 3 * (2^1) + 2^3), then the easiest thing in a language like C is to use bit operators to reveal individual bits. For example, to find the coefficient of 2^3 (0 or 1) you can use (mode >> 3) & 1 (this needs to be checked).