Re: LZ: manipulations


[Prev][Next][Index][Thread]

Re: LZ: manipulations



> > > > Also, would the shifting method be able to work for #'s that aren't powers of
> > > > 2 (odd #'s)
> > >
> > > Nope. Only 2,4,8,16,32,64,128.
> > >
> > well one trick is to combine shifts and adds/subs
> > 
> > e.g. to multiply by seve,
> > store teh origional no ina nother register,
> > shift teh oriogional register left 3 times
> > subtract the copy you made
> > 
> > hey presto, times by seven (simple algebra a*8-a =a*7)
> > 
> > you can do this for pretty much any number..
> 
> Yes, but the number you want to multiply with must be
> a constant. You can't for example multiply a*b. Then you
> must use a multiply routine.
> 
Of course, I was taking that as said, as all shifting methods are 
only really applicable to multiplying by constants...


Rob Taylor MAIL - mailto:rtaylor@ticalc.org 
           WEB  - http://www.u-net.com/~rtaylor/    


References: