Lab #2a: IP Addresses - samuel-richardson/Sam-Tech-Journal GitHub Wiki
Convert from decimal to binary
First find the highest power of 2 that fits into the decimal number and record it. Next subtract this number from the decimal number. Repeat step one with this new number and so one. Place these numbers to correspond to their binary equivalents. For example, 37 would be 32 + 4 + 1 there fore 37 would be 100101
Convert from hexadecimal to binary
The easiest way to convert from hexadecimal to binary is to simple input the 4 bit binary equivalent of that hex value to the same location. For example, taking 0xFE to binary would be 11111110.
Convert from binary to hexadecimal or decimal
To convert binary to hexadecimal pad the binary number with 0 so that it is composed of bits of 4. Next input the corresponding hexadecimal values for each of those bits giving the hexadecimal conversion. For example, 11111111 would be 0xFF. To convert from binary to decimal start at the right most digit and raise 2 the position of the number in the binary number starting with a power of zero and increasing from right to left. If the digit in the binary number is 0 multiple it by 0 and if it is 1 multiply it by one and then add all the numbers from the digits in binary.