Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] conversion from hex to decimel

Status
Not open for further replies.

wajid ali khan

Newbie level 6
Joined
Jan 1, 2015
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
66
how to convert hex data from dptr to decimel in 8051(8 bit accumulator) ......
 

I prefer to first convert it to binary and from binary to decimal.
Every Hex digit can be represented by 4 binary digits.
For example:
0xFF is binary - "1111 1111" which is 255 in decimal.
Another example-
0x12 is binary - "0001 0010" which is 18 in decimal.
 

The dptr is 16 bit and Acc is only 8 bit. You need to convert to 5 byte decimal ascii or 2.5 byte BCD format.

Which one do you prefer?

Allen

- - - Updated - - -

OK I think I misunderstood what you want. You want to convert what's in (DPTR) to decimal in Acc. But 8 bit hex would convert to 255 decimal max. So where to put the hundred digit?

Allen
 
Last edited:

thats the problem .......... @allen

- - - Updated - - -

will be very complicated
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top