Entity arith_scaler
Block Diagram of arith_scaler
A flexible scaler for fixed-point values. The scaler is implemented for a set of multiplier and divider values. Each individual scaling operation can arbitrarily select one value from each these sets.
The computation calculates: unsigned(arg) * MULS(msel) / DIVS(dsel)
rounded to the nearest (tie upwards) fixed-point result of the same precision
as arg
.
The computation is started by asserting start
to high for one cycle. If a
computation is running, it will be restarted. The completion of a calculation
is signaled via done
. done
is high when no computation is in progress.
The result of the last scaling operation is stable and can be read from
res
. The weight of the LSB of res
is the same as the LSB of arg
.
Make sure to tap a sufficient number of result bits in accordance to the
highest scaling ratio to be used in order to avoid a truncation overflow.
Name |
Type |
Default |
Description |
---|---|---|---|
MULS |
(0 => 1) |
|
|
DIVS |
(0 => 1) |
The set of divisors to choose from in scaling operations. |
Name |
Type |
Direction |
Description |
---|---|---|---|
clk |
std_logic |
in |
|
rst |
std_logic |
in |
|
start |
std_logic |
in |
|
arg |
std_logic_vector |
in |
|
msel |
std_logic_vector |
in |
|
dsel |
std_logic_vector |
in |
|
done |
std_logic |
out |
|
res |
std_logic_vector |
out |
Result |