PIC elado
Miko Imre
imre.miko at siemens.com
Mon May 5 17:15:53 CEST 2003
Csak a gyengebbek kedveert a PIC16-on az altalam eddig ismert leggyorsabb
8x8 szorzas:
; AARGB0:AARGB1 = AARGB1 * BARGB0
;
mul8_16x
movf BARGB0,w
clrf AARGB0
clrc
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
skipnc
addwf AARGB0,f
rrf AARGB0,f
rrf AARGB1,f
return
Ez a felhivas call utasitasaval egyutt
PIC16-on 40 utasitasciklus = 160 orajel,
PIC18-on 40 utasitasciklus = 40 orajel.
AVR-en a 8 bites hw szorzo utasitas 2 utasitasciklus = 2 orajel,
PIC18-on a 8 bites hw szorzo utasitas 1 utasitasciklus = 1 orajel.
Arany
AVR:PIC16sw 2:160 = 80x
AVR:PIC18sw 2:40 = 20x
AVR:PIC18hw 2:1 = 0,5x
De ez a szorzo csak erre az egy muveltre vonatkozik, ha minden
10. utasitas szorzas, akkor az arany: (feltetelezve, hogy az AVR-en
a tobbi utasitas mindegyike 1 utasitasciklus=1 orajel hosszu.)
AVR:PIC16sw 11:196 = 19,6x
AVR:PIC16sw 11:49 = 4,45x
AVR:PIC18hw 11:10 = 0,91x
Remelem ebben mar nem latsz semmi csusztatast. Kar, hogy
en sem latom a tobb 100x...1000x-es szorzot.
Udv.
Imre
Ui: Teljesen igazad van abban, hogy cross compilert konnyebb irni
AVR-re. De ezt nem is vitatta senki.
More information about the Elektro
mailing list