ArticleslgStudy

computer science

Ternary numeral system

Ternary numeral system 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 Ternary numeral system rather than just read about it. In short: A ternary numeral system (also called base 3 or trinary) has three as its base. Although ternary most often refers to a system in which the three digits are all non-negative numbers (specifically 0, 1, and 2), the adjective also lends its name to the balanced ternary system.

Ternary numeral system — main illustration
Ternary numeral system — illustration

Key takeaways

  • Ternary numeral system 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 Ternary numeral system to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Ternary numeral system from memory before moving on to harder problems.

Reference excerpt

A ternary numeral system (also called base 3 or trinary) has three as its base. Although ternary most often refers to a system in which the three digits are all non-negative numbers (specifically 0, 1, and 2), the adjective also lends its name to the balanced ternary system. Comprising the digits −1, 0 and +1, balanced ternary is widely used in comparison logic and ternary computers.

Information units

Trit A ternary digit is a trit (trinary digit), analogously to a bit. One trit is equivalent to log2 3 (about 1.58496) bits of information. Under classical hardware assumptions, base-3 is theoretically more efficient than binary in terms of radix economy, as 3 is the closest integer to Euler's number (e).

Tribble Analogous to the binary nibble, a tribble consists of 3 trits. It can hold 27 distinct states (33 = 27), which is roughly equivalent to 4.75 bits of information. Because it has exactly 27 states, a tribble is conveniently represented by a single character in a septemvigesimal (base-27) alphanumeric notation.

Tryte Analogous to a binary byte, a tryte is typically defined as 6 or 9 trits. Early ternary computers, such as the Soviet Setun, defined a tryte to be six trits. A six-trit tryte holds 36 = 729 states, carrying approximately 9.5 bits of information—significantly more than the standard 8-bit binary byte (256 states). Modern theoretical architectures often favor a 9-trit tryte (39 = 19,683 states), as it cleanly divides into three tribbles.

Word A ternary word represents the standard register width for a given ternary architecture. The Setun computer, for instance, operated using an 18-trit word with 9-trit command and memory architectures.

Macro units When scaling to larger data storage capacities, ternary computing nomenclature splits into two distinct conventions depending on the hardware architecture:

Native ternary scaling: In a pure ternary system, macro-units scale by powers of 3 rather than the powers of 2 (1,024) or 10 (1,000) used in binary and decimal systems. A kilotryte (KT) in this system is exactly 310 (59,049) trytes. Following this pattern, a megatryte (MT) is 320 trytes, and a gigatryte (GT) is 330 trytes. Binary-compatible scaling: In hybrid systems designed to interface directly with existing binary infrastructure, engineers often map ternary groupings to standard binary sizes. Because 5 trits (243 states) fit efficiently within an 8-bit byte (256 states), traditional binary SI prefixes are sometimes applied directly to tryte blocks, making a kilotryte equal to 1,024 trytes, and a megatryte equal to 1,048,576 trytes.

Comparison to other bases Representations of integer numbers in ternary do not get uncomfortably lengthy as quickly as in binary. For example, decimal 36510 or senary 14056 corresponds to binary 1011011012 (nine bits) and to ternary 1111123 (six trits). However, they are still far less compact than the corresponding representations in bases such as decimal – see below for a compact way to codify ternary using nonary (base 9) and septemvigesimal (base 27).

As for rational numbers, ternary offers a convenient way to represent ⁠1/3⁠ similar to senary (as opposed to its cumbersome representation as an infinite string of recurring digits in decimal); but a major drawback is that, in turn, ternary does not offer a finite representation for ⁠1/2⁠ (nor for ⁠1/4⁠, ⁠1/8⁠, etc.), because 2 has a prime factor that is not a factor of the base; as with base two, one-tenth (decimal ⁠1/10⁠, senary ⁠1/14⁠) is not representable exactly (that would need e.g. decimal); nor is one-sixth (senary ⁠1/10⁠, decimal ⁠1/6⁠).

Sum of the digits in ternary as opposed to binary The value of a binary number with n bits that are all 1 is 2n − 1. Similarly, for a number N ( b , d ) {\displaystyle N(b,d)} with base b {\displaystyle b} and d {\displaystyle d} digits, all of which are the maximal digit value b − 1 {\displaystyle b-1} , we can write the geometric progression:

N ( b , d ) = ( b − 1 ) b d − 1 + ( b − 1 ) b d − 2 + ⋯ + ( b − 1 ) b 0 = ( b − 1 ) ( b d − 1 + b d − 2 + ⋯ + 1 ) = ( b − 1 ) M . {\displaystyle {\begin{aligned}N(b,d)&=(b-1)b^{d-1}+(b-1)b^{d-2}+\dots +(b-1)b^{0}\\&=(b-1)(b^{d-1}+b^{d-2}+\dots +1)\\&=(b-1)M.\end{aligned}}}

Multiplying M {\displaystyle M} by b {\displaystyle b} yields:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Ternary numeral system

Start with the simplest possible case. Write down what Ternary numeral system 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 Ternary numeral system 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 Ternary numeral system 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 Ternary numeral system

In research
Ternary numeral system 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 Ternary numeral system 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
Ternary numeral system is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer arithmetic, Positional numeral systems, Ternary computers, so understanding it makes those chapters shorter.
In everyday life
Look for Ternary numeral system 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 “Ternary numeral system” →

Affiliate

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

How to study Ternary numeral system in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Ternary numeral system 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 Ternary numeral system out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Ternary numeral system in simple terms?

A ternary numeral system (also called base 3 or trinary) has three as its base. Although ternary most often refers to a system in which the three digits are all non-negative numbers (specifically 0, 1, and 2), the adjective also lends its name to the balanced ternary system.

Why does Ternary numeral system 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 Ternary numeral system?

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 Ternary numeral system.

Tags

  • Computer arithmetic
  • Positional numeral systems
  • Ternary computers

Keep exploring