






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This document from the New Mexico Institute of Mining and Technology covers the concept of Binary Coded Decimal (BCD) conversion for microcontrollers. what BCD is, how it differs from binary representation, and provides examples of converting binary to decimal using both C and Assembly language. It also covers the conversion of hexadecimal to ASCII.
Typology: Summaries
1 / 12
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