1
0
SEm-Labos/02-SplineInterpolator/SplineInterpolator/hdl/interpolatorCalculatePolynom_studentVersion.vhd

43 lines
1.1 KiB
VHDL
Raw Normal View History

2024-02-23 13:01:05 +00:00
ARCHITECTURE studentVersion OF interpolatorCalculatePolynom IS
2024-03-10 20:50:07 +00:00
2024-03-13 13:21:54 +00:00
subtype st is signed(coeffBitNb-1+oversamplingBitNb+8 DOWNTO 0);
signal x: st;
signal u: st;
signal v: st;
signal w: st;
signal y: st;
2024-03-10 20:50:07 +00:00
2024-02-23 13:01:05 +00:00
BEGIN
2024-03-10 20:50:07 +00:00
process(clock, reset) begin
if reset = '1' then
2024-03-13 13:21:54 +00:00
x <= (others => '0');
u <= (others => '0');
v <= (others => '0');
w <= (others => '0');
y <= (others => '0');
2024-03-10 20:50:07 +00:00
elsif rising_edge(clock) then
if restartPolynom = '1' then
2024-03-10 20:50:07 +00:00
2024-03-13 13:21:54 +00:00
x <= resize(d, st'high+1) sll (oversamplingBitNb * 3 + 1);
u <= resize(a, st'high+1) + (resize(b, st'high+1) sll oversamplingBitNb) + (resize(c, st'high+1) sll (oversamplingBitNb*2));
v <= resize(6*a, v'length) + (resize(b, st'high+1) sll (oversamplingBitNb + 1));
w <= resize(6*a, w'length);
y <= resize(d, st'high+1);
else
2024-03-10 20:50:07 +00:00
2024-03-13 13:21:54 +00:00
x <= x + u;
u <= u + v;
v <= v + w;
y <= x srl (oversamplingBitNb * 3 + 1);
end if;
2024-03-13 13:21:54 +00:00
2024-03-10 20:50:07 +00:00
end if;
end process;
2024-03-13 13:21:54 +00:00
sampleOut <= resize(y,signalBitNb);
2024-02-23 13:01:05 +00:00
END ARCHITECTURE studentVersion;