Re: Countdown




Nick Atty wrote:
> The real benefit it has over our long multiplication is that you don't
> need to know any tables apart from 2 times.
>
> You do everything with addition and multiplication by two: so once you
> know what 2x2 up to 2x9 is, that's it.
>
> What's really nice is that you can implement it on a computer using only
> add, shift left, shift right, and "check the bit you've just shifted
> out".

What was new to me was the initial breakdown of the first number
(lefthand column) into binary components by division by two and
checking for odd and even. I've always plunged in with what is the
biggest binary number that can be subtract from it and then repeat this
with the remainder recursively .

taking for example 57

57 is odd therefore there will be a 2**0 component 1
28 is even so there will be no 2 **1 component
14 is even so there will be no 2**2 component
7 is odd so there will be a 2**3 component 8
3 is odd so there will be a 2**4 component 16
1 is odd so there will be a 2**5 component 32

so 57 = 32 + 16 + 8 + 1

Took a while to prove to myself that this was right, but I've got it
now.
That "floor"ing bit was merely subtracting 1 from the odd number before
dividing by two.

Never looked at it this way round before - so thanks for bringing it up.

.



Relevant Pages

  • top voffset with even-odd alternation
    ... duplex unit of the printer) shifts every odd page vertical by 2mm. ... the problem is that you can see the page number, the headline underline (a ... it is not a problem of latex (printing two pages scaled on one sheet shows ... margin, but a voffset to shift the hole page including the headline, the ...
    (comp.text.tex)
  • Re: Countdown
    ... >What was new to me was the initial breakdown of the first number ... >(lefthand column) into binary components by division by two and ... >checking for odd and even. ...
    (uk.media.radio.archers)
  • Re: Proof...
    ... > Repeat until n is 1. ... > if n is odd then subtract 1 from n ... > if n is even then divide n by 2 ...
    (sci.math)
  • Re: perl cumulative module question
    ... Your arithmetic is odd. ... If you want to subtract the ... To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx ... For additional commands, e-mail: beginners-help@xxxxxxxx ...
    (perl.beginners)
  • Re: Proof...
    ... > Repeat until n is 1. ... > if n is odd then subtract 1 from n ... > if n is even then divide n by 2 ...
    (sci.math)

Loading