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.

how to convert hex to dec value.

Status
Not open for further replies.

Arunkumar.s

Newbie level 1
Joined
Dec 10, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
I want to convert hex to dec using PIC. Thing that I want to do is that:

I have 24 byte (like FFFFFF, 800000, 000000) in three register in PIC .
Converting of FFFFFF to decimal result is +4.096.
Converting of 800000 to decimal result is 0.
Converting of 000000 to decimal result is -4.096.

FFFFFF is the positive full scale of +4.096,
000000 is the negative full scale of -4.096,
800000 is the middle value of the scale 0.

I want to write this convertion result to PIC's registers.
How can I do that?

Help me to solve tis problem...
 

It's not clear, if you want to convert the input number to a float or fixed point value, or to a decimal string? In case of fixed point or decimal string, is three fractional digits the intended resolution? 24 Bit has 6 to 7 significant decimal digits.

As a first step you need to convert the 24 bit value from offset binary to 2s complement by inverting the MSB (number ^ 0x800000), then scale it down to the intended number range.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top