loading

can some one convert these to binary 0x08 , 0x10 ?

are these code in hexadecimal because i can't recognise x symbol i used to work with them  long time ago. dont remember any thing clearly also i would like a formula for any more conversion in future

sort by: active | newest | oldest
iceng3 years ago
0000_0001=1
0000_0010=2
0000_0100=4
0000_1000=8
0001_0000=16
0010_0000=32
0100_0000=64
1000_0000=128

150=1001_0110=128+16+4+2
200=1100_1000=128+64+8
250=1111_1010=128+64+32+16+8+2
255=1111_1111=128+64+32+16+8+4+2+1
kelseymh3 years ago
Yes. The "0x" prefix denotes hexadecimal in C and C++.
rickharris kelseymh3 years ago
OK :-) I don't do C :-)
rickharris3 years ago
I don't see any code in your question.

But as ICENG and MP suggest converting binary to decimal or Hex or Octal isn't really hard and there are lots of on line calculators or explanations to do this.

in my experience 0 x 08 indicates octal code (base 8)
and 0 x 10 indicates decimal (base 10)
0 x 16 would indicate hexadecimal. (base 16)

Both octal and hex are simple shorthand ways to express big binary numbers

In octal you split the binary into groups of 3 binary digits each trio is considered a unique number so an octal number is made up of the decimal numbers 0 to 7 (7 being the largest decimal number you can show with 3 binary digits.

Hex is similar but uses 4 binary groups or quartets.
In this case as 4 binary digits can = up to 16 in decimal we have to contend with numbers that may be above 9 - we use the letters A, B, C D, E and F

So a hex number A= 10, B-11, C=12, D=13, E=14 and F=15

(4 binary digits = 0 to 15)
Type it into google and you'll get your answer. You can also look for binary calcs or converters that can do the conversion for you.

'0x08 to binary'