Answer the question
In order to leave comments, you need to log in
How to correctly assemble a word from bits?
Like this
result = state[0]<<0|state[1]<<1|state[2]<<2|state[3]<<3|state[4]<<4|state[5]<<5|state[6]<<6|state[7]<<8|
state[8]<<8|state[9]<<9|state[10]<<10|state[11]<<11|state[12]<<12|state[13]<<13|state[14]<<14|state[15]<<15;
for (iterator = 0; iterator < 16; iterator++){
result |= state[iterator]<<iterator;
Answer the question
In order to leave comments, you need to log in
for (iterator = 0; iterator < 16; iterator++){
result = result<<1;
if(state[iterator] > 0) result++;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question