






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Electrical Engineering Department New Mexico Institute of Mining and Technology Socorro, New Mexico, USA
Introduction Conversion ASCII
Introduction Conversion ASCII
Introduction Conversion ASCII
Introduction Conversion ASCII
Introduction Conversion ASCII
unsigned char x , tmp ;
tmp = x / 10; d1 = x % 10; //least significant digit d2 = tmp % 10; //middle digit d3 = x / 10; //most significant digit
Introduction Conversion ASCII
Introduction Conversion ASCII
unsigned char x ; unsigned char hexnum = 0 x56 ; unsigned lsb_digit , msb_digit ;
x = hexnum & 0 x0F ; //grap the lower 4 −bits lsb_digit = x | 0 x30 ; //convert lsb to ascii
x = hexnum & 0 xF0 ; //grap the upper 4 −bits x = x > >4; //shift to lower 4 −bits msb_digit = x | 0 x30 ; //convert msb to ascii
Introduction Conversion ASCII