PPI Typhoon
DIY Madman
kwick6 said:kwick6 said:understand the 68 decimal, becoming 11.9, but what the %&^* is "$44" and where did that come from?
http://www.jaworski.com/htmlbook/dec-hex.htm
Just found this.
I don't think I'd want to do the conversions in my head.
I'm glad you mentioned the 0x representing the hex also, didn't know that.
I'm not quite sure how the two hex digits represent the 8 bit byte, but I was trying to figure this out...
Binary refers to base two or a two-state digit called a bit. A bit is either on or off - represented as a '1' for on (the set state) and '0' for off (the cleared state). Eight bits together form a byte and are written as 00110101b (or sometimes %00110101). The 'b' stands for binary, and lets you know that we aren't talking about 110,101, the decimal number. A byte or multiples of bytes set the register size for microcomputers. Hexadecimal (hex) is a base 16 way of representing one byte. Hexadecimal uses the digits 0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F. A byte requires just 2 hex digits. Thus, FFh is a two hex digit representation of a byte. FFh is the same as 11111111b (the little 'h' designates a hexadecimal value sometimes a preceding '$' is used as in $FF)
How is the FF the same as 11111111b?
Thanks,
Scott
When converting Hex to binary, or vice versa, break the HEX into single digits, and binary up into chunks of four.
F=1111
F=1111
So if you had 11110101
That would be 1111 0101
Which comes to F 5
So F5h = 11110101b
That's the really easy way of doing it, rather than drawing it out with all the exponential values. The same goes for converting it back.
Let's say you have.....16h well
1= 0001
6= 0110
so 16h=00010110, but take the extra 0's away in the leading edge..
10110b=16h
To just explain why a single Hex Digit represents 4 bit binary....
In this list, the first number is decimal, then hex, then binary
0=0=0000
1=1=0001
2=2=0010
3=3=0011
4=4=0100
5=5=0101
6=6=0110
7=7=0111
8=8=1000
9=9=1001
10=A=1010
11=B=1011
12=C=1100
13=D=1101
14=E=1110
15=F=1111
It's easy when doing hex-bin hex-dec sucks because having to do the conversions.
But if you memorize binary up to 16, you can do hex-bin conversions really easily.