Numbering System Basics
8 - 4
C2000 Microcontroller Workshop - Numerical Concepts
To load small two's complement numbers into larger registers:
The MSB of the original number must carry to the MSB of the number when represented in the
larger register.
1.
Load the small number “right justified” into the larger register.
2.
Copy the sign bit (the MSB) of the original number to all unfilled bits to the left in the
register (sign extension).
Consider our two previous values, copied into an 8-bit register:
Examples:
Original No.
0 1 1 0
2
= 6
10
1 1 1 1 0
2
= -2
10
1. Load low
0 1 1 0
1 1 1 1 0
2. Sign Extend
0 0 0 0 0 1 1 0
= 4 + 2 = 6
1 1 1 1 1 1 1 0
= -128 + 64 + ... + 2 = -2
Integer Basics
Integer Basics
Unsigned Binary Integers
0100b = (0*2
3
)+(1*2
2
)+(0*2
1
)+(0*2
0
) = 4
1101b = (1*2
3
)+(1*2
2
)+(0*2
1
)+(1*2
0
) = 13
Signed Binary Integers (2’s Complement)
0100b = (0*-2
3
)+(1*2
2
)+(0*2
1
)+(0*2
0
) = 4
1101b = (1*-2
3
)+(1*2
2
)+(0*2
1
)+(1*2
0
) = -3
2
3
±
2
n-1
2
2
2
1
2
0
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 ...