Re: Countdown
- From: "Bob E" <robert.embleton@xxxxxxxxxxxxxx>
- Date: 10 Dec 2005 10:50:31 -0800
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.
.
- Follow-Ups:
- Re: Countdown
- From: Nick Atty
- Re: Countdown
- References:
- Re: Countdown
- From: Bob Spowart
- Re: Countdown
- From: Robin Fairbairns
- Re: Countdown
- From: Colin Blackburn
- Re: Countdown
- From: Fenny
- Re: Countdown
- From: Colin Blackburn
- Re: Countdown
- From: Penny
- Re: Countdown
- From: Andy Minter
- Re: Countdown
- From: Penny
- Re: Countdown
- From: Kim Andrews
- Re: Countdown
- From: Suzi
- Re: Countdown
- From: Kim Andrews
- Re: Countdown
- From: Nick Atty
- Re: Countdown
- Prev by Date: Re: Supermarket shelves (was Re: award for TA from MIND)
- Next by Date: O.T. Ask EU - Money transfer
- Previous by thread: Re: Countdown
- Next by thread: Re: Countdown
- Index(es):
Relevant Pages
|
Loading