![Freescale Semiconductor ColdFire MCF5211 Скачать руководство пользователя страница 99](http://html1.mh-extra.com/html/freescale-semiconductor/coldfire-mcf5211/coldfire-mcf5211_reference-manual_2330619099.webp)
Multiply-Accumulate Unit (MAC)
MCF5213 ColdFire® Integrated Microcontroller Reference Manual, Rev. 3
Freescale Semiconductor
4-13
/* select the input operands */
if (sz == word)
then {if (U/Ly == 1)
then operandY[31:0] = {0x0000, Ry[31:16]}
else operandY[31:0] = {0x0000, Ry[15:0]}
if (U/Lx == 1)
then operandX[31:0] = {0x0000, Rx[31:16]}
else operandX[31:0] = {0x0000, Rx[15:0]}
}
else {operandY[31:0] = Ry[31:0]
operandX[31:0] = Rx[31:0]
}
/* perform the multiply */
product[63:0] = operandY[31:0] * operandX[31:0]
/* check for product overflow */
if (product[63:32] != 0x0000_0000)
then {
/* product overflow */
MACSR.V = 1
if (inst == MSAC && MACSR.OMC == 1)
then result[31:0] = 0x0000_0000
else if (MACSR.OMC == 1)
then /* overflowed MAC,
saturationMode enabled */
result[31:0] = 0xffff_ffff
}
/* scale product before combining with accumulator */
switch (SF)
/* 2-bit scale factor */
{
case 0:
/* no scaling specified */
break;
case 1:
/* SF = “<< 1” */
if (product[31] == 1)
then {MACSR.V = 1
if (inst == MSAC && MACSR.OMC == 1)
then result[31:0] = 0x0000_0000
else if (MACSR.OMC == 1)
then /* overflowed MAC,
saturationMode enabled */
result[31:0] = 0xffff_ffff
}
else product[31:0] = {product[30:0], 0}
break;
case 2:
/* reserved encoding */
break;
case 3:
/* SF = “>> 1” */
product[31:0] = {0, product[31:1]}
break;
}
/* combine with accumulator */
if (MACSR.V == 0)
then {if (inst == MSAC)
then result[31:0] = acc[31:0] - product[31:0]
else result[31:0] = acc[31:0] + product[31:0]
Содержание ColdFire MCF5211
Страница 48: ...Overview MCF5213 ColdFire Integrated Microcontroller Reference Manual Rev 3 1 14 Freescale Semiconductor...
Страница 158: ...Reset Controller Module MCF5213 ColdFire Integrated Microcontroller Reference Manual Rev 3 9 10 Freescale Semiconductor...
Страница 218: ...Edge Port Module EPORT MCF5213 ColdFire Integrated Microcontroller Reference Manual Rev 3 13 8 Freescale Semiconductor...
Страница 234: ...DMA Controller Module MCF5213 ColdFire Integrated Microcontroller Reference Manual Rev 3 14 16 Freescale Semiconductor...
Страница 378: ...I2 C Interface MCF5213 ColdFire Integrated Microcontroller Reference Manual Rev 3 22 16 Freescale Semiconductor...
Страница 468: ...FlexCAN MCF5213 ColdFire Integrated Microcontroller Reference Manual Rev 3 25 30 Freescale Semiconductor...