What is Bit Spread?

Hi,

I'm reading Andrew N. Sloss's book .

There is a description about Bit Permutation. I extrat several lines of code here:

7.6.2.1 Bit PermutationMacros mask0 EQU 0x55555555 ; set bit positions with b0=0 mask1 EQU 0x33333333 ; set bit positions with b1=0 mask2 EQU 0x0F0F0F0F ; set bit positions with b2=0 mask3 EQU 0x00FF00FF ; set bit positions with b3=0 mask4 EQU 0x0000FFFF ; set bit positions with b4=0

MACRO PERMUTE_B $j, $k ; [ .. b_j .. b_k .. ] -> [ .. b_k .. b_j .. ] and j>k LDR m, =(mask$j:AND::NOT:mask$k) ; set when b_j=0 b_k=1 EOR t, n, n, LSR#(1 [b3b2b1b0b4] MOV pc, lr

he used PERMUTE_B macro to achieve bit_spread operation. But what is bit spread? Can anybody give me a defintion please? Thanks!

--------------------------------------- Posted through

formatting link

Reply to
justincao
Loading thread data ...

Hi.

The "bit_spread operation" is a user defined function. You included the definition of this function in your post.

RK

Reply to
d_s_klein

Reply to
Tim Wescott

By bit spread, I think he means having a single input bit affect several output bits. I have seen it used for error detection, such as CRC; hashing, to reduce collisions; and encryption, to make cryptanalysis harder.

--
Thad
Reply to
Thad Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.