Skip to content
Sahithyan's S1
1
Sahithyan's S1 — Programming Fundamentals

Number Systems

A writing system for expressing numbers. Each number system defines a set of symbols that each represent a specific value.

Number of symbols defined by a number system.

  • Base 10 - 0 - 90\text{ - }9
  • Base 2 - 0,10,1
  • Base 8 - 0 - 70\text{ - }7
  • Base 16 - 0 - 9,A - F0\text{ - }9, \text{A - F}
  • Repeatedly divide the number (and the quotients) by nn until reaching 1
  • Write the remainders in reverse order
  • Repeatedly multiply by nn until fractional part reaches 0
  • Write the integer parts in normal order

Multiply each digit by its positional value, and sum those values. Positional value is nkn^k where kk is the position.

  • Split the given binary number into length 3 parts (prepend 0s if required)
  • Convert each part to octal
  • Join those together
  • Split the given binary number into length 4 parts (prepend 0s if required)
  • Convert each part to hexagonal
  • Join those together

Convert each digit to 4-bit binary and join them together.

Convert each digit to 3-bit binary and join them together.

Convert the number to base 2 or 10 and then conver to the target base.

In computing, the prefix kilo —just like other prefixes— has been used to refer either 2102^{10} or 10310^3 depending on the context.

  • 10310^3 - Marketing of disk capacities (by disk manufacturers)
  • 2102^{10} - Memory capacities, and file sizes, disk capacities by operating systems

To avoid this confusion, 2 unit prefixes are used while measuring amounts of data.

  • SI prefixes Defined by ISO. Based on powers of 10310^3. Examples: kilo, mega, giga.
  • Binary prefixes Defined by IEC. Based on powers of 2102^{10}. Examples: kibi, mebi, gibi.