Numbering System Basics
Sign Extension Mode
The C28x can operate on either unsigned binary or two's complement operands. The “Sign
Extension Mode” (SXM) bit, present within a status register of the C28x, identifies whether or
not the sign extension process is used when a value is brought into the accumulator. It is good
programming practice to always select the desired SXM at the beginning of a module to assure
the proper mode.
What is Sign Extension?
What is Sign Extension?
When moving a value from a narrowed width location
When moving a value from a narrowed width location
to a wider width location, the sign bit is extended to fill
to a wider width location, the sign bit is extended to fill
the width of the destination
the width of the destination
Sign extension applies to signed numbers only
Sign extension applies to signed numbers only
It keeps negative numbers negative!
It keeps negative numbers negative!
Sign extension controlled by SXM bit in ST0 register;
Sign extension controlled by SXM bit in ST0 register;
When SXM = 1, sign extension happens automatically
When SXM = 1, sign extension happens automatically
4 bit Example: Load a memory value into the ACC
4 bit Example: Load a memory value into the ACC
1101
1101
memory
memory
=
=
-
-
2
2
3
3
+ 2
+ 2
2
2
+ 2
+ 2
0
0
=
=
-
-
3
3
1111
1111
1101
1101
ACC
ACC
=
=
-
-
2
2
7
7
+ 2
+ 2
6
6
+ 2
+ 2
5
5
+ 2
+ 2
4
4
+ 2
+ 2
3
3
+ 2
+ 2
2
2
+ 2
+ 2
0
0
=
=
-
-
128 + 64 + 32 + 16 + 8 + 4 + 1
128 + 64 + 32 + 16 + 8 + 4 + 1
=
=
-
-
3
3
Load and sign extend
Load and sign extend
C28x - Numerical Concepts & IQmath
8 - 5
Содержание C28 Series
Страница 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Страница 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Страница 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Страница 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Страница 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Страница 275: ...Appendix eZdsp F2812 eZdsp F2812 Connector Header and Pin Diagram C28x Appendix A eZdsp F2812 A 3 ...
Страница 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Страница 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Страница 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Страница 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Страница 281: ...Appendix JP7 JP8 JP11 JP12 Boot Mode Select JP9 PLL Disable DS1 DS2 LEDs C28x Appendix A eZdsp F2812 A 9 ...
Страница 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...