Elektrine lite

← Feed

@rygorous@mastodon.gamedev.place

2025-03-03 18:12 UTC

@amonakov @kenshirriff First, note the +8 into next digit means we're not actually working with digits in [0,7] but [0,8] because we potentially have what is effectively a carry-in. The extended digit set gives us just enough breathing room so we can always absorb incoming carries immediately instead of needing real carry chain logic. The reason I think it might be the usual signed r8 is because 6x is handled as 8x-2x instead of 2(3x).

Replies (1)

  • @amonakov @kenshirriff For usual signed r8, we want to recode 3 input bits (digits) 000 -> 0 001 -> 1 010 -> 2 011 -> 3 100 -> 8 - 4 (!) 101 -> 8 - 3 110 -> 8 - 2 111 -> 8 - 1 notes: a) the "carry" into the next digit is just the MSB of the current digit in this scheme b) we only use [-4,3] weights directly, so we have space to absorb an incoming carry of 1. This also suggests how to do the recoder: you look at 3-bit digits + MSB of next-lower digit to determine factors for partial products.

    Open ##1442833