b = 7 << 28; //28は適当
while( a != 0){
 if( a >= b ) a-=b;
 b = b >>1;
}