function convertToBinary(num) {
    let res=num.toString(2);
   return res.length<8?new Array(8-res.length).fill(0).join('')+res:res;
}