There is C a array like uint8_t a[8] = {1, 2, 3, 4, 5, 6, 7, 8};
and constant c=100
.
I'd like to do this:
for(i = 0;i < 8; i++) {
a[i] = (a[i] * c) >> 8;
}
However as it's only 8bit data I wonder if there is a trick to somehow multiply and scale back to 8bit more elements at once with a 32 bit MCU. (there are no bulit-in vector operations)
EDIT: Changed the word "normalize" to "scale to 8bit"