Questions tagged [number-systems]

Representations of numeric values in decimal, binary, octal, hexadecimal, and other bases; one's-complement and two's-complement signed numbers; scientific notation; floating-point numbers in digital computers; history of number systems; nonstandard number systems; algorithms for arithmetic within specific number systems or for conversions between number systems.

Number systems provide systematic ways to write numeric values such as the (base-ten) numbers $289$ or $2.125$. Some questions with this tag involve algorithms for converting base-ten numbers to or from another number system; conversions between other number systems; algorithms to perform arithmetic (addition, subtraction, multiplication, etc.) within a specific number system without converting the operands to base ten; symbols for writing numbers in systems other than base ten; ancient number systems (such as Roman numerals) and the historical development of number systems; and specialized or unusual number systems.

A base-$b$ number system represents an integer as a sequence of digits, each of which is an integer such that $0 \leq d < b$. Ordinary decimal numbers are written in base ten; other well-known bases include binary (base $2$), octal (base $8$), and hexadecimal (base sixteen). Optionally, the base or radix, $b$, may be appended as a subscript. The value of such a numeric representation is

$${\left(d_m d_{m-1} \cdots d_2 d_1 d_0\right)}_b = d_m b^m + d_{m-1} b^{m-1} + \cdots + d_2 b^2 + d_1 b^1 + d_0 b^0.$$

For example, $21_{16} = 33_{10} = 41_8 = 100001_2$, representing the same value as hexadecimal, decimal, octal, and binary numbers, respectively. The factors $b^0$, $b^1$, $b^2$, and so forth are the place values of the digits. A base-$b$ number with a fractional part is written by appending a decimal point and digits with place values $b^{-1}$, $b^{-2}$, $b^{-3}$, and so forth; for example, $$101.011_2 = 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0 + 0\cdot2^{-1} + 1\cdot2^{-2} + 1\cdot2^{-3} = 4 + 1 + \frac14 + \frac18 = 5.375_{10}.$$

In a mixed-radix number system, such as the factorial number system, the ratio between the places value of two digits depends on their distances from the decimal point. A number system can have a negative radix, for example the negabinary number system, which has the radix $-2$.

Digital computing has raised interest in various other number systems. In an $n$-digit $b$'s-complement base-$b$ representation, the integer $-x$ is represented by $b^n - x$, whereas in a $(b-1)$'s complement representation, $-x$ is represented by $(b^n - 1) - x$. Computers often use two's-complement (or sometimes one's-complement) binary numbers.

Very large or small numbers can be written in scientific notation, for example $1.234 \times 10^9$. Floating-point numbers in digital computers, typically using the IEEE 754 standard, serve a similar purpose.

More esoteric number systems of interest in computer science include:

  • Balanced base-$b$ number systems, which use both positive and negative digit values. The balanced ternary (base $3$) system with digit values $\{-1,0,1\}$ is an example of this kind of number system.
  • Redundant base-$b$ systems, which allow more than $n$ values of each digit. There may be many ways to represent a given number in such a number system.
  • Residue number systems, in which each digit position is assigned a fixed modulus and the digit in that position is the remainder when the number's value is divided by that modulus.

Other possible numbering systems include the Fibonacci base system and systems using a non-integer radix such as the $\phi$ number system.

949 questions
0
votes
3 answers

Expressing a number in the least possible space

I need to express a list of integers in a book, all falling between 1 and about 50,000, but I have limited space to print them. For e.g. "300009" takes up 6 characters. Put simply, I need to save paper. I'd like to either find a way to reduce the…
Village
  • 203
0
votes
1 answer

Can we construct a number system in which **all** (uni-variable) equations can be solved?

$\mathbb{C}$ is nice and safe, in that it's algebraically closed, so we can solve all polynomials in $\mathbb{C}$, but there are still equations that cannot be solved in this set. I'm wondering: Can we construct a set of numbers in which all…
beep-boop
  • 11,595
0
votes
0 answers

A property/result which does seem to be dependent on number system but is independent.

Would you tell a property/result which does seem to be dependent on the number system(base) but is independent of the number base?
0
votes
2 answers

Convert from Quaternary to Hexadecimal

I have the number (23011) in Quaternary and I have to convert it to Hexadecimal. Tried looking up for help online, but other convertors who convert the number without any explanations how it's done manually... any help is appreciated.. thank you.
0
votes
2 answers

Are the extra digits for Base 32 and Base 64 standardized?

Hexadecimal is widely recognized with A - F as the digits beyond nine. However, what about bases with even more digits, such as Base 32 and Base 64? For Base 32, you could simply continue the alphabet, but what about Base 64, when you run out? Even…
0
votes
1 answer

Conversion Octal to Hexa

How is made the conversion to Hexadecimal by Octal? I know there is a method that is converting to binary and after to octal. There's another? How it works? What is the name of this conversion procedure?
richardaum
  • 279
  • 1
  • 3
  • 12
0
votes
2 answers

Convert HEX to BIN

How to convert the number $fada.cafe_{16}$ to binary? I used Wolfram understand it, but when I type $fada.cafe_{16}$, it changes to $fada.cafdfffffd..._{16}$. Why that?
richardaum
  • 279
  • 1
  • 3
  • 12
0
votes
1 answer

Divisibility test for any arbitrary number n

Does there exist any generalised method for devising a test of divisibility for any number. I have found a method and am interested in doing further research in this area. I want confirm whether any such method already exists.
0
votes
1 answer

Modern Definition of the Real Numbers

I have been told: "The real numbers are defined to be the set of equivalence classes of pairs of rational sequences $(a_i,b_i)$, where (1) $\{a_i\}$ is increasing, (2) $\{b_i\}$ is decreasing, (3) for each $i=1,2,..., \hspace{2mm} b_i-a_i>0$, and…
UserX
  • 651
0
votes
1 answer

Multiplication of negative numbers is always positive

Show that Multiplication of negative numbers is always positive eg. (-1)*(-1)=1
SHIV
  • 1
0
votes
2 answers

How to represent a decimal number in ternary or base $3$ number system?

I need to convert a decimal number into base $3$ number. $47_{10} ~~\mbox{is}~~ 1202_{3}$. But how do you represent a negative number in base $3$ notation like $-297$? please include a example
0
votes
2 answers

How can I demonstrate that the decimal equivalent for a binary number consisting of $n$ $1$'s is $2^n-1$?

I know that $2^n-1$ gives you the decimal equivalent for any word consisting of $n$ $1$'s, but how can I demonstrate that in general terms for any word of $n$ $1$'s?
EMPV
  • 21
  • 2
0
votes
2 answers

Question about the formula for switching bases of numbers

To express the base $10$ number $5213$ in base $7$, all I have to do is simply divide by $7$ as follows: $5213 \div7=744$ with remainder $5$ $744\div 7=106$ with remainder $2$ $106\div7=15$ with remainder $1$ $15 \div7=2$ with remainder $1$ Hence…
0
votes
1 answer

Converting a number from base3 to base2 without going through base 10.

Could anyone guide me on how to directly convert a number from base 3 to base 2 without using base 10? For example, converting "2101" (base 3) directly to base 2. Any suggestions, method or algorithms would be greatly appreciated. Thanks in advance!
a.moussa
  • 103
0
votes
1 answer

Number systems and ring Theory

Are different base number systems defined as separate rings or single ring e.g Z? asking question in other words decimal numeral system different fundamentally from unary or binary or ternary or any other? wiki says that even fractions can be used…
Sage
  • 9
  • 2