T5L_ASIC Development Guide
D
WI
N
T
echnology
Pro
f
essional
,
Credi
t
able
,
Success
f
ul
3.3 Mathematical Operating Unit(MDU)
Due to the limited computing power of 8051, the hardware mathematic unit (MDU) is extended in T5L
to improve computing power. OS 8051 applications can access hardware MAC and hardware divider.
The related SFR definitions are as follows:
The MAC hardware multiplier-adder control register is defined as follows.
.7 MAC enable. Write 1 to perform a calculation, and clear after hardware execution;
.6 MAC mode. 1 for multiplier-adder mode: C=A*B+C; 0 for multiplier mode: C=A*B;
.5 Write 0;
.4 1=64bit MAC 0=32bit MAC(A3:0/B3:0/C7:0;note that C is still 64bit );
.3 1 = Signed number; 0 = Unsigned number;
.2-.0 Write 0;
The A
,
B
,
C
register group is the MDU_A, MDU_B, MDU_C register group of extended SFR registers.
DIV hardware divider control register (division C/A, quotient A, remainder B) is defined as follows:
.7 DIV enable. Write 1 to perform a calculation, and clear after hardware execution;
.6 DIV mode 1: Rounded 0: Not rounded;
.5-.4 Undefined, write 0;
.3 1 = Signed number 0 = unsigned number;
.2-.0 Write 0;
The A
,
B
,
C register group is the MDU_A, MDU_B, MDU_C register group of extended SFR
registers.
Example: 32bit MAC calculate 0x1234*0x5678-0x2000
;write A3:A0=0x 00 00 12 34
;write B3:B0=0x 00 00 56 78
;write C7:C0=0xFF FF FF FF FF FF
E0 00 (-0x2000)
;read results00 00 00 00 06 25 E0 60