欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18LF6620-I/PT 参数 Datasheet PDF下载

PIC18LF6620-I/PT图片预览
型号: PIC18LF6620-I/PT
PDF下载: 下载PDF文件 查看货源
内容描述: 八十〇分之六十四引脚高性能1 Mbit的增强型闪存微控制器与A / D [64/80-Pin High Performance 1 Mbit Enhanced FLASH Microcontrollers with A/D]
分类和应用: 闪存微控制器和处理器外围集成电路PC时钟
文件页数/大小: 366 页 / 6797 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第84页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第85页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第86页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第87页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第89页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第90页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第91页浏览型号PIC18LF6620-I/PT的Datasheet PDF文件第92页  
PIC18FXX20  
Example 8-3 shows the sequence to do a 16 x 16  
unsigned multiply. Equation 8-1 shows the algorithm  
that is used. The 32-bit result is stored in four registers,  
RES3:RES0.  
EQUATION 8-2:  
16 x 16 SIGNED  
MULTIPLICATION  
ALGORITHM  
RES3:RES0  
=
=
ARG1H:ARG1L ARG2H:ARG2L  
16  
8
8
EQUATION 8-1:  
16 x 16 UNSIGNED  
MULTIPLICATION  
ALGORITHM  
(ARG1H ARG2H 2 ) +  
(ARG1H ARG2L 2 ) +  
(ARG1L ARG2H 2 ) +  
(ARG1L ARG2L)+  
16  
16  
RES3:RES0  
=
=
ARG1H:ARG1L ARG2H:ARG2L  
(-1 ARG2H<7> ARG1H:ARG1L 2 ) +  
16  
(ARG1H ARG2H 2 ) +  
(-1 ARG1H<7> ARG2H:ARG2L 2  
)
8
8
(ARG1H ARG2L 2 ) +  
(ARG1L ARG2H 2 ) +  
(ARG1L ARG2L)  
EXAMPLE 8-4:  
16 x 16 SIGNED  
MULTIPLY ROUTINE  
MOVF  
MULWF  
ARG1L,  
ARG2L  
W
EXAMPLE 8-3:  
16 x 16 UNSIGNED  
MULTIPLY ROUTINE  
; ARG1L * ARG2L ->  
; PRODH:PRODL  
MOVFF  
MOVFF  
PRODH, RES1  
PRODL, RES0  
;
;
MOVF  
MULWF  
ARG1L, W  
ARG2L  
; ARG1L * ARG2L ->  
;
;
; PRODH:PRODL  
;
;
MOVF  
MULWF  
ARG1H,  
ARG2H  
W
MOVFF  
MOVFF  
PRODH, RES1  
PRODL, RES0  
; ARG1H * ARG2H ->  
; PRODH:PRODL  
;
;
;
;
MOVFF  
MOVFF  
PRODH, RES3  
PRODL, RES2  
MOVF  
MULWF  
ARG1H,  
ARG2H  
W
; ARG1H * ARG2H ->  
; PRODH:PRODL  
;
;
MOVF  
MULWF  
ARG1L,  
ARG2H  
W
MOVFF  
MOVFF  
PRODH, RES3  
PRODL, RES2  
; ARG1L * ARG2H ->  
; PRODH:PRODL  
MOVF  
ADDWF  
MOVF  
ADDWFC RES2,  
CLRF WREG  
ADDWFC RES3,  
PRODL,  
RES1,  
PRODH,  
W
F
W
F
;
MOVF  
MULWF  
ARG1L,  
ARG2H  
W
; Add cross  
; products  
;
;
;
; ARG1L * ARG2H ->  
; PRODH:PRODL  
;
; Add cross  
; products  
;
;
;
MOVF  
ADDWF  
MOVF  
ADDWFC RES2,  
CLRF WREG  
ADDWFC RES3,  
PRODL,  
RES1,  
PRODH,  
W
F
W
F
F
W
;
MOVF  
MULWF  
ARG1H,  
ARG2L  
;
; ARG1H * ARG2L ->  
; PRODH:PRODL  
;
; Add cross  
; products  
;
;
;
F
W
;
MOVF  
ADDWF  
MOVF  
ADDWFC RES2,  
CLRF WREG  
ADDWFC RES3,  
PRODL,  
RES1,  
PRODH,  
W
F
W
F
MOVF  
MULWF  
ARG1H,  
ARG2L  
;
; ARG1H * ARG2L ->  
; PRODH:PRODL  
;
; Add cross  
; products  
;
;
;
MOVF  
ADDWF  
MOVF  
ADDWFC RES2,  
CLRF WREG  
ADDWFC RES3,  
PRODL,  
RES1,  
PRODH,  
W
F
W
F
F
;
;
BTFSS  
BRA  
MOVF  
SUBWF  
MOVF  
ARG2H,  
SIGN_ARG1  
ARG1L,  
RES2  
ARG1H,  
7
; ARG2H:ARG2L neg?  
; no, check ARG1  
;
;
;
F
W
W
SUBWFB RES3  
Example 8-4 shows the sequence to do a 16 x 16  
signed multiply. Equation 8-2 shows the algorithm  
used. The 32-bit result is stored in four registers,  
RES3:RES0. To account for the sign bits of the argu-  
ments, each argument pairs Most Significant bit (MSb)  
is tested and the appropriate subtractions are done.  
SIGN_ARG1  
BTFSS  
BRA  
ARG1H,  
CONT_CODE  
ARG2L,  
RES2  
ARG2H,  
7
; ARG1H:ARG1L neg?  
; no, done  
;
;
;
MOVF  
SUBWF  
MOVF  
W
W
SUBWFB RES3  
;
CONT_CODE  
:
DS39609A-page 86  
Advance Information  
2003 Microchip Technology Inc.  
 复制成功!