An actual solution that logic can be implemented by any programming language:
If you sure it is positive only:
var aout = 0;
var n = 12; // your input
var m = 1;
while(n) {
aout = aout + n%2*m;n%2 * m;
n = Math.floor(n/2);
m = m*10;m * 10;
}
console.log(n, ':', aout) // 12 : 1100
If can negative or positive -
(n >>> 0).toString(2)