Ah, yes, 13 (four byte) additions, that's quite neat. Additions of the shifted value, so that's where you'd need the carry. Note that you can either shift the value each time, or shift the accumulated total each time.
Also note, Booth encoding might help a bit. I've probably got a mistake in the following, but...
42949673 = 0x28F5C29
so the 2 and 8 are additions, then with the run of 4 one bits you can do with one more addition and a subtraction, and so on:
Also note, Booth encoding might help a bit. I've probably got a mistake in the following, but...
42949673 = 0x28F5C29
so the 2 and 8 are additions, then with the run of 4 one bits you can do with one more addition and a subtraction, and so on:
Code:
0x28F5C29 = binary 0010 1000 1111 0101 1100 0010 1001positive bits: binary 0010 1001 0000 0110 0000 0010 1001 (8 additions)negative bits: binary 0000 0000 0001 0000 0100 0000 0000 (2 subtractions)
Statistics: Posted by BigEd — Sun Mar 10, 2024 8:38 am