Necesitas una rutina de conversión de binario a bcd.
No indicas en que lenguaje programas. De todos modos te paso esta función para C:
Codigo:
/*******************************************************************/
/*************** RUTINA DE CONVERSIÓN BINARIO A BCD ****************/
/***** Convierte un valor BINARIO de 8bits a otro BCD de 8bits *****/
/************* El rango de entrada debe ser de 00 a 99 *************/
/*******************************************************************/
byte bin2bcd(byte valor_binario)
{
byte temp;
byte retval;
temp = valor_binario;
retval = 0;
while(1)
{
// Get the tens digit by doing multiple subtraction of 10 from the binary value
if(temp >= 10)
{
temp -= 10;
retval += 0x10;
}
else // Get the ones digit by adding the remainder.
{
retval += temp;
break;
}
}
return(retval);
}
Espero que te sirva...
Saludos!!