July 2002
Intermediate to advanced
320 pages
8h 15m
English
If the number of leading zeros instruction is available, then the best way to count trailing 0’s is, most likely, to convert it to a count leading 0’s problem:
![]()
If population count is available, a slightly better method is to form a mask that identifies the trailing 0’s, and count the 1-bits in it [Hay2], such as
![]()
Variations exist using other expressions for forming a mask that identifies the trailing zeros of x, such as those given in Section 2-1,“Manipulating Rightmost Bits” on page 11. These methods are also reasonable ...
Read now
Unlock full access