1
0
SEm-Labos/02-SplineInterpolator/SplineInterpolator/hdl/offsetToUnsigned_studentVersion.vhd
2024-03-15 14:03:21 +01:00

18 lines
437 B
VHDL

ARCHITECTURE studentVersion OF offsetToUnsigned IS
signal mySignal : unsigned(BitNb-1 downto 0);
signal const : unsigned(BitNb-1 downto 0) := (others => '1');
BEGIN
process(signedIn) begin
if signedIn(signedIn'high) then
mySignal <= unsigned(signedIn) - (const srl 1);
else
mySignal <= unsigned(signedIn) + (const srl 1);
end if;
end process;
unsignedOut <= mySignal;
END ARCHITECTURE studentVersion;