Pape 5
Pape 5
Processor Applications in
Power Electronics
Fixed Point Processors and
Floating Point Processors
Siba Kumar Patro
Multiplication:
The multiplication of two Q-15 numbers results in a Q-30 number.
Consider two decimal fractions x and y. Their multiplication z’ is
Z’ = (x * 215) (y * 215) = xy * 230;
which is the Q-30 representation of the desired fractional result z = xy.
To get the Q-15 representation of the result, it is necessary to multiply z’ as follows.
z * 215 = z’ * 2-15
That is, z’ needs to be shifted right by 15 bits. Equivalently, we may shift z’ left by one
bit, and take the most significant 16 bits of the resulting number to be the Q-15
representation of the result z; this is the preferred method.
Formula: Multiply two Q-15 numbers, shift the 32-bit result left by one bit and take the
most significant 16 bits to get the Q-15 result
Example:
0x4000 * 0x6000 = 0x18000000 0x30000000 0x3000
(0.5 * 0.75 = 0.375)
Multiply 0.6 * 0.7 in Q15 Signed decimal fraction
Fractional Representation in IQ Format or
Binary Fraction Format
31 0
S IIIIIIII fffffffffffffffffffffff
32 bit
.
-2I + 2I-1 + … + 21 + 20 2-1 + 2-2 + … + 2-Q
“IQ” – Format
“I” INTEGER “Q” QUOTIENT
It is implemented by IQ-Math
Advantage Precision same for all numbers in an IQ format
Disadvantage Limited dynamic range compared to Floating-Point
I1Q3 – Format:
3 0
S fff
e: 8-bit exponent field, contains signed 2’s complement integer (2y or 2-y)
s: Sign bit (+x or -x)
f: Fractional part of the mantissa (signed 2’s complement form)
x: Floating point number
Example: +1.7 * 101
+17 s = 0
+17 = 1.0625 * 16=1.0625 * 24
e = 4 and f = 00010000000000000000000
x = 0000 0100 0000 1000 0000 0000 0000 0000
= 0x04080000
1) +32, +18.5 2) Convert Floating Point Number to decimal point number
0x81000000, 0x7f7fffff, 0x7f800000, 0x81ffffff
Floating Point Number Representation
1) 0x81000000
-7f=2-127
000000=(1+0)=1
1*2-127= +5.8774717*10-39
2) 0x7f800000
7f= 2127
800000= -(1+20)=-2
-2*2127=-2128 =-3.4028236*1038
Floating Point Number Representation
e: 8-bit exponent field, contains signed 2’s complement integer (2y or 2-y)
s: Sign bit (+x or -x)
f: Fractional part of the mantissa (signed 2’s complement form)
x: Floating point number
Example: +1.7 * 101
+17 s = 0
+17 = 1.0625 * 16=1.0625 * 24
e = 4 and f = 00010000000000000000000
x = 0000 0100 0000 1000 0000 0000 0000 0000
= 0x04080000
1) +32, +18.5 2) Convert Floating Point Number to decimal point number
0x81000000+5.8774717*10-39, 0x7f7fffff +3.4028234*1038, 0x7f800000 -
3.4028236*1038, 0x81ffffff -5.8774724*10-39
Floating Point Number Representation
D(31-0)
Watchdog
PIE
32-bit R-M-W Interrupt CAN 2.0B
32x32 bit
Auxiliary Atomic FPU Manager
Multiplier I2C
Registers ALU
3
SCI
Real-Time 32-bit
JTAG Register Bus Timers SPI
Emulation
CPU
McBSP
Data Bus
GPIO
Courtesy: TI Modules
The Peripheral Frames
All peripheral registers are grouped together into what are known as “Peripheral
Frames”-PF0, PF1, PF2 and PF3. These frames are mapped in data memory only.
When a digital I/O function is selected, then register group GPxDIR defines the
direction of the Input or Output.
Clearing a bit position to zero configures the line as an input, setting the bit position to
1 configures the line as an output.
A data read from an input line is performed with a set of GPxDAT registers.
A data write to an output line can also be performed with registers GPxDAT.
GPIO Port A
Register (GPAMUX1) GPIO Port A
[GPIO 0 to 15] Qual
Direction Register
(GPADIR)
GPIO Port A Mux2
[GPIO 0 to 31]
Register (GPAMUX2)
[GPIO 16 to 31]
GPIO Port B
Register (GPBMUX1) GPIO Port B
[GPIO 32 to 47]
Qual
Direction Register
GPIO Port B Mux2 (GPBDIR)
Register (GPBMUX2) [GPIO 32 to 63]
[GPIO 48 to 63]
GPIO Port C
Register (GPCMUX1) GPIO Port C
[GPIO 64 to 79] Direction Register
GPIO Port C Mux2 (GPCDIR)
Register (GPCMUX2) [GPIO 64 to 87]
[GPIO 80 to 87]
Thank You
20