Jose Antonio Noda wrote: > > Hi, > > I would like convert binary numbers to decimal numbers, > and display them in a LCD display, > Please, could you help me?. Yes i do! > How could I convert binary numbers to decimal numbers, > and display them in a LCD display?. Which language? > Please, could you help me with a little source code about how to do this?. You must to sucessive divisions by 10 and hold the remainder of each division in a temporary memory, until the quocient is 0. See: 214/10 = 21 and the remainder is 4 21/10 = 2 and the remainder is 1 2/10 = 0 and the remainder is 2 ^ | | look the remainders: are the digits for display at LCD. You must to add 48 (ASCII CODE OF "0") and them you will have a printable caracter! Here two samples for you! One in C and other for 8051 assembly! Miguel. C -- void Imprime_Decimal(int N) { byte RESTO,NUMERO_DIGITO; NUMERO_DIGITO=1; while(!((N/10)==0)) /* ROTINA PARA IMPRIMIR NUMEROS COM */ { /* MAIS DE 1 DIGITO */ RESTO= N % 10; DIGITOS[NUMERO_DIGITO]=RESTO; N = N / 10; NUMERO_DIGITO++; } RESTO= N % 10; DIGITOS[NUMERO_DIGITO]=RESTO; if(NUMERO_DIGITO==1) Data_Out('0'); for(RESTO=NUMERO_DIGITO;RESTO>0;RESTO--) Data_Out(DIGITOS[RESTO]+0x30); /* TABELA ASCII NUMEROS */ } /* + 0x30 */ Assembly ---------- IMP_BYTE_lcd: PUSH ACC PUSH B PUSH H'00 MOV H'00,#0 NAO_FIM: MOV B,#D'10 DIV AB INC H'00 PUSH B CJNE A,#0,NAO_FIM IMP_DIGITO: POP B MOV A,B ADD A,#H'30 ACALL DATA_OUT ; WRITE THE VALUE OF A AT LCD DJNZ H'00,IMP_DIGITO POP H'00 POP B POP ACC RET Do you know how to initialize a display? mIGUEL. > > Regards, > Jose Antonio