entity iir7 is
	port (
		inp: in real;
		outp: out real);
end iir7;

architecture iir7_beh of iir7 is
	constant Coef0 : real := 0.001953125;
	constant Coef1_1 : real := (-1.3125);
	constant Coef1_2 : real := ( 0.6250);
	constant Coef1_3 : real := ( 1.0000);
	constant Coef1_4 : real := ( 1.0000);
	constant Coef2_1 : real := (-1.2500);
	constant Coef2_2 : real := ( 0.7500);
	constant Coef2_3 : real := ( 0.0625);
	constant Coef2_4 : real := ( 1.0000);
	constant Coef3_1 : real := (-1.1250);
	constant Coef3_2 : real := ( 0.921875);
	constant Coef3_3 : real := (-0.2500);
	constant Coef3_4 : real := ( 1.0000);
	constant Coef4_1 : real := (-0.71875);
	constant Coef4_2 : real := ( 1.0000);
begin
	process (inp)
		variable state1, state1_1, state1_2: real;
		variable state2, state2_1, state2_2: real;
		variable state3, state3_1, state3_2: real;
		variable state4, state4_1: real;
		variable inp1, inp2, inp3, inp4: real;
	begin
		inp1 := inp * Coef0;
		state1 := inp1 - state1_1*Coef1_1 + state1_2*Coef1_2;
		inp2 := state1 + Coef1_3*state1 + Coef1_4*state1_2;

		state2 := inp2 - state2_1*Coef2_1 + state2_2*Coef2_2;
		inp3 := state2 + Coef2_3*state1 + Coef2_4*state2_2;

		state3 := inp3 - state3_1*Coef3_1 + state3_2*Coef3_2;
		inp4 := state3 + Coef3_3*state3_1 + Coef3_4*state3_2;

		state4 := inp - Coef4_1*state4_1;
		outp <= state4 + Coef4_2*state4_1;

		state1_2 := state1_1;
		state1_1 := state1;

		state2_2 := state2_1;
		state2_1 := state2;

		state3_2 := state3_1;
		state3_1 := state3;

		state4_1 := state4;
	end process;
end iir7_beh;

configuration cfg_iir7 of iir7 is
	for iir7_beh
	end for;
end cfg_iir7;
