??? 04/05/04 07:44 Read: times |
#67938 - RE: division by large no Responding to: ???'s previous message |
I normally do it using a 32 bit divide. Do a search and you'll find one. I got mine from an intel app note and it uses the old subtract and shift method. To convert the binary result to bcd suitable for display I use an algorithm I got off the Microchip web site for binary to bcd conversion. It uses a modified division routine to do its magic. You can expand this routine to as many bits as you like. Once the binary number is converted to bcd, you just add the ascii offset (0x30) to each bcd digit to make it a ascii number the output to the lcd. Sounds simple doesn't it? I'm sorry I don't have any sample code in 8051 at the office - only AVR! |
Topic | Author | Date |
division by large no | 01/01/70 00:00 | |
RE: division by large no | 01/01/70 00:00 | |
RE: division by large no | 01/01/70 00:00 | |
RE: division by large no | 01/01/70 00:00 | |
RE: division by large no | 01/01/70 00:00 | |
RE: division by large no | 01/01/70 00:00 | |
division by large no | 01/01/70 00:00 | |
RE: division by large no | 01/01/70 00:00 | |
division by large no | 01/01/70 00:00 | |
Back to basics - Ali![]() | 01/01/70 00:00 |