Searching \ for 'A challenge for square(r)s 4X4 mul and 8X8 mul' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=challenge+squarers
Search entire site for: 'A challenge for square(r)s 4X4 mul and 8X8 mul'.

Truncated match.
PICList Thread
'A challenge for square(r)s 4X4 mul and 8X8 mul'
1999\03\31@110418 by Dmitry Kiryashov

flavicon
face
Hi Scott.

Finally.

;       4 X 4 multiplication

       movfw   x       ;0000abcd
       addwf   x,F
       btfss   y,0     ;0000efgh
       movlw   0
       btfsc   y,1
       addwf   x,W
       rlf     x,F
       btfsc   y,2
       addwf   x,W
       rlf     x,F
       btfsc   y,3
       addwf   x,W     ;result in W

;       12 clocks/words

> These are the solutions that Andy Warren posted a couple of years ago (I
> have no idea if he was the original author or not). I think this
> shift-and-add trick is really clever. Good work, but what about the 8X8
> squaring? Hint - it uses a variation of this same trick.

I still don't see solution shorter than 35 clocks. I've couple of them.

1)
       movfw   x       ;35 words/clocks
       clrf    x
       rrf     y,F
;
       skpnc           ;this part is repeated 8 times
       addwf   x,F
       rrf     x,F
       rrf     y,F
;

2)
       movfw   x       ;35 words/clocks
       rrf     y,F
       skpc
       subwf   x,F
       rrf     x,F     ;Cy=1 always before
       rrf     y,F
;
       skpnc           ;this part is repeated 7 times
       addwf   x,F
       rrf     x,F
       rrf     y,F
;
       decf    x,f     ;substract first Cy=1

WBR Dmitry.

1999\03\31@154912 by Scott Dattalo

face
flavicon
face
Dmitry Kiryashov wrote:
{Quote hidden}

Cool!

{Quote hidden}

Exactly! When I said 32 (or was it 33?) cycles, I forgot that I was just
doing 7bit X 7bit multiplication. However, in one of the Microchip
appnotes there's some code that does beat the 35 cycle multiplication
(by one or two cycles), however it does it at a relatively large
increase in code size. And IIRC, it isn't isochronous.

Scott


'A challenge for square(r)s 4X4 mul and 8X8 mul'
1999\04\06@223333 by Regulus Berdin
picon face
Hi Dmitry,

Dmitry Kiryashov wrote:
> I still don't see solution shorter than 35 clocks. I've couple of them.
>
> 1)
>         movfw   x       ;35 words/clocks
>         clrf    x
>         rrf     y,F
> ;
>         skpnc           ;this part is repeated 8 times
>         addwf   x,F
>         rrf     x,F
>         rrf     y,F
> ;

One cycle lesser, 34 cycles:

       movf    x,w
       rrf     x,f

       skpc
        clrf   x
       rrf     x,f
       rrf     y,f

       skpnc                   ;repeated 7 times
        addwf  x,f
       rrf     x,f
       rrf     y,f

       .
       .
       .

regards,
Reggie

--
e-mail: spam_OUTrberdinTakeThisOuTspambigfoot.com
ICQ#:   31651436
URL:    http://www.bigfoot.com/~rberdin

1999\04\06@225547 by Regulus Berdin

picon face
Hi all,

Sorry! I made a mistake.

Regulus Berdin wrote:
> One cycle lesser, 34 cycles:
>
>         movf    x,w

>         rrf     x,f
>         skpc

These 2 should be:

       addwf   w,f
       btfss   y,7

{Quote hidden}

regards,
Reggie

--
e-mail: .....rberdinKILLspamspam@spam@bigfoot.com
ICQ#:   31651436
URL:    http://www.bigfoot.com/~rberdin

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...