Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
What you need is an integer divide routine that returns the quotient and the remainder. The most significant digit is obtained by dividing the original number by 10,000 This digit will be the first of five digits in the result. Divide the remainder by 1000. The quotient will be the forth digit of the reult. Divide the remainder by 100. The quotient will be the third digit of the result. Divide the remainder by 10. The quotient will be the forth digit of the result and the remainder will be the fifth digit of the result. You cannot get more than five digits from a 16 bit quantity.
Now your problem a 32 by 32 bit divide
Same idea except now the progression of descending powers of ten starts with a larger value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.