/* ----------------------------------------------------------------------- IBAA scaled down to 8 terms and 6 bits per term, (8+2)*6=60 bits total. The program is currently measuring r[1]-r[0] for every batch. ----------------------------------------------------------------------- */ typedef unsigned int u4; /* unsigned four bytes, 32 bits */ #define ALPHA (3) #define SIZE (1<>2)) & MASK) static void ibaa(m,r,aa,bb) u4 *m; /* Memory: array of SIZE ALPHA-bit terms */ u4 *r; /* Results: the sequence, same size as m */ u4 *aa; /* Accumulator: a single value */ u4 *bb; /* the previous result */ { u4 a,b,x,y,i; a = *aa; b = *bb; for (i=0; i>ALPHA)] + x) & MASK; /* set r */ } *bb = b; *aa = a; } int main() { u4 m[SIZE], r[SIZE], aa = 1, bb = 1, count[VALSIZE], i, j, old=0; for (i=0; i