ArticleslgStudy

computer science

Negative base

Negative base is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Negative base rather than just read about it. In short: A negative base (or negative radix) may be used to construct a non-standard positional numeral system. Like other place-value systems, each position holds multiples of the appropriate power of the system's base; but that base is negative—that is to say, the base b is equal to −r for some natural number r (r ≥ 2).

Key takeaways

  • Negative base belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Negative base to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Negative base from memory before moving on to harder problems.

Reference excerpt

A negative base (or negative radix) may be used to construct a non-standard positional numeral system. Like other place-value systems, each position holds multiples of the appropriate power of the system's base; but that base is negative—that is to say, the base b is equal to −r for some natural number r (r ≥ 2). Negative-base systems can accommodate all the same numbers as standard place-value systems, but both positive and negative numbers are represented without the use of a minus sign (or, in computer representation, a sign bit); this advantage is countered by an increased complexity of arithmetic operations. The need to store the information normally contained by a negative sign often results in a negative-base number being one digit longer than its positive-base equivalent. The common names for negative-base positional numeral systems are formed by prefixing nega- to the name of the corresponding positive-base system; for example, negadecimal (base −10) corresponds to decimal (base 10), negabinary (base −2) to binary (base 2), negaternary (base −3) to ternary (base 3), and negaquaternary (base −4) to quaternary (base 4).

Example Consider what is meant by the representation 12243 in the negadecimal system, whose base b is −10:

The representation 12243−10 (which is intended to be negadecimal notation) is equivalent to 8,16310 in decimal notation, because 10,000 + (−2,000) + 200 + (−40) + 3 = 8163.

Remark

On the other hand, −816310 in decimal would be written 9977−10 in negadecimal.

History Negative numerical bases were first considered by Vittorio Grünwald in an 1885 monograph published in Giornale di Matematiche di Battaglini. Grünwald gave algorithms for performing addition, subtraction, multiplication, division, root extraction, divisibility tests, and radix conversion. Negative bases were later mentioned in passing by A. J. Kempner in 1936 and studied in more detail by Zdzisław Pawlak and A. Wakulicz in 1957. Negabinary was implemented in the early Polish computer BINEG (and UMC), built 1957–59, based on ideas by Z. Pawlak and A. Lazarkiewicz from the Mathematical Institute in Warsaw. Implementations since then have been rare. zfp, a floating-point compression algorithm from the Lawrence Livermore National Laboratory, uses negabinary to store numbers. According to zfp's documentation:

Unlike sign-magnitude representations, the leftmost one-bit in negabinary simultaneously encodes the sign and approximate magnitude of a number. Moreover, unlike two’s complement, numbers small in magnitude have many leading zeros in negabinary regardless of sign, which facilitates encoding.

Notation and use Denoting the base as −r, every integer a can be written uniquely as

a = ∑ i = 0 n d i ( − r ) i {\displaystyle a=\sum _{i=0}^{n}d_{i}(-r)^{i}}

where each digit dk is an integer from 0 to r − 1 and the leading digit dn > 0 (unless n = 0). The base −r expansion of a is then given by the string dndn−1...d1d0. Negative-base systems may thus be compared to signed-digit representations, such as balanced ternary, where the radix is positive but the digits are taken from a partially negative range. (In the table below the digit of value −1 is written as the single character T.) Some numbers have the same representation in base −r as in base r. For example, the numbers from 100 to 109 have the same representations in decimal and negadecimal. Similarly,

17 = 2 4 + 2 0 = ( − 2 ) 4 + ( − 2 ) 0 {\displaystyle 17=2^{4}+2^{0}=(-2)^{4}+(-2)^{0}}

and is represented by 10001 in binary and 10001 in negabinary. Some numbers with their expansions in a number of positive and corresponding negative bases are:

Note that, with the exception of nega balanced ternary, the base −r expansions of negative integers have an even number of digits, while the base −r expansions of the non-negative integers have an odd number of digits.

Calculation The base −r expansion of a number can be found by repeated division by −r, recording the non-negative remainders in { 0 , 1 , … , r − 1 } {\displaystyle \{0,1,\ldots ,r-1\}} , and concatenating those remainders, starting with the last. Note that if a / b is c with remainder d, then bc + d = a and therefore d = a − bc. To arrive at the correct conversion, the value for c must be chosen such that d is non-negative and minimal. For the fourth line of the following example this means that

− 5 ÷ ( − 3 ) = 2 r e m a i n d e r 1 {\displaystyle -5\div (-3)=2~\mathrm {remainder} ~1}

has to be chosen — and not = 3 r e m a i n d e r 4 {\displaystyle =3~\mathrm {remainder} ~4} nor = 1 r e m a i n d e r − 2. {\displaystyle =1~\mathrm {remainder} ~-\!2.}

For example, to convert 146 in decimal to negaternary:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Negative base

Start with the simplest possible case. Write down what Negative base claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Negative base before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Negative base ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Negative base

In research
Negative base appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Negative base in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Negative base is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer arithmetic, Non-standard positional numeral systems, so understanding it makes those chapters shorter.
In everyday life
Look for Negative base outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Negative base” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Negative base in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Negative base means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Negative base out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Negative base in simple terms?

A negative base (or negative radix) may be used to construct a non-standard positional numeral system. Like other place-value systems, each position holds multiples of the appropriate power of the system's base; but that base is negative—that is to say, the base b is equal to −r for some natural nu…

Why does Negative base matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Negative base?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Negative base.

Tags

  • Computer arithmetic
  • Non-standard positional numeral systems

Keep exploring