6 hardware multiplier exa, 6 hardware multiplier examples -9, Maxq family user’s guide – Maxim Integrated MAXQ Family User Manual
Page 129: 6 hardware multiplier examples
12.6 Hardware Multiplier Examples
The following are code examples of multiplier operations.
;Unsigned Multiply 16-bit x 16-bit
move MCNT, #21h
; CLD=1, SUS=1 (unsigned)
move MA, #0FFFh
; MC2:0=0000_0000_0000h
move MB, #1001h
; MC1R:MC0R= 00FF_FFFFh
; MC2:0=0000_00FF_FFFFh
;Signed Multiply 16-bit x 16-bit
move MCNT, #20h
; CLD=1, SUS=0 (signed)
move MA, #F001h
; MC2:0=0000_0000_0000h
move MB, #1001h
; MC1R:MC0R= FF00_0001h
; MC2:0=FFFF_FF00_0001h
;Unsigned Multiply-Accumulate 16-bit x 16-bit
; MC2:0=0000_0100_0001h
move MCNT, #03h
; MMAC=1, SUS=1 (unsigned)
move MA, #0FFFh
;
move MB, #1001h
;
; MC1R:MC0R=02FF_FFFFh
; MC2:0=0000_0200_0000h
;Signed Multiply-Accumulate 16-bit x 16-bit
; MC2:0=0000_0100_0001h
move MCNT, #02h
; SUS=0 (signed)
move MA, #F001h
;
move MB, #1001h
;
; MC1R:MC0R= FF00_0003h
; MC2:0=0000_0000_0002h
;Unsigned Multiply-Subtract 16-bit x 16-bit
; MC2:0=0000_0100_0001h
move MCNT, #07h
; MMAC=1, MSUB=1, SUS=1 (unsigned)
move MA, #0FFFh
;
move MB, #1001h
;
; MC1R:MC0R=FF00_0003h
; MC2:0=0000_0000_0002h
;Signed Multiply-Subtract 16-bit x 16-bit
; MC2:0=0000_0100_0001h
move MCNT, #06h
; MMAC=1, MSUB=1, SUS=0 (signed)
move MA, #F001h
;
move MB, #1001h
;
; MC1R:MC0R= 02FF_FFFFh
; MC2:0=0000_0200_0000h
;Signed Multiply Negate 16-bit x 16-bit
move MCNT, #24h
; CLD=1, MSUB=1, SUS=0 (signed)
move MA, #F001h
; MC2:0=0000_0000_0000h
move MB, #1001h
; MC1R:MC0R =00FF_FFFFh
; MC2:0=0000_00FF_FFFFh
12-9
MAXQ Family User’s Guide
Maxim Integrated