User Tools

Site Tools


hpl2:amnesia:script_language_reference_and_guide:constants_and_enumerations

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
hpl2:amnesia:script_language_reference_and_guide:constants_and_enumerations [2013/01/13 23:35]
thegreatcthulhu
hpl2:amnesia:script_language_reference_and_guide:constants_and_enumerations [2013/01/13 23:36]
thegreatcthulhu
Line 396: Line 396:
 As you can see, unlike the decimal number system, which represents all numbers using 10 different symbols (0-9), the HEX number system represents those same numbers using 16 different symbols (0-F). It just so happens that each of the HEX digits perfectly corresponds to one of all possible 4-bit combinations. Any one byte can thus be represented by 2 HEX digits - all you need to do is to refer to the table above, pick two hexadecimal digits, and write them together. To get the corresponding binary number, just replace the HEX digit with its binary equivalent from the table. As you can see, unlike the decimal number system, which represents all numbers using 10 different symbols (0-9), the HEX number system represents those same numbers using 16 different symbols (0-F). It just so happens that each of the HEX digits perfectly corresponds to one of all possible 4-bit combinations. Any one byte can thus be represented by 2 HEX digits - all you need to do is to refer to the table above, pick two hexadecimal digits, and write them together. To get the corresponding binary number, just replace the HEX digit with its binary equivalent from the table.
  
-Representing bytes using HEX system - some examples: 
 <​code>​ <​code>​
 +Representing bytes using HEX system - some examples:
 +
 +----------------------
 HEX          binary HEX          binary
 ---------------------- ----------------------
Line 406: Line 408:
  ​3A ​        0011 1010  ​3A ​        0011 1010
  ​FC ​        1111 1100  ​FC ​        1111 1100
 +----------------------
 </​code>​ </​code>​
  
hpl2/amnesia/script_language_reference_and_guide/constants_and_enumerations.txt ยท Last modified: 2015/10/06 21:06 by thegreatcthulhu