"Binary decimal" is a contradiction in terms. Decimal has a base of 10, binary a base of 2 and hexadecimal a base of 16.
The way I would do it is:
If you have a value in binary then convert this to a decimal value. Then convert it to hexadecimal remembering that the number will now be comprised by the following (where x represents the digit):
The first digit (from right to left) will equal x * 160, the next will equal x * 161 and so forth...
An example:
So in binary 11111 = (1 * 20) + (1 * 21) + (1 * 22) + (1 * 23) + (1 * 24) = 1 + 2 + 4 + 8 + 16 = 31 (in decimal).
To write this in hexadecimal, 31 would be (15 * 160) + (1 * 161) = 1F
Note: A tip - If you are using a Windows operating system, then if you go to the Start menu and choose search/run and type in "calc" or "calculator" then you will get a virtual calculator to use. If you choose "programmer" from the View menu and then choose the "Bin" button and type in a binary value and then choose the "Hex" button then the binary value will be converted to hexadecimal. (The above certainly applies for Windows 7).
Chat with our AI personalities
0111 0110
I think people use the decimal system because we have 10 fingers and it's more intuitive that way. Computers use octal or hex because the base is a power of 2 (8=2^3, 16=2^4), and the computers work in binary, 0 or 1, 2 values.
ASCII for K is 0x4b = 75 = 0100 1011
Since a binary digit has only two possible values, each digit bears less information than in decimal, where each digit can have ten different values.
To represent the name "Sam" in binary code, you need to convert each letter to its ASCII value and then to binary. The ASCII values for 'S', 'a', and 'm' are 83, 97, and 109, respectively. In binary, these values are represented as: 'S' = 01010011, 'a' = 01100001, and 'm' = 01101101. Therefore, "Sam" in binary code is 01010011 01100001 01101101.