Reduce amplitude to avoid numeric overflow.
This commit is contained in:
		
							parent
							
								
									0685db9d92
								
							
						
					
					
						commit
						7de76c6696
					
				| 
						 | 
					@ -79,7 +79,7 @@ architecture rtl of sincos_gen is
 | 
				
			||||||
    begin
 | 
					    begin
 | 
				
			||||||
        for i in 0 to table_size-1 loop
 | 
					        for i in 0 to table_size-1 loop
 | 
				
			||||||
            sin_flt := sin(real(2*i + 1) / real(2 * table_size) * MATH_PI / 2.0);
 | 
					            sin_flt := sin(real(2*i + 1) / real(2 * table_size) * MATH_PI / 2.0);
 | 
				
			||||||
            sin_int := integer(sin_flt * real(2**table_width - 1));
 | 
					            sin_int := integer(sin_flt * real(2**table_width - 2));
 | 
				
			||||||
            tbl(i) := std_logic_vector(to_unsigned(sin_int, table_width));
 | 
					            tbl(i) := std_logic_vector(to_unsigned(sin_int, table_width));
 | 
				
			||||||
        end loop;
 | 
					        end loop;
 | 
				
			||||||
        return tbl;
 | 
					        return tbl;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue