EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Hi KunalFirstly, I would like

Hi KunalFirstly, I would like

|

Microcontroller › 8051 › Give me Hex to decimal & decimal to ascii conversion › Hi KunalFirstly, I would like

December 13, 2016 at 11:15 am #14271
GANEEV SINGH
Participant

Hi Kunal

Firstly, I would like to correct you on the DECIMAL to ASCII conversion part, both of them are same stuff; ASCII is represented in decimals only. Now for the HEX to DECIMAL part, multiply each hexadecimal digit with (2^(4*pos)) where "pos" is the position of that particulat digit counting from right side with rightmost position marked zero '0'. For example:

if 0xAB45 is to be converted into decimal then its decimal equivalent would be calculated somewhat like this-

5*(2^(4*0)) + 4*(2^(4*1)) + 11*(2^(4*2)) + 10*(2^(4*3))= 43845

Hope this helps :)

RSS Recent Posts

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise