Because octal and hexadecimal numeration systems have bases that are multiples of binary base 2 , conversion back and forth between either hexadecimal or octal and binary is very easy. Also, because we are so familiar with the decimal system, converting binary, octal, or hexadecimal to decimal form is relatively easy simply add up the products of cipher values and place-weights.
By continuing in this progression, setting each lesser-weight bit as we need to come up to our desired total value without exceeding it, we will eventually arrive at the correct figure:. This trial-and-fit strategy will work with octal and hexadecimal conversions, too. Trying the first few cipher options, we get:.
Can we do decimal-to-hexadecimal conversion the same way? Sure, but who would want to? This method is simple to understand, but laborious to carry out. There is another way to do these conversions, which is essentially the same mathematically , but easier to accomplish.
This other method uses repeated cycles of division using decimal notation to break the decimal numeration down into multiples of binary, octal, or hexadecimal place-weight values. Then, we take the whole-number portion of division result quotient and divide it by the base value again, and so on, until we end up with a quotient of less than 1. Published under the terms and conditions of the Design Science License. Trying the first few cipher options, we get: In this case, we arrive at a binary notation of 2.
As was said before, this repeat-division technique for conversion will work for numeration systems other than binary. If we were to perform successive divisions using a different number, such as 8 for conversion to octal, we will necessarily get remainders between 0 and 7.
For converting a decimal number less than 1 into binary, octal, or hexadecimal, we use repeated multiplication, taking the integer portion of the product in each step as the next digit of our converted number.
Take the decimal example of You May Also Like: How to Use an Arduino as a Web Server By equipping an Arduino with an Ethernet shield you can turn it into a simple web server, and by accessing that server with a browser How to Build a Robot - PCB Design Part two of a series of articles on building a robot that can follow lines or walls and avoid obstacles!
This time we'll be covering PCBMore...