What is Bit Spread?

Apr 16, 2010 3 Replies

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


Hi.

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

RK

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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required