• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Binary, and Hex question.

jsbush

Diamond Member
How does FF (F=15) end up being 255? And how does 128 end up being a hex of 80?

How do you do the converstions from binary to hex?



Thanks.
 
to convert from hex to decimal, multiply the rightmost digit by 16^0, the second right-most by 16^1, etc etc etc.

15 * 16^0 = 15
15 * 16^1 = 240
240 + 15 = 255

to go from binary to hex, take the binary digits in groups of 4 starting from the right. convert each group of 4 to a hex value. if you have less than 4 digits left, add leading zero's.

eg:

1110100101011

1011 = 11 (B)
0010 = 2
1101 = 13 (D)
0001 = 1

1110100101011 = 1D2B
 
16 is your base. the far right place is 16^0 (ones). the left place is 16^1 (sixteens). so you have 15 sixteens (240) and 15 ones (15). that makes 255.
 
Oh ok I get it now.

8 = 1000

and

0 = 0000

so 80 equals 128 because 10000000 is 128

same with F
F = 1111
so FF = 11111111 and 11111111 is equal to 255



Thanks. 😀
 
The conversion from binary to hex is very straight forward, no need to involve decimals. 1 hex digit is 4 binary digits.

Binary__Hex
0001 __ 1
0010__ 2
0011 __ 3
0100 __ 4
0101 __ 5
0110__ 6
0111 __7
1000 __ 8
1001__ 9
1010 __ A
1011 __ B
1100 __C
1101 __D
1110__ E
1111__ F


If you have 16 binary digits break it into 4 pieces and convert each to Hex
 
What everyone is talking about is not special to binary, hexadecimal, or any other number system; rather, it's simply the place-value system, a system that's independent of the base. You can thank the precocious Babylonians for said system.
 
Took this class two semester's ago called Assemble Language. We had to write our own programs from scratch.
 
Originally posted by: Cal166
Took this class two semester's ago called Assemble Language. We had to write our own programs from scratch.

As opposed to....... instant programs? 😀 I believe you mean assembly (some call is assembler, but that's technically incorrect as well) language.
 
Back
Top