Elektrine lite

← Feed

@kenshirriff@oldbytes.space

2025-03-02 18:31 UTC

Multiplying in base 8 means each term gets multiplied by 0 through 7. Multiplying by 2 or 4 is easy, just shift the number. A trick for ×7: multiply by 8 and subtract 1×. (This is Booth's algorithm.) For ×6, multiply by 8 and subtract 2×. But what about ×3? It needs a special circuit. 3/N

Replies (5)

  • @kenshirriff@oldbytes.space 2025-03-02 18:31

    To multiply by 3 in binary, you can add the number to 2 times the number (a quick shift). Unfortunately, adding two 64-bit numbers is slow because of carries. (Just like 999999+1: you need to keep doing carry-the-one.) To make this addition fast, the Pentium uses complicated adder circuitry. 4/N

    Open ##1442793

  • @aarbrk@mstdn.mx 2025-03-02 18:35

    @kenshirriff I'm missing something basic. Why isn't the ×3 case analogous to ×7, or ×4 and subtract 1×?

    Open ##1442846

  • @birnam@c.im 2025-03-02 19:49

    @kenshirriff If x7 could use x8-x1, why couldn't x3 use x4-x1? Also, with the special x3 circuit, would x6 be more efficient now adding x3 twice or a x3 then x2 operation?

    Open ##1442848

  • @xtof@shelter.moe 2025-03-02 21:59

    @kenshirriff So imagine that to do ×5, it is ×8 - 3×? Because if not, there should be another specialized circuitry.

    Open ##1442850

  • @timkrief@framapiaf.org 2025-03-02 23:29

    @kenshirriff i read your answers for this but I still can't get it sorry, if it's easy to get x4 by shifting the number why couldn't you just substract the number afer as you do with x8 - 1. Why is x8 easier than x4, they are still stored in binary form right? So x2 x4 x8 should all be as easy

    Open ##1442857