Number Systems

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Curriculum[edit]

ExercisesIcon.png
 Coder Merlin™  Computer Science Curriculum Data

Unit: Numbers

Experience Name: Number Systems (W1011)

Next Experience: ()

Knowledge and skills:

  • §10.311 Demonstrate proficiency in the use of positional notation to represent and convert between numbers in the binary, octal, decimal, and hexadecimal systems

Topic areas: Positional notation

Classroom time (average): 60 minutes

Study time (average): 180 minutes

Successful completion requires knowledge: understand positional notation

Successful completion requires skills: ability to use positional notation to represent numbers in the binary, octal, decimal, and hexadecimal systems; ability to convert between representations of numbers in the binary, octal, decimal, and hexadecimal systems

Experience[edit]

This is a multi-page experience, consisting of the following pages. Be sure to visit them all in sequence. A navigation bar at the bottom of each page is available to assist you.


[[Number Systems/Alternative Bases, Number Systems/Conversions from Decimal, Number Systems/Conversions to Decimal, Number Systems/Customs, Number Systems/Formal Representation, Number Systems/Positional Notation, Number Systems/Shortcut Conversions<ul><li>"]]" is not a number.</li> <!--br--><li>Some use of "" in your query was not closed by a matching "".</li></ul>|« Prior]]Number Systems : 1 of 7Next »


Customs[edit]

  • It is customary to separate groups of three decimal digits by commas. For example: 123,45610.
  • It is customary to separate groups to two hexadecimal digits by spaces and prefix a leading zero to what would otherwise be a single digit. For example: 01 2F16.
  • It is customary to separate groups of three octal digits by spaces and prefix leading zeros to pad to a three digit grouping. For example: 001 2378.
  • It is customary to separate groups of four binary digits by spaces and prefix leading zeroes to pad to a four digit grouping. For example: 0001 1011 11002.

Shortcut Conversions[edit]

Because both the octal and hexadecimal bases contain and possible digits, respectively, and the binary base contains possible digits, we're able to utilize a shortcut when converting between these systems. Note that each octal digit is comprised of three binary digits and each hexadecimal digit is comprised of four binary digits. We can therefore establish (and memorize) the following table:

Decimal Binary Octal Hexadecimal
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F

The shortcut is very straight-forward yet a significant time saver and based on the above information. When converting between binary, octal, and hexadecimal, there's no need to use an intermediate, decimal step.

Binary to Hexadecimal[edit]

Group the binary number in sets of four digits, from right to left. Each binary set represents a single hexadecimal digit. (It's sometimes helpful to pad the final set with zeroes.) For example, given the number , regroup the binary digits in sets of four:


.

Then, use the memorized table to translate each set of four binary digits to a single hexadecimal digit:

1100 0111 0010 0101
C 7 2 5

Hexadecimal to Binary[edit]

Simply follow the above procedure in reverse. Use the memorized table to convert each hexadecimal digit to a set of four binary digits.

Binary to Octal[edit]

Group the binary number in sets of three digits, from right to left. Each binary set represents a single octal digit. (It's sometimes helpful to pad the final set with zeroes.) For example, given the number , regroup the binary digits in sets of three:


.

Then, use the memorized table to translate each set of three binary digits to a single octal digit:

001 100 011 100 100 101
1 4 3 4 4 5

Octal to Binary[edit]

Simply follow the above procedure in reverse. Use the memorized table to convert each octal digit to a set of three binary digits.

Octal to Hexadecimal (and vice versa)[edit]

This requires slightly more work. Convert the number in the source base to binary, and then convert from binary to the target base.

Exercises[edit]

Template:W1011-Exercises



References[edit]


Experience Metadata

Experience ID W1011
Next experience ID
Unit Numbers
Knowledge and skills §10.311
Topic areas Positional notation
Classroom time 60 minutes
Study time 3 hours180 minutes <br />
Acquired knowledge understand positional notation
Acquired skill ability to use positional notation to represent numbers in the binary, octal, decimal, and hexadecimal systems
ability to convert between representations of numbers in the binary, octal, decimal, and hexadecimal systems
Additional categories