What is the "net slope"
조회 수: 2 (최근 30일)
이전 댓글 표시
In matlab doc, there is only "handling net slope computation".
I want to know meaning of "net slope", not method of dealing with net slope like above I said.
So, let me know the "net slope" itself.
댓글 수: 2
John D'Errico
2023년 2월 21일
Where? In which MATLAB doc, since there are thousands of pages of MATLAB docs?
I can start looking now, but I expect it to be weeks before I have read EVERY page of EVERY MATLAB doc.
채택된 답변
Andy Bartlett
2023년 2월 21일
편집: Andy Bartlett
2023년 2월 21일
Net slope is used in fixed-point operations to achieve agreement of scaling. The slopes of all the variables involved in an operation are combined into one multiplicative term called the net slope.
For example, multiply two variables with 10 bits to the right of the binary point and assign the product to a type with 12 bits to the right of the binary point.
The real world operation is
Vout = V1 * V2
The fixed-point scalings for these variables showing the slopes and stored integers are
Vout = (2^-12) * Qout
V1 = (2^-10) * Q1
V1 = (2^-10) * Q2
Via substitution we get
(2^-12) * Qout = (2^-10) * Q1 * (2^-10) * Q2
solving for the output stored integer and conslidating terms, we will see the Net Slope
Qout = (2^(-10-10+12)) * Q1 * Q2
NetSlope = 2^(-10-10+12) = 2^-8
In this case, the NetSlope can be perfectly represented in fixed-point. In fact, a simple shift right of 8 bits will efficiently achieve agreement of all the scalings.
The NetSlope gets more challenging when it is not an exact power of two.
Suppose the two inputs and the output had slopes of 6, 4, and 9 respectively. In that case, we have
NetSlope = (6*4)/9 = 8/3
To avoid costly division, this will get approximated with a fixed-point variable such as
format long g
fi(8/3,0,16)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!