Numbering System Basics
C2000 Microcontroller Workshop - Numerical Concepts
8 - 5
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?
When moving a value from a narrowed width location to a
wider width location, the sign bit is extended to fill the width
of the destination
Sign extension applies to signed numbers only
It keeps negative numbers negative!
Sign extension controlled by SXM bit in ST0 register; When
SXM = 1, sign extension happens automatically
4 bit Example: Load a memory value into the ACC
1101
memory
= -2
3
+ 2
2
+ 2
0
= -3
ACC
= -2
7
+ 2
6
+ 2
5
+ 2
4
+ 2
3
+ 2
2
+ 2
0
= -128 + 64 + 32 + 16 + 8 + 4 + 1
= -3
Load and sign extend
1111 1101
Summary of Contents for C2000 Piccolo LaunchPad
Page 74: ...Interrupts 4 18 C2000 Microcontroller Workshop Reset and Interrupts ...
Page 100: ...Lab 5 System Initialization 5 26 C2000 Microcontroller Workshop System Initialization ...
Page 218: ...Lab 8 IQmath FIR Filter 8 42 C2000 Microcontroller Workshop Numerical Concepts ...
Page 334: ...F28069 controlCARD A 4 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 ...
Page 336: ...F28035 controlCARD A 6 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 SW3 ...