electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Convert 26 bit binary to BCD Routine


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Convert 26 bit binary to BCD Routine
Author Message
scdoro



Joined: 12 Jan 2005
Posts: 87


Post02 Jun 2005 3:07   

how to convert 26 in binary


Hi all,
I have problem in converting 26 bit binary to BCD using PIC 16F782 using assembly language.
I need to convert eg 2FAF080 hex to 50 000 000 dec using 4 registers casade together..
which mean 4 bytes. actually my application is to make use of timer0 as a counter to count the input freqency and store them in a 4 byte register.. then convert to BCD to be display on lcd, it may be any value up to 50M,

Can anyone pls help me on that ?
thanks a lot
Back to top
Google
AdSense
Google Adsense




Post02 Jun 2005 3:07   

Ads




Back to top
whorse



Joined: 04 Mar 2002
Posts: 74
Helped: 1


Post02 Jun 2005 9:55   

bcd routine in c


A DEC number is expressed as
Dn*10^n+...D2*10^2+D1*10^1+D0*10^0
divide the hex number with 10, the remainder is D0, then use 10 to divide the quotient again, the new remainder is D1, repeat this process, until you get all the digit. It's quite easy to implement this in C, you can write a C function, then research the assembly result.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Convert 26 bit binary to BCD Routine
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
how to convert binary to BCD or decimal in assembly (4)
10 Bit Binary to 4 Digit BCD???????? (4)
Whats the easiest way to convert Binary to BCD (8)
Binary to BCD (3)
hexkeyboard to BCD/Binary (8)
Binary to BCD question (3)
binary to bcd converter (3)
A problem with Binary to BCD conversion in C (1)
8 bits binary no. to BCD by using VHDL. (2)
want converter chip from binary to bcd (7)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS