1
0
SEm-Labos/02-SplineInterpolator/SplineInterpolator/hdl/resizer_studentVersion.vhd
2024-03-05 11:48:52 +01:00

25 lines
653 B
VHDL

ARCHITECTURE studentVersion OF resizer IS
signal mySignal : unsigned(outputBitNb-1 downto 0);
--------------------------------------------------------------------------------
BEGIN
INPUT_BIGGER: if inputBitNb >= outputBitNb generate
process(resizeIn)
begin
mySignal <= resize(shift_right(resizeIn, inputBitNb - outputBitNb), outputBitNb);
end process;
end generate INPUT_BIGGER;
OUTPUT_BIGGER: if inputBitNb <= outputBitNb generate
process(resizeIn)
begin
mySignal <= shift_left(resize(resizeIn, outputBitNb), outputBitNb - inputBitNb);
end process;
end generate OUTPUT_BIGGER;
resizeOut <= mySignal;
END ARCHITECTURE studentVersion;