Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
d610c00d
Commit
d610c00d
authored
Feb 1, 2021
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Improved and clarified definition of sign of resolution_w in TO_SREAL().
parent
4a0077ff
No related branches found
No related tags found
2 merge requests
!100
Removed text for XSub that is now written in Confluence Subband correlator...
,
!68
Resolve L2SDP-162
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/src/vhdl/common_pkg.vhd
+4
-3
4 additions, 3 deletions
libraries/base/common/src/vhdl/common_pkg.vhd
with
4 additions
and
3 deletions
libraries/base/common/src/vhdl/common_pkg.vhd
+
4
−
3
View file @
d610c00d
...
@@ -1793,12 +1793,13 @@ PACKAGE BODY common_pkg IS
...
@@ -1793,12 +1793,13 @@ PACKAGE BODY common_pkg IS
VARIABLE
v_real
:
REAL
:
=
TO_SREAL
(
svec
);
VARIABLE
v_real
:
REAL
:
=
TO_SREAL
(
svec
);
BEGIN
BEGIN
-- Then scale to real:
-- Then scale to real:
-- . The resolution_w is the number of bits that LSbit 0 in svec is after or before the fixed point.
-- . The resolution_w is the number of bits that LSbit 0 in svec(HIGH-1 DOWNTO 0) is after
-- . The real value is then scaled by scaling the integer value by 2**resolution_w:
-- (when resolution_w > 0), or before (when resolution_w < 0) the fixed point.
-- . The real value is then scaled by scaling the integer value by 2**(-1 * resolution_w):
-- . resolution_w = 0 : scale by 2**0 = 1, so no scaling and the value is treated as an integer
-- . resolution_w = 0 : scale by 2**0 = 1, so no scaling and the value is treated as an integer
-- . resolution_w < 0 : scale up
-- . resolution_w < 0 : scale up
-- . resolution_w > 0 : scale down
-- . resolution_w > 0 : scale down
RETURN
v_real
*
2
.
0
**
REAL
(
resolution_w
);
RETURN
v_real
*
2
.
0
**
REAL
(
-1
*
resolution_w
);
END
;
END
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment