ArticleslgStudy

computer science

Carry-less product

Carry-less product 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 Carry-less product rather than just read about it. In short: The carry-less product of two binary numbers is the result of carry-less multiplication of these numbers. This operation conceptually works like long multiplication except for the fact that the carry is discarded instead of applied to the more significant position.

Carry-less product — main illustration
Carry-less product — illustration

Key takeaways

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

Reference excerpt

The carry-less product of two binary numbers is the result of carry-less multiplication of these numbers. This operation conceptually works like long multiplication except for the fact that the carry is discarded instead of applied to the more significant position. It can be used to model operations over finite fields, in particular multiplication of polynomials from GF(2)[X], the polynomial ring over GF(2). The operation is also known as an XOR multiplication, as carry-discarding addition is equivalent to an exclusive or.

Definition Given two numbers a=∑iai2i and b=∑ibi2i, with ai,bi∈{0,1} denoting the bits of these numbers, the carry-less product of these two numbers is defined to be c=∑ici2i, with each bit ci computed as the exclusive or of products of bits from the input numbers as follows:

ci=⨁j=0iajbi−j

Example Consider a = 101000102 and b = 100101102, with all numbers given in binary. Then the carry-less multiplication of these is essentially what one would get from performing a long multiplication but ignoring the carries.

1 0 1 0 0 0 1 0 = a ---------------|---|-------|-- 1 0 0 1 0 1 1 0|0 0 0 0 0 0 0 1 0 0 1 0 1 1 0|0 0 0 0 0 1 0 0 1 0 1 1 0|0 ------------------------------ 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 ^ ^

For every logic 1 bit in the number a, the number b is shifted to the left as many bits as indicated by the position these bits a. All these shifted versions are then "added" by using an XOR instead of the regular binary addition used in regular long multiplication. Results of XOR are indicated by ^ . In full binary adder these would result in a carry to the column to the left. Here this does not happen so the carry-less product of a and b would be c = 1011000111011002.

Multiplication of polynomials The carry-less product can also be seen as a multiplication of polynomials over the field GF(2). This is because the exclusive or corresponds to the addition in this field. In the example above, the numbers a and b correspond to polynomials

A=∑iaiXi=X7+X5+X1B=∑ibiXi=X7+X4+X2+X1 and the product of these is

C=A⋅B=∑iciXi=X14+X12+X11+X7+X6+X5+X3+X2 which is what the number c computed above encodes. Notice how (X7⋅X1)+(X1⋅X7)≡0 and (X7⋅X2)+(X5⋅X4)≡0 thanks to the arithmetic in GF(2). This corresponds to the columns marked ^ in the example.

Applications The elements of GF(2n), i.e. a finite field whose order is a power of two, are usually represented as polynomials in GF(2)[X]. Multiplication of two such field elements consists of multiplication of the corresponding polynomials, followed by a reduction with respect to some irreducible polynomial which is taken from the construction of the field. If the polynomials are encoded as binary numbers, carry-less multiplication can be used to perform the first step of this computation. Such fields have applications in cryptography and for some checksum algorithms.

Implementations Many modern CPU architectures support various extensions that provide hardware support for some form of carry-less multiplication. This support may take the form of either vector or scalar instructions. Listed below are some instruction set extensions for carry-less multiplication in various CPU architectures.

For other targets it is possible to implement the computation above as a software algorithm, and many cryptography libraries will contain an implementation as part of their finite field arithmetic operations. For wide carry-less multiplications, it is possible to adapt fast integer multiplication algorithms such as the Karatsuba and Toom-Cook algorithms to work with carry-less multiplications.

Other bases The definition of a carry-less product as the result of a long multiplication discarding carry would readily apply to bases other than 2. But the result depends on the basis, which is therefore an essential part of the operation. As this operation is typically being used on computers operating in binary, the binary form discussed above is the one employed in practice. Polynomials over other finite fields of prime order do have applications, but treating the coefficients of such a polynomial as the digits of a single number is rather uncommon, so the multiplication of such polynomials would not be seen as a carry-less multiplication of numbers.

See also CLMUL instruction set, an x86 ISA extension Finite field arithmetic Galois/Counter Mode

References

Illustrations

Carry-less product: Computing the carry-less product.
Computing the carry-less product.

Worked examples

Example 1 — a first encounter with Carry-less product

Start with the simplest possible case. Write down what Carry-less product 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 Carry-less product 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 Carry-less product 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 Carry-less product

In research
Carry-less product 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 Carry-less product 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
Carry-less product is common in secondary-school and first-year university syllabi. It links to neighbouring topics Binary arithmetic, Computer arithmetic, Multiplication, so understanding it makes those chapters shorter.
In everyday life
Look for Carry-less product 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 “Carry-less product” →

How to study Carry-less product in 20 minutes

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

Frequently asked questions

What is Carry-less product in simple terms?

The carry-less product of two binary numbers is the result of carry-less multiplication of these numbers. This operation conceptually works like long multiplication except for the fact that the carry is discarded instead of applied to the more significant position.

Why does Carry-less product 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 Carry-less product?

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 Carry-less product.

Tags

  • Binary arithmetic
  • Computer arithmetic
  • Multiplication

Keep exploring