Explorar el Código

Исправлена ошибка при расчете оконной функции. Добавлено ограничение масимального значения "сверху".

Shalambala hace 2 años
padre
commit
5831d0bd80
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      S5443_M/S5443.srcs/sources_1/new/InternalDsp/Win_calc.v

+ 4 - 3
S5443_M/S5443.srcs/sources_1/new/InternalDsp/Win_calc.v

@@ -105,6 +105,7 @@ module Win_calc	(
 		
 	wire	signed	[CalcWidthR-1:0]	approxSin	=	a5b5Cut+a4b4Cut+a3b3Cut+a2b2Cut+a1bCut+bPrevSh;	
 	
+	wire	signed	[CalcWidthR-1:0]	resultSin	=	approxSin[17]?	18'h1ffff:approxSin;
 //================================================================================
 //  ASSIGNMENTS
 // ================================================================================	
@@ -148,7 +149,7 @@ end
 always	@(*)	begin
 	if	(!reset_i)	begin
 		tukeyCorr	=	(tukeyWind+constOne);
-		sinWindPow2	=	approxSin**2;
+		sinWindPow2	=	resultSin**2;
 	end	else	begin
 		tukeyCorr	=	18'h0;
 		sinWindPow2	=	18'h0;
@@ -181,9 +182,9 @@ always	@(*)	begin
 	if	(!reset_i)	begin
 		if	(!win_type_i)	begin 
 			if	(!WinCtrl_i)	begin
-				tukeyWind	=	approxSin;
+				tukeyWind	=	resultSin;
 			end	else	begin
-				tukeyWind	=	0-approxSin;
+				tukeyWind	=	0-resultSin;
 			end
 		end	else	begin
 			tukeyWind	=	18'h0;