|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
demcimal number to hex number
Could anyone teach me how to convert decimal number to hex number?
such as 5 in hex is 0x35(0011 0101) Thank you all! I mean in real life,how to calculate,not with php function! |
|
#2
|
|||
|
|||
|
RE: demcimal number to hex number
thats not five in hex.
five in hex is five. (0000 0005) Hex goes like this: 0-9 are still the same. Once you get to ten, it becomes the letter a. Ten is 0000 000A in hex. then you use the letters A-F (thats 10-15) So, 15 would be 0000 000F. After we fill that up, we have to start using the next placeholder. 16 is hex 0000 0010, 17 is 0000 0011, and so on and so on. EDIT:What you are talking about with the 0x35 being five, thats the ascii hexidecimal value for the number five, but its not hex for the number 5 0x35(0011 0101): This is the binary notation for 35. this is the way this works: each single number gets 4 0's. SO we have: 3 = 0011 and 5 = 0101. Each 1 in the sequence represents a number that is switched on. for the four numbers, either ones or zeros, they represent a different number. if I have the four numbers in the sequence, the numbers are represented as: last zero is the number 1 third zero is the number 2 second zero is the number 4 and the first zero is the number 8. For the number three, we have: 0011. 0+0+2+1=3 For the number five, we have: 0101. 0+4+0+1=5 Any clearer? Theres a quick reference of all of the ascii characters and there hex, binary values at: http://www.asciitable.com/ |
![]() |
| Viewing: Codewalkers Forums > General > General Chat > demcimal number to hex number |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|