sincos.vhd
来自「这是我的毕业设计」· VHDL 代码 · 共 1,065 行
VHD
1,065 行
-- Package File Template
--
-- Purpose: This package defines supplemental types, subtypes,
-- constants, and functions
library IEEE;
use IEEE.STD_LOGIC_1164.all;
package sincos is
constant sinrom_width : integer := 6;
constant sinrom_length :integer := 256;
subtype sinrom_word is std_logic_vector(sinrom_width-1 downto 0);
type sinrom_table is array(0 to sinrom_length-1) of sinrom_word;
constant sinvalue:sinrom_table:=sinrom_table'(
"100000",
"100001",
"100001",
"100010",
"100011",
"100100",
"100100",
"100101",
"100110",
"100111",
"100111",
"101000",
"101001",
"101010",
"101010",
"101011",
"101100",
"101100",
"101101",
"101110",
"101110",
"101111",
"110000",
"110000",
"110001",
"110010",
"110010",
"110011",
"110011",
"110100",
"110101",
"110101",
"110110",
"110110",
"110111",
"110111",
"111000",
"111000",
"111001",
"111001",
"111001",
"111010",
"111010",
"111011",
"111011",
"111011",
"111100",
"111100",
"111100",
"111101",
"111101",
"111101",
"111101",
"111101",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111101",
"111101",
"111101",
"111101",
"111101",
"111100",
"111100",
"111100",
"111011",
"111011",
"111011",
"111010",
"111010",
"111001",
"111001",
"111001",
"111000",
"111000",
"110111",
"110111",
"110110",
"110110",
"110101",
"110101",
"110100",
"110011",
"110011",
"110010",
"110010",
"110001",
"110000",
"110000",
"101111",
"101110",
"101110",
"101101",
"101100",
"101100",
"101011",
"101010",
"101010",
"101001",
"101000",
"100111",
"100111",
"100110",
"100101",
"100100",
"100100",
"100011",
"100010",
"100001",
"100001",
"100000",
"011111",
"011110",
"011110",
"011101",
"011100",
"011011",
"011011",
"011010",
"011001",
"011000",
"011000",
"010111",
"010110",
"010101",
"010101",
"010100",
"010011",
"010011",
"010010",
"010001",
"010001",
"010000",
"001111",
"001111",
"001110",
"001101",
"001101",
"001100",
"001100",
"001011",
"001010",
"001010",
"001001",
"001001",
"001000",
"001000",
"000111",
"000111",
"000110",
"000110",
"000110",
"000101",
"000101",
"000100",
"000100",
"000100",
"000011",
"000011",
"000011",
"000010",
"000010",
"000010",
"000010",
"000010",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000010",
"000010",
"000010",
"000010",
"000010",
"000011",
"000011",
"000011",
"000100",
"000100",
"000100",
"000101",
"000101",
"000110",
"000110",
"000110",
"000111",
"000111",
"001000",
"001000",
"001001",
"001001",
"001010",
"001010",
"001011",
"001100",
"001100",
"001101",
"001101",
"001110",
"001111",
"001111",
"010000",
"010001",
"010001",
"010010",
"010011",
"010011",
"010100",
"010101",
"010101",
"010110",
"010111",
"011000",
"011000",
"011001",
"011010",
"011011",
"011011",
"011100",
"011101",
"011110",
"011110",
"011111"
);
constant cosrom_width : integer := 6;
constant cosrom_length :integer := 256;
subtype cosrom_word is std_logic_vector(cosrom_width-1 downto 0);
type cosrom_table is array(0 to cosrom_length-1) of cosrom_word;
constant cosvalue:cosrom_table:=cosrom_table'(
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111101",
"111101",
"111101",
"111101",
"111101",
"111100",
"111100",
"111100",
"111011",
"111011",
"111011",
"111010",
"111010",
"111001",
"111001",
"111001",
"111000",
"111000",
"110111",
"110111",
"110110",
"110110",
"110101",
"110101",
"110100",
"110011",
"110011",
"110010",
"110010",
"110001",
"110000",
"110000",
"101111",
"101110",
"101110",
"101101",
"101100",
"101100",
"101011",
"101010",
"101010",
"101001",
"101000",
"100111",
"100111",
"100110",
"100101",
"100100",
"100100",
"100011",
"100010",
"100001",
"100001",
"100000",
"011111",
"011110",
"011110",
"011101",
"011100",
"011011",
"011011",
"011010",
"011001",
"011000",
"011000",
"010111",
"010110",
"010101",
"010101",
"010100",
"010011",
"010011",
"010010",
"010001",
"010001",
"010000",
"001111",
"001111",
"001110",
"001101",
"001101",
"001100",
"001100",
"001011",
"001010",
"001010",
"001001",
"001001",
"001000",
"001000",
"000111",
"000111",
"000110",
"000110",
"000110",
"000101",
"000101",
"000100",
"000100",
"000100",
"000011",
"000011",
"000011",
"000010",
"000010",
"000010",
"000010",
"000010",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000010",
"000010",
"000010",
"000010",
"000010",
"000011",
"000011",
"000011",
"000100",
"000100",
"000100",
"000101",
"000101",
"000110",
"000110",
"000110",
"000111",
"000111",
"001000",
"001000",
"001001",
"001001",
"001010",
"001010",
"001011",
"001100",
"001100",
"001101",
"001101",
"001110",
"001111",
"001111",
"010000",
"010001",
"010001",
"010010",
"010011",
"010011",
"010100",
"010101",
"010101",
"010110",
"010111",
"011000",
"011000",
"011001",
"011010",
"011011",
"011011",
"011100",
"011101",
"011110",
"011110",
"011111",
"100000",
"100001",
"100001",
"100010",
"100011",
"100100",
"100100",
"100101",
"100110",
"100111",
"100111",
"101000",
"101001",
"101010",
"101010",
"101011",
"101100",
"101100",
"101101",
"101110",
"101110",
"101111",
"110000",
"110000",
"110001",
"110010",
"110010",
"110011",
"110011",
"110100",
"110101",
"110101",
"110110",
"110110",
"110111",
"110111",
"111000",
"111000",
"111001",
"111001",
"111001",
"111010",
"111010",
"111011",
"111011",
"111011",
"111100",
"111100",
"111100",
"111101",
"111101",
"111101",
"111101",
"111101",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110"
);
constant sinrom_width1 : integer := 6;
constant sinrom_length1 :integer := 256;
subtype sinrom_word1 is std_logic_vector(sinrom_width1-1 downto 0);
type sinrom_table1 is array(0 to sinrom_length1-1) of sinrom_word1;
constant sinvalue1:sinrom_table1:=sinrom_table1'(
"100000",
"100001",
"100001",
"100010",
"100011",
"100100",
"100100",
"100101",
"100110",
"100111",
"100111",
"101000",
"101001",
"101010",
"101010",
"101011",
"101100",
"101100",
"101101",
"101110",
"101110",
"101111",
"110000",
"110000",
"110001",
"110010",
"110010",
"110011",
"110011",
"110100",
"110101",
"110101",
"110110",
"110110",
"110111",
"110111",
"111000",
"111000",
"111001",
"111001",
"111001",
"111010",
"111010",
"111011",
"111011",
"111011",
"111100",
"111100",
"111100",
"111101",
"111101",
"111101",
"111101",
"111101",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111101",
"111101",
"111101",
"111101",
"111101",
"111100",
"111100",
"111100",
"111011",
"111011",
"111011",
"111010",
"111010",
"111001",
"111001",
"111001",
"111000",
"111000",
"110111",
"110111",
"110110",
"110110",
"110101",
"110101",
"110100",
"110011",
"110011",
"110010",
"110010",
"110001",
"110000",
"110000",
"101111",
"101110",
"101110",
"101101",
"101100",
"101100",
"101011",
"101010",
"101010",
"101001",
"101000",
"100111",
"100111",
"100110",
"100101",
"100100",
"100100",
"100011",
"100010",
"100001",
"100001",
"100000",
"011111",
"011110",
"011110",
"011101",
"011100",
"011011",
"011011",
"011010",
"011001",
"011000",
"011000",
"010111",
"010110",
"010101",
"010101",
"010100",
"010011",
"010011",
"010010",
"010001",
"010001",
"010000",
"001111",
"001111",
"001110",
"001101",
"001101",
"001100",
"001100",
"001011",
"001010",
"001010",
"001001",
"001001",
"001000",
"001000",
"000111",
"000111",
"000110",
"000110",
"000110",
"000101",
"000101",
"000100",
"000100",
"000100",
"000011",
"000011",
"000011",
"000010",
"000010",
"000010",
"000010",
"000010",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000010",
"000010",
"000010",
"000010",
"000010",
"000011",
"000011",
"000011",
"000100",
"000100",
"000100",
"000101",
"000101",
"000110",
"000110",
"000110",
"000111",
"000111",
"001000",
"001000",
"001001",
"001001",
"001010",
"001010",
"001011",
"001100",
"001100",
"001101",
"001101",
"001110",
"001111",
"001111",
"010000",
"010001",
"010001",
"010010",
"010011",
"010011",
"010100",
"010101",
"010101",
"010110",
"010111",
"011000",
"011000",
"011001",
"011010",
"011011",
"011011",
"011100",
"011101",
"011110",
"011110",
"011111"
);
constant cosrom_width1 : integer := 6;
constant cosrom_length1 :integer := 256;
subtype cosrom_word1 is std_logic_vector(cosrom_width1-1 downto 0);
type cosrom_table1 is array(0 to cosrom_length1-1) of cosrom_word1;
constant cosvalue1:cosrom_table1:=cosrom_table1'(
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111101",
"111101",
"111101",
"111101",
"111101",
"111100",
"111100",
"111100",
"111011",
"111011",
"111011",
"111010",
"111010",
"111001",
"111001",
"111001",
"111000",
"111000",
"110111",
"110111",
"110110",
"110110",
"110101",
"110101",
"110100",
"110011",
"110011",
"110010",
"110010",
"110001",
"110000",
"110000",
"101111",
"101110",
"101110",
"101101",
"101100",
"101100",
"101011",
"101010",
"101010",
"101001",
"101000",
"100111",
"100111",
"100110",
"100101",
"100100",
"100100",
"100011",
"100010",
"100001",
"100001",
"100000",
"011111",
"011110",
"011110",
"011101",
"011100",
"011011",
"011011",
"011010",
"011001",
"011000",
"011000",
"010111",
"010110",
"010101",
"010101",
"010100",
"010011",
"010011",
"010010",
"010001",
"010001",
"010000",
"001111",
"001111",
"001110",
"001101",
"001101",
"001100",
"001100",
"001011",
"001010",
"001010",
"001001",
"001001",
"001000",
"001000",
"000111",
"000111",
"000110",
"000110",
"000110",
"000101",
"000101",
"000100",
"000100",
"000100",
"000011",
"000011",
"000011",
"000010",
"000010",
"000010",
"000010",
"000010",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000001",
"000010",
"000010",
"000010",
"000010",
"000010",
"000011",
"000011",
"000011",
"000100",
"000100",
"000100",
"000101",
"000101",
"000110",
"000110",
"000110",
"000111",
"000111",
"001000",
"001000",
"001001",
"001001",
"001010",
"001010",
"001011",
"001100",
"001100",
"001101",
"001101",
"001110",
"001111",
"001111",
"010000",
"010001",
"010001",
"010010",
"010011",
"010011",
"010100",
"010101",
"010101",
"010110",
"010111",
"011000",
"011000",
"011001",
"011010",
"011011",
"011011",
"011100",
"011101",
"011110",
"011110",
"011111",
"100000",
"100001",
"100001",
"100010",
"100011",
"100100",
"100100",
"100101",
"100110",
"100111",
"100111",
"101000",
"101001",
"101010",
"101010",
"101011",
"101100",
"101100",
"101101",
"101110",
"101110",
"101111",
"110000",
"110000",
"110001",
"110010",
"110010",
"110011",
"110011",
"110100",
"110101",
"110101",
"110110",
"110110",
"110111",
"110111",
"111000",
"111000",
"111001",
"111001",
"111001",
"111010",
"111010",
"111011",
"111011",
"111011",
"111100",
"111100",
"111100",
"111101",
"111101",
"111101",
"111101",
"111101",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110",
"111110"
);
end sincos;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?