Qdatasheet_Logo
Integrated circuits, Transistor, Semiconductors Search and Datasheet PDF Download Site

C8051F367-GM2 View Datasheet(PDF) - Silicon Laboratories

Part Name
Description
MFG CO.
C8051F367-GM2
Silabs
Silicon Laboratories Silabs
'C8051F367-GM2' PDF : 288 Pages View PDF
C8051F360/1/2/3/4/5/6/7/8/9
11.7.2. Multiply Only Example
The example below implements the equation:
4660 × –292 = –1360720
MOV MAC0CF, #01h
MOV MAC0AH, #12h
MOV MAC0AL, #34h
MOV MAC0BH, #FEh
MOV MAC0BL, #DCh
NOP
NOP
NOP
; Use integer numbers, and multiply only mode (add to zero)
; Load MAC0A register with 1234 hex = 4660 decimal
; Load MAC0B register with FEDC hex = -292 decimal
; This line initiates the Multiply operation
; After this instruction, the Accumulator should be equal to
; FFFFEB3CB0 hex = -1360720 decimal. The MAC0STA register should
; be 0x01, indicating a negative result.
; After this instruction, the Rounding register is updated
11.7.3. MAC0 Accumulator Shift Example
The example below shifts the MAC0 accumulator left one bit, and then right two bits:
MOV MAC0OVR, #40h ; The next few instructions load the accumulator with the value
MOV MAC0ACC3, #88h ; 4088442211 Hex.
MOV MAC0ACC2, #44h
MOV MAC0ACC1, #22h
MOV MAC0ACC0, #11h
MOV MAC0CF, #20h ; Initiate a Left-shift
NOP
; After this instruction, the accumulator should be 0x8110884422
NOP
; The rounding register is updated after this instruction
MOV MAC0CF, #30h ; Initiate a Right-shift
MOV MAC0CF, #30h ; Initiate a second Right-shift
NOP
; After this instruction, the accumulator should be 0xE044221108
NOP
; The rounding register is updated after this instruction
Rev. 1.0
121
Share Link: GO URL

All Rights Reserved © qdatasheet.com  [ Privacy Policy ] [ Contact Us ]