if((MDI)&0x01) 
{ 
   //input bit 
} 
else 
{ 
   //input 0 
}