8051 | Program to convert Hexadecimal to BCD | Bharat Acharya Education

preview_player
Показать описание
Bharat Acharya Education

🎓 Courses for you
8085, 8086, 8051, ARM7, COA, C Programming, 80386, Pentium

✅ Full video lectures
✅ Topic-wise PDFs
✅ VIVA Qs / MCQs
✅ Certification
✅ Doubt solving on WhatsApp

Duration: 6 months
Course Fee: 1499/-
Start Learning... NOW ✅

Website:

#bharatacharya #cprogramming #pointersinc
#pointers #linkedlist #linkedlists #leaked
#dsa #dsalgo #datastructures #gateexam
#8086 #8051 #8085 #80386 #pentium
#microprocessor #drive #microcontrollers
#bharatacharyaeducation
#bharatacharyafree #free
Рекомендации по теме
Комментарии
Автор

Thank you for the explanation. This was helpful!

One thing that confused me that I had to learn was about the Modulus Operator in C (%). This is where you get your remainder from, which is really important for this tutorial. Once I learned that I had to do TWO operations to get the result, this tutorial made much more sense. You have to do something like this in C:

int HexToBCD (int HexIn) // **Note that the input HEX byte should be 0x63 or less.
{
int result; // Register to hold what we calculated

// **For Testing**
HexIn = 0x5B, // Force the input value to 0x5B for the heck of it, so this is what you will be converting


result = (HexIn / 10); // This is where you get the result for the tens place, result will equal 9
result = (result << 4); // Shift the result into the upper nybble for the tens place, so result will now equal 90
result = (result + (HexIn % 10)); // The result of the (HexIn % 10) will be 1, and that will be your ones place. The result register will now contain "91", which is the correct Hex to Base10 conversion. 0x5B = 91d
return(result);
} // End of the HexToBCD function

I hope that this helps someone else that may be struggling with this same detail 🤓

HonortronicsInc
Автор

Video link of BCD to hex conversion ??

pritamganguly
Автор

Sir please tell me division of two bcd numbers in 8051 please 😭 . I am unable to do it sir

studywithteja
Автор

HOW TO CONVERT FFF INTO DECIMAL
IS THERE ANY DIFFERENT LOGIC EXCEPT DIVIDING THE NUMERATOR BY 10, 100, 100 BECAUSE I WANT TO PRINT THE HIGH BYTE AND LOW BYTE OF ADC IN 7 SEGMENT INTERFACING IN 4 PORTS

SatyamSingh-iwvt
Автор

So, basically we are taking decimal and storing it as decimal...

lovetolearn