hi, I have 20 bits in a vector (binary bits): for example, start from:
TMP_reg = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];TMP_reg = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1];TMP_reg = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1];....end at:TMP_reg = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
I want to produce another bits vector that depends on TMP_reg.
The new vector will be 40 bits vector on condition like that:
- For every bit that equal to 1 in TMP_reg, the New_reg will be 1 0 (as long as TMP_reg bit is 1).
- For every bit that equal to 0 in TMP_reg the New_reg will be 0 1 (as long as TMP_reg bit is 0).
Any suggestion how to do it?
Thanks,
Henry
Best Answer