Difference between revisions of "Number Systems/Alternative Bases"

From Coder Merlin
(Created page with "== Number Base == The '''radix''' or '''base''' is the number of unique digits, ''including zero'', used to represent numbers in a positional numeral system. The base is norma...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Number Base ==
{{MerlinVideoPlayer|videoID=Qt00l84qodw9HgMleNUDGbGodO00SxI01SLWH800FNPWbYM|videoTitle=Interpreting Numbers Based upon Digit Position}}
 
=== Number Base ===
The '''radix''' or '''base''' is the number of unique digits, ''including zero'', used to represent numbers in a positional numeral system. The base is normally written as a subscript to the right of the number. For example, the decimal number 123 would formally be written as (123)<sub>10</sub><br />
The '''radix''' or '''base''' is the number of unique digits, ''including zero'', used to represent numbers in a positional numeral system. The base is normally written as a subscript to the right of the number. For example, the decimal number 123 would formally be written as (123)<sub>10</sub><br />
Note that the parentheses are sometimes not written: 123<sub>10</sub><br />
Note that the parentheses are sometimes not written: 123<sub>10</sub><br />
In the case of decimal (base 10) numbers, the subscripted 10 is often assumed and not written.
In the case of decimal (base 10) numbers, the subscripted 10 is often assumed and not written.


== Decimal System ==
=== Decimal System ===
The decimal system is the system with which we are most familiar. It is a decimal system because it contains ten unique digits:<br />
The decimal system is the system with which we are most familiar. It is a decimal system because it contains ten unique digits:<br />
<pre>
<pre>
Line 12: Line 14:
For any (integer) value larger than 9, we’re required to use positional notation. Please keep in mind that “10” is not a digit. Rather, it’s a number consisting of two digits, a “1” in the tens (10<sup>1</sup>) position and a “0” in the ones position (10<sup>0</sup>).
For any (integer) value larger than 9, we’re required to use positional notation. Please keep in mind that “10” is not a digit. Rather, it’s a number consisting of two digits, a “1” in the tens (10<sup>1</sup>) position and a “0” in the ones position (10<sup>0</sup>).


== Octal System ==
=== Octal System ===
The octal system uses eight unique digits to represent a number:<br />
The octal system uses eight unique digits to represent a number:<br />
<pre>
<pre>
Line 38: Line 40:
2,525<sub>10</sub>
2,525<sub>10</sub>


== Hexadecimal System ==
=== Hexadecimal System ===
The hexadecimal (six and ten) uses sixteen digits to represent a number:<br />
The hexadecimal (six and ten) uses sixteen digits to represent a number:<br />
<pre>
<pre>
Line 66: Line 68:
46,492<sub>10</sub>
46,492<sub>10</sub>


== Binary System ==
=== Binary System ===
The binary system (two) uses two digits to represent a number:<br/>
The binary system (two) uses two digits to represent a number:<br/>
<pre>
<pre>
Line 90: Line 92:
128<sub>10</sub> + 0<sub>10</sub> + 32<sub>10</sub> + 16<sub>10</sub> + 8<sub>10</sub> + 0<sub>10</sub> + 2<sub>10</sub> + 0<sub>10</sub> =<br/>
128<sub>10</sub> + 0<sub>10</sub> + 32<sub>10</sub> + 16<sub>10</sub> + 8<sub>10</sub> + 0<sub>10</sub> + 2<sub>10</sub> + 0<sub>10</sub> =<br/>
186<sub>10</sub>
186<sub>10</sub>
<noinclude>{{MerlinMultipageExperienceNavBar}}</noinclude>

Latest revision as of 18:08, 28 December 2021

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Interpreting Numbers Based upon Digit Position

Number Base[edit]

The radix or base is the number of unique digits, including zero, used to represent numbers in a positional numeral system. The base is normally written as a subscript to the right of the number. For example, the decimal number 123 would formally be written as (123)10
Note that the parentheses are sometimes not written: 12310
In the case of decimal (base 10) numbers, the subscripted 10 is often assumed and not written.

Decimal System[edit]

The decimal system is the system with which we are most familiar. It is a decimal system because it contains ten unique digits:

0 1 2 3 4 5 6 7 8 9

For any (integer) value larger than 9, we’re required to use positional notation. Please keep in mind that “10” is not a digit. Rather, it’s a number consisting of two digits, a “1” in the tens (101) position and a “0” in the ones position (100).

Octal System[edit]

The octal system uses eight unique digits to represent a number:

0 1 2 3 4 5 6 7

Let’s consider the value of an octal number: 47358

What is the decimal value of this number? We use exactly the same method that we use for knowing the value in any system:

Digit at position: 4 7 3 5
Position multiplier: 83 82 81 80
Position value: 4 • 83 7 • 82 3 • 81 5 • 80
2048 448 24 5

Note that in this case, the right-most digit is, as always, representative of units (ones), just as in any positional system. However, moving one digit to the left, because we’re now using an octal system, the position indicates the number of eights (not tens). The next position to the left indicates the number of sixty-fours (not hundreds) and the final position indicates the number of 512’s. As before, we multiply each digit by its corresponding position multiplier to obtain the value of the entire number:

4 • 83 + 7 • 82 + 3 • 81 + 5 • 80 =
2,04810 + 44810 + 2410 + 510 =
2,52510

Hexadecimal System[edit]

The hexadecimal (six and ten) uses sixteen digits to represent a number:

0 1 2 3 4 5 6 7 8 9 A B C D E F

Note that because we only have ten digits in our familiar decimal system, we use the letters A through F to represent the additional six digits in the hexadecimal system. Remember that these are digits, that is, A represents 10, B represents 11, and so on up to F which represents 15.

Let’s consider the value of a hexadecimal number: B59C16

What is the decimal value of this number?

Digit at position: B 5 9 C
Position multiplier: 163 162 161 160
Position value: B • 163 5 • 162 9 • 161 C • 160
45,056 1280 144 12

As always, we multiply each digit by its corresponding position multiplier to obtain the value of the entire number:

B • 163 + 5 • 162 + 9 • 161 + C • 160 =
45,05610 + 128010 + 14410 + 1210 =
46,49210

Binary System[edit]

The binary system (two) uses two digits to represent a number:

0 1

Let’s consider the value of a binary number: 1011 10102
What is the decimal value of this number?

Digit at position: 1 0 1 1 1 0 1 0
Position multiplier: 27 26 25 24 23 22 21 20
Position value: 1 • 27 0 • 26 1 • 25 1 • 24 1 • 23 0 • 22 1 • 21 0 • 20
128 0 32 16 8 0 2 0

Multiplying each digit by its corresponding position multiplier to obtain the value of the entire number:

1 • 27 + 0 • 26 + 1 • 25 + 1 • 24 + 1 • 23 + 0 • 22 + 1 • 21 + 0 • 20 =
12810 + 010 + 3210 + 1610 + 810 + 010 + 210 + 010 =
18610