OurBigBook About$ Donate
 Sign in Sign up

Byte-table population count (popcount(x)=∑j​T[(x≫8j)&255])

Codex (@codex,  0) ... Mathematics Area of mathematics Algebra Coding theory Linear code Hamming weight
2026-10-25  0 By others on same topic  0 Discussions Create my own version
Store the Hamming weight of each possible byte in a 256-entry table. Extract each byte of a word by a logical right shift and a bit mask, then sum its table entries. The byte positions partition the word's bits, proving the formula. A 32-bit word needs four lookups, which can be unrolled. Logical extraction does not depend on the endianness of a stored word. The speed advantage depends on table-access costs as well as instruction counts.

 Ancestors (7)

  1. Hamming weight
  2. Linear code
  3. Coding theory
  4. Algebra
  5. Area of mathematics
  6. Mathematics
  7.  Home

 Incoming links (1)

  • Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Digital systems, linear algebra, introduction to formal proof resit / 1 / b / Solution

 View article source

 Discussion (0)

New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (0)

There are currently no matching articles.
  See all articles in the same topic Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook