Searching \ for 'A challenge for square(r)s 4X4 mul and 8X8 mul' in subject line. ()
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.
'A challenge for square(r)s 4X4 mul and 8X8 mul'
1999\03\31@110418 by

Hi Scott.

Finally.

;       4 X 4 multiplication

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

;       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
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
rrf     x,F
rrf     y,F
;
decf    x,f     ;substract first Cy=1

WBR Dmitry.

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
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
>         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
rrf     x,f
rrf     y,f

.
.
.

regards,
Reggie

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

Hi all,

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

>         rrf     x,f
>         skpc

These 2 should be:

btfss   y,7

{Quote hidden}

regards,
Reggie

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

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