Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
CMSIS DSP Library
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
3 replies
Subscribers
127 subscribers
Views
5653 views
Users
0 members are here
Related
CMSIS DSP Library
Offline
Jagadeesh Konakalla
over 7 years ago
Note: This was originally posted on 27th November 2012 at http://forums.arm.com
Hi,
I am new user to CMSIS. I have gone through the DSP library function. I am interested in fixed point arithemetic.
As per the documentation, i have understood that Q7, Q15 and Q31 formats are only supported. Is that correct ?
I would like to multiply different Q formats. Example : For multiplication, input 1 is Q17, input2 is Q 27 and output required is Q19.
How can we use the DSP library functions such as
arm_mult_q31
for the example mentioned ?
Parents
Offline
Peter Harris
over 7 years ago
Note: This was originally posted on 27th November 2012 at
http://forums.arm.com
Why do you want to mix and match lots of Q formats?
Because you always end up doing format conversion you pretty rapidly accumulate error, so it's not entirely sure what you hope to achieve.
The Q7, Q15, and Q31 formats are chosen because they always encode a value between -1 and 1. Q7 is encoded in a byte value, Q15 as a short, and Q32 as a long. In each case you get N-1 fractional bits plus a single integer bit (effectively only acting as a 2's complement sign bit for these formats), so the only difference is effective precision of the fractional part.
The advantage of this approach is that if you multiply two numbers together there is little normalization to do (you are guaranteed to only get one integer bit out). As soon as you allow multiple integer bits then you need to rescale the inputs and outputs (worst case in a format with N integer bits you get 2N integer bits in the output), and you start accumulating error and generating values you cannot actually legally encode in your format. This is very hard to encapsulate in any library, and is often the "wrong solution" because it has so many corner cases.
HTH,
Iso
Cancel
Up
0
Down
Reply
Cancel
Reply
Offline
Peter Harris
over 7 years ago
Note: This was originally posted on 27th November 2012 at
http://forums.arm.com
Why do you want to mix and match lots of Q formats?
Because you always end up doing format conversion you pretty rapidly accumulate error, so it's not entirely sure what you hope to achieve.
The Q7, Q15, and Q31 formats are chosen because they always encode a value between -1 and 1. Q7 is encoded in a byte value, Q15 as a short, and Q32 as a long. In each case you get N-1 fractional bits plus a single integer bit (effectively only acting as a 2's complement sign bit for these formats), so the only difference is effective precision of the fractional part.
The advantage of this approach is that if you multiply two numbers together there is little normalization to do (you are guaranteed to only get one integer bit out). As soon as you allow multiple integer bits then you need to rescale the inputs and outputs (worst case in a format with N integer bits you get 2N integer bits in the output), and you start accumulating error and generating values you cannot actually legally encode in your format. This is very hard to encapsulate in any library, and is often the "wrong solution" because it has so many corner cases.
HTH,
Iso
Cancel
Up
0
Down
Reply
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Answered
ubuntu - How to uninstall Arm Development studio and all its requirements
0
Arm Development Studio
5790
views
1
reply
Latest
2 months ago
by
Jonathan Simmonds
Answered
DSTREAM Probe damage - Spare parts?
0
DSTREAM
8004
views
2
replies
Latest
2 months ago
by
SamGKN
Suggested Answer
Optimized ARM version of memcmp
0
6465
views
3
replies
Latest
2 months ago
by
Ronan Synnott
Not Answered
Develop Kotlin apps with OpenCl to run in a Samsung mobile that use Mali G71
0
5737
views
2
replies
Latest
3 months ago
by
ARMStrongssen
Answered
FVP Debug problems for Blinky Example project on Cortex-M4
0
Fixed Virtual Platforms (FVPs)
Debugging
Cortex-M4
6600
views
2
replies
Latest
3 months ago
by
Sagittarius
<
>
View all questions in Arm Development Studio forum