2025-03-02 18:31 UTC
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
-
@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×?
-
@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?
-
@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.
-
@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