Base Conversions

Converting numbers between different Base Numbering Systems

The purpose of this exercise is for the student to gain familiarity with numbers that are not in base 10 (decimal). Computers do all of their operations with binary digits, or bits, which can take on a value of 0 or 1; this is base 2, or binary. Many programs display values in base 16, or hexadecimal. This exercise will help students to understand the different bases and how they are used.

This exercise will involve converting numbers between various bases, namely base 2 (binary), base 10 (decimal), and base 16 (hexadecimal). Be sure to read the course materials on this subject before working this exercise!

It is important to be able to "think" in different numeric bases in order to work with computers. Computers do their internal operation in binary. Humans count using decimal numbers. Since binary in cumbersome to use, hexadecimal (aka hex) is used as shorthand for expressing binary!

In this exercise, you will convert numbers between the following bases: 2 (binary), 10 (decimal), and 16 (hexadecimal)

Review the course materials and any other sources you need to solve the following six problems. Show your work, as shown in the lecture material. No one will lose points for wrong answers -- but you will lose points for not doing a problem and/or not showing your work! You should check your answers using a calculator that can handle binary and hex. Hint: in Windows and Mac OS, use the calculator application in Programmer mode.

In Windows, you can select the Calculator application by clicking the Windows icon in the lower left and choosing Calculator under Windows Accessories.

select_calculator.jpg

Then you can select "Programmer" mode located under the "View" tab.

select_programmer.jpg

That will change the Calculator application to Programmer mode in which to complete the rest of the exercise.

programmer_calc.jpg

Convert Decimal 2910 to Binary

On the calculator, select "Dec" (for decimal) and enter "29"

decimal29

Then select "Bin" for binary, and you will see "11101", however, we normally like to see binary in multiples of 4 so "11101" so we add zeros to the beginning and it becomes "0001 1101"

decimal29inBinary 

Convert Hexadecimal F0A116 to Binary

On the calculator, select "Hex" (for hexadecimal) and enter "F0A1" using the keypad on the calculator application.

decimal29

Then select "Bin" for binary, and you will see "1111000010100001", which is already in multiples of 4 so we do not need to add zeros to the beginning of the result and we are done.

Hex2BinResult.jpg 

OK! now its your turn!

Convert  Binary 110010102  to Hexadecimal

Convert Hexadecimal 8216 to Decimal

Convert Decimal 8210 to Hexadecimal

Convert Binary 110010102 to Decimal

 


Creative Commons License
CyberExplorations Exercises by Glenn S. Dardick is licensed under a Creative Commons Attribution 4.0 International License.