Exact Identities for the Binary Hamming Weight Under Arithmetic and Bitwise Operations

This article has 0 evaluations Published on
Read the full article Related papers
This article on Sciety

Abstract

We collect and prove exact identities for the binary digital sum S2(n)—the Hamming weight wt (n)—under elementary arithmetic and bitwise operations. For x, y ≥ 0 we derive explicit carry/borrow decompositions of wt(x + y) and wt (x − y) in terms of bitwise carries/borrows ci, bi (0-based indexing, c0 = b0 = 0). We restate classical XOR/OR/AND weight identities in a unified notation, give shift–mask lemmas yielding constructive corollaries (e.g., forcing a prescribed Hamming weight), and present a 2-adic reformulation linked to Kummer’s theorem. We also discuss algorithmic, hardware, and side-channel applications. Proofs are elementary and self-contained.

Related articles

Related articles are currently not available for this article.