Changes

Jump to: navigation, search

ULI101 Week 4

5 bytes removed, 15:47, 31 August 2017
Binary Numbers
+ 1 x 2^0 = 1 x 1 = 1
---------------------
Sum of 8 + 4 + 0 + 1 = 13
</pre>
Remember start from the right-hand-side and move to the left. Therefore, <code>1101</code> in binary is <code>13</code> in decimal. For programmers, the 8-bit binary number <code>00001101</code> represents the unsigned integer 13.
The octal numbering system (base 8) uses 8 symbols for each digit (0, 1, 2, … 7). We can use the same process to convert an octal number to a decimal number (but use base 8 instead). Convert the octal number <code>2741</code> to decimal:
<pre class="example"> 2 x 8^3 = 2 x 5 1 2 512 = 1 0 2 41024+ 7 x 8^2 = 7 x 6 4 64 = 4 4 8448+ 4 x 8^1 = 4 x 8 = 3 232
+ 1 x 8^0 = 1 x 1 = 1
---------------------
221
edits

Navigation menu