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
1 answer

Convert to different number base?

If I have the number: $$ 0.67 \cdot 7^{-6}$$ in base 10, what will the converted value in base $7$ be? I am finding it difficult in understand the logic of conversion, can someone give any guidance on how it works? I believe the value cant be the…
0
votes
1 answer

General rule of thumb to convert between number systems.

I would like to know what is a general rule of thumb to convert between the following number systems: Decimal Octal Hexadecimal Binary I know if I want to convert from octal to hexadecimal, I first convert the octal number to binary with groups of…
0
votes
1 answer

How to find the possible radices (bases) of two numbers such that they equal each other?

For example, suppose we have two numbers $x, y \in$ N with their corresponding bases $a$ and $b$ $ x_{a} = y_{b} $ How do you determine $a$ and $b$ such that the equation is satisfied? I tried interpreting the problem as a equation, such that each…
adamt
  • 1
0
votes
1 answer

How to get the last seven digit of a big binary number?

What are the last seven digits of binary from of $$\left(65^{2016} - 65^{2015}\right) ?$$ How can I calculate it? Also, are there any shortcut techniques?
marajul
  • 11
0
votes
0 answers

Conversion of Base-3 to Base-9 with fractional values

I have number 220111021.0021101is in Base-3, I need to convert it to base-9. How I can convert the fractional value into Base-9 using shortcut method.
0
votes
0 answers

Absolute Value with rational numbers

Recently in class we have learned how to create the number systems and have just defined the definitions of rational Null sequences and Cauchy sequences but with $- 1/k \leq x_i \leq 1/k$ terminology instead of $\epsilon$ and the use of absolute…
Partey5
  • 1,280
0
votes
0 answers

Could you recommend me a resource on study of number systems?

I tried to find some recourse on the Internet about number systems. I'd like to know about conversions between different number systems and operations with numbers within them. I tried to find it but there's only tutorials on different methods of…
0
votes
1 answer

Finding a sequence of numbers writen to any base

In a number system written to any base, how can i generate numbers in that system? For example, how can i find the first 20 numbers in a number system which has a base 7?.
Massa
  • 1
0
votes
2 answers

Name of positive decimals that contain only digits (no signs - + or fractions)

From a programing point of view, I have build a function that validates only positive numbers that contain only digits, what I mean by positive numbers is: 1, 2, 3, ... not allowed $+x$, $-x$, $x.y$, $0x$. Q: What is the best name to give this…
0
votes
1 answer

Signed-digit representations

I've been reading about signed-digit representations of numbers and I wanted to confirm that my general understanding was correct. As I understand it, a signed-digit representation allows for fast addition of integers, however as a consequence we…
0
votes
3 answers

base-52 number system conversion

I'm trying to understand number systems. Consider a base-52 number system consisted of following symbols as digits: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ synonymous to 0123456789 digits in the base-10 number system. how would we…
dsfx3d
  • 105
0
votes
1 answer

Minimum number of symbols required for a base-N positional number system

A base-10 number system requires 10 symbols. Any less, and you would not be able to represent every number. (Is this a correct assumption?) A base-16 system requires 16 symbols. How can I tell how many symbols a base-3.14 system takes. Or a base-9.9…
Daffy
  • 413
0
votes
1 answer

How to calculate a division/quotient in octal numeric system?

Im trying to make a division in octal system $$\frac{165_{8}}{24_{8}}$$ So I have done like this using a table $$24\times 0=0_{8}$$ $$24\times 1=30_{8}$$ $$24\times 2=50_{8}$$ $$24\times 3=74_{8}$$ $$24\times 4=120_{8}$$ $$24\times…
riccs_0x
  • 151
0
votes
1 answer

Number system for operation

The last digit of some number in base is 2. Last number of $12_{10}*X$ in the same system is 4. How many systems that are suitable for these conditions for any X. I m really confused for example I take $3_{10}$ as X, so for any system last digit…
Hmmman
  • 37
0
votes
1 answer

Confusion about normalised floating point number systems

I was assigned the following question: List all numbers that can be represented exactly in a normalised floating- point number system with base 10, two digits in the fraction, and an exponent 0 ≤ e ≤ 2. How many are there in total (including…
Flose
  • 303