ASCII symbol 'K' has the binary code 01001011.
Reading right-to-left, each bit has the following value:
bit 0 = 1 = 2^0 * 1 = 1 * 1 = 1
bit 1 = 1 = 2^1 * 1 = 2 * 1 = 2
bit 2 = 0 = 2^2 * 0 = 4 * 0 = 0
bit 3 = 1 = 2^4 * 1 = 8 * 1 = 8
bit 4 = 0 = 2^8 * 0 = 16 * 0 = 0
bit 5 = 0 = 2^16 * 0 = 32 * 0 = 0
bit 6 = 1 = 2^32 * 1 = 64 * 1 = 64
bit 7 = 0 = 2^64 * 0 = 128 * 0 = 0
1 + 2 + 0 + 8 + 0 + 0 + 64 + 0 = 75
Therefore 01001011 is the binary encoding for the decimal value 75.
Thus ASCII symbol 'K' has the decimal value 75
Working the other way, we divide the decimal value by 2. The remainder can only be 0 or 1 and we write this remainder down. We continue dividing by 2, writing a 0 or a 1, until the decimal value is 0. We then pad any remaining bits with 0s. Like so:
75 / 2 = 37 r 1
37 / 2 = 18 r 1
18 / 2 = 9 r 0
9 / 2 = 4 r 1
4 / 2 = 2 r 0
2 / 2 = 1 r 0
1 / 2 = 0 r 1
Reading from the bottom up, the remainders are 1001011, which we pad with a leading zero to create the binary value 01001011. Note that we typically use leading zeroes when the number of bits is not an exact multiple of 8, thus creating a binary value of one or more 8-bit bytes.
Another way to do the conversion is to use hexadecimal notation. Hexadecimal makes it much easier for humans to interpret binary values because there are 16 digits (0-9 then A-F) and each digit represents a unique 4-bit binary pattern:
0x0 = 0000
0x1 = 0001
0x2 = 0010 0x3 = 0011
0x4 = 0100
0x5 = 0101
0x6 = 0110
0x7 = 0111
0x8 = 1000
0x9 = 1001
0xA = 1010
0xB = 1011
0xC = 1100
0xD = 1101
0xE = 1110
0xF = 1111
From this we can see that 01001011 is formed from 4-bit patterns 0100 and 1011, which from the table above equates to 0x4 and 0xB respectively. Thus binary 01001011 is equivalent to 0x4B in hexadecimal.
0xB has the decimal value 11 while 0x4 has the decimal value 4. However, as with decimal, the position of the digit is significant. Instead of increasing powers of 10 we are dealing with increasing powers of 16, thus 0x4B really means 11 x 16^0 + 4 x 16^1, which reduces to 11 x 1 + 4 x 16 or simply 11 + 64 = 75.
Working the other way, we divide the decimal value by 16 and use the remainder to determine the hex digit:
75 / 16 = 4 r 11
4 / 16 = 0 r 4
11 in hexadecimal is B, thus 75 in hexadecimal is 0x4B.
From the table above, we see that 0x4 is 0100 and 0xB is 1011, thus 75 = 0x4B = 01001011.
From this we can see that converting decimal to any base is simply a matter of repeatedly dividing by the base and taking the remainder. If the base is greater than 10, we convert that remainder to its corresponding digit.
Converting the other way (to decimal) we need to know the positional value of each significant digit and that is always an increasing power of the base, starting from 0 in the least-significant position.
Copyright © 2026 eLLeNow.com All Rights Reserved.