OpenCores
URL https://opencores.org/ocsvn/all_digital_fm_receiver/all_digital_fm_receiver/trunk

Subversion Repositories all_digital_fm_receiver

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

/tags/ver-1/fmTri.txt
0,0 → 1,1000
01111111
01110110
01011011
00110010
00000010
11010001
10101000
10001011
10000000
10001000
10100010
11001010
11111010
00101011
01010110
01110011
01111111
01111001
01100000
00111001
00001001
11011000
10101101
10001110
10000000
10000110
10011110
11000100
11110100
00100101
01010001
01110001
01111111
01111011
01100100
00111110
00001111
11011101
10110001
10010001
10000001
10000100
10011010
11000000
11101111
00100000
01001101
01101110
01111111
01111100
01100111
01000010
00010011
11100010
10110101
10010011
10000010
10000011
10011000
10111100
11101011
00011101
01001010
01101100
01111110
01111101
01101001
01000101
00010111
11100101
10110111
10010101
10000010
10000011
10010110
10111010
11101000
00011010
01001000
01101011
01111110
01111101
01101010
01000111
00011001
11100111
10111001
10010101
10000010
10000010
10010110
10111001
11100111
00011001
01000111
01101010
01111110
01111110
01101011
01000111
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111001
11100111
00011001
01000111
01101010
01111110
01111110
01101010
01000111
00011001
11100111
10111000
10010101
10000010
10000011
10010110
10111010
11101000
00011010
01001000
01101011
01111110
01111101
01101001
01000101
00010111
11100101
10110111
10010100
10000010
10000011
10010111
10111100
11101011
00011101
01001010
01101101
01111110
01111101
01101000
01000011
00010100
11100010
10110100
10010010
10000001
10000100
10011010
10111111
11101110
00100001
01001110
01101111
01111111
01111011
01100101
00111111
00001111
11011101
10110000
10010000
10000001
10000101
10011101
11000011
11110011
00100110
01010010
01110001
01111111
01111010
01100001
00111010
00001001
11011000
10101100
10001101
10000000
10000111
10100001
11001001
11111010
00101100
01010111
01110100
01111111
01111000
01011101
00110100
00000010
11010001
10100111
10001010
10000000
10001010
10100110
11010000
00000001
00110011
01011100
01110111
01111111
01110101
01010111
00101101
11111011
11001010
10100001
10000111
10000000
10001101
10101011
11010111
00001001
00111001
01100001
01111010
01111111
01110010
01010010
00100110
11110100
11000100
10011101
10000101
10000001
10010000
10110000
11011100
00001110
00111110
01100101
01111011
01111111
01101111
01001110
00100001
11101111
11000000
10011010
10000100
10000001
10010010
10110011
11100001
00010011
01000010
01100111
01111100
01111110
01101101
01001011
00011101
11101011
10111100
10011000
10000011
10000010
10010100
10110110
11100100
00010110
01000101
01101001
01111101
01111110
01101100
01001001
00011011
11101001
10111010
10010110
10000011
10000010
10010101
10111000
11100110
00011000
01000110
01101010
01111101
01111110
01101011
01001000
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111001
11100111
00011001
01000111
01101010
01111101
01111110
01101011
01000111
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111000
11100110
00011000
01000110
01101010
01111101
01111110
01101011
01001000
00011010
11101001
10111010
10010111
10000011
10000010
10010100
10110111
11100100
00010110
01000101
01101001
01111101
01111110
01101100
01001010
00011101
11101011
10111101
10011000
10000011
10000010
10010011
10110100
11100001
00010011
01000010
01100111
01111100
01111111
01101110
01001101
00100000
11101111
11000000
10011011
10000100
10000001
10010001
10110001
11011101
00001111
00111110
01100100
01111011
01111111
01110001
01010001
00100101
11110100
11000100
10011110
10000110
10000000
10001110
10101101
11011000
00001001
00111001
01100000
01111001
01111111
01110011
01010110
00101011
11111010
11001010
10100010
10001000
10000000
10001011
10101000
11010001
00000010
00110010
01011011
01110110
01111111
01110110
01011011
00110010
00000010
11010001
10101000
10001011
10000000
10001000
10100010
11001010
11111010
00101011
01010110
01110011
01111111
01111001
01100000
00111001
00001001
11011000
10101101
10001110
10000000
10000110
10011110
11000100
11110100
00100101
01010001
01110001
01111111
01111011
01100100
00111110
00001111
11011101
10110001
10010001
10000001
10000100
10011010
11000000
11101111
00100000
01001101
01101110
01111111
01111100
01100111
01000010
00010011
11100010
10110101
10010011
10000010
10000011
10011000
10111100
11101011
00011101
01001010
01101100
01111110
01111101
01101001
01000101
00010111
11100101
10110111
10010101
10000010
10000011
10010110
10111010
11101000
00011010
01001000
01101011
01111110
01111101
01101010
01000111
00011001
11100111
10111001
10010101
10000010
10000010
10010110
10111001
11100111
00011001
01000111
01101010
01111110
01111110
01101011
01000111
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111001
11100111
00011001
01000111
01101010
01111110
01111110
01101010
01000111
00011001
11100111
10111000
10010101
10000010
10000011
10010110
10111010
11101000
00011010
01001000
01101011
01111110
01111101
01101001
01000101
00010111
11100101
10110111
10010100
10000010
10000011
10010111
10111100
11101011
00011101
01001010
01101101
01111110
01111101
01101000
01000011
00010100
11100010
10110100
10010010
10000001
10000100
10011010
10111111
11101110
00100001
01001110
01101111
01111111
01111011
01100101
00111111
00001111
11011101
10110000
10010000
10000001
10000101
10011101
11000011
11110011
00100110
01010010
01110001
01111111
01111010
01100001
00111010
00001001
11011000
10101100
10001101
10000000
10000111
10100001
11001001
11111010
00101100
01010111
01110100
01111111
01111000
01011101
00110100
00000010
11010001
10100111
10001010
10000000
10001010
10100110
11010000
00000001
00110011
01011100
01110111
01111111
01110101
01010111
00101101
11111011
11001010
10100001
10000111
10000000
10001101
10101011
11010111
00001001
00111001
01100001
01111010
01111111
01110010
01010010
00100110
11110100
11000100
10011101
10000101
10000001
10010000
10110000
11011100
00001110
00111110
01100101
01111011
01111111
01101111
01001110
00100001
11101111
11000000
10011010
10000100
10000001
10010010
10110011
11100001
00010011
01000010
01100111
01111100
01111110
01101101
01001011
00011101
11101011
10111100
10011000
10000011
10000010
10010100
10110110
11100100
00010110
01000101
01101001
01111101
01111110
01101100
01001001
00011011
11101001
10111010
10010110
10000011
10000010
10010101
10111000
11100110
00011000
01000110
01101010
01111101
01111110
01101011
01001000
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111001
11100111
00011001
01000111
01101010
01111101
01111110
01101011
01000111
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111000
11100110
00011000
01000110
01101010
01111101
01111110
01101011
01001000
00011010
11101001
10111010
10010111
10000011
10000010
10010100
10110111
11100100
00010110
01000101
01101001
01111101
01111110
01101100
01001010
00011101
11101011
10111101
10011000
10000011
10000010
10010011
10110100
11100001
00010011
01000010
01100111
01111100
01111111
01101110
01001101
00100000
11101111
11000000
10011011
10000100
10000001
10010001
10110001
11011101
00001111
00111110
01100100
01111011
01111111
01110001
01010001
00100101
11110100
11000100
10011110
10000110
10000000
10001110
10101101
11011000
00001001
00111001
01100000
01111001
01111111
01110011
01010110
00101011
11111010
11001010
10100010
10001000
10000000
10001011
10101000
11010001
00000010
00110010
01011011
01110110
01111111
01110110
01011011
00110010
00000010
11010001
10101000
10001011
10000000
10001000
10100010
11001010
11111010
00101011
01010110
01110011
01111111
01111001
01100000
00111001
00001001
11011000
10101101
10001110
10000000
10000110
10011110
11000100
11110100
00100101
01010001
01110001
01111111
01111011
01100100
00111110
00001111
11011101
10110001
10010001
10000001
10000100
10011010
11000000
11101111
00100000
01001101
01101110
01111111
01111100
01100111
01000010
00010011
11100010
10110101
10010011
10000010
10000011
10011000
10111100
11101011
00011101
01001010
01101100
01111110
01111101
01101001
01000101
00010111
11100101
10110111
10010101
10000010
10000011
10010110
10111010
11101000
00011010
01001000
01101011
01111110
01111101
01101010
01000111
00011001
11100111
10111001
10010101
10000010
10000010
10010110
10111001
11100111
00011001
01000111
01101010
01111110
01111110
01101011
01000111
00011001
11100111
10111001
10010110
10000011
10000010
10010101
10111001
11100111
00011001
01000111
01101010
01111110
01111110
01101010
01000111
00011001
11100111
10111000
10010101
10000010
10000011
10010110
10111010
11101000
00011010
01001000
01101011
01111110
01111101
01101001
01000101
00010111
11100101
10110111
10010100
10000010
10000011
10010111
10111100
11101011
00011101
01001010
01101101
01111110
01111101
01101000
01000011
00010100
11100010
10110100
10010010
10000001
10000100
10011010
10111111
11101110
00100001
01001110
01101111
01111111
01111011
01100101
00111111
00001111
11011101
10110000
10010000
10000001
10000101
10011101
11000011
11110011
00100110
01010010
01110001
01111111
01111010
01100001
00111010
00001001
11011000
10101100
10001101
10000000
10000111
10100001
11001001
11111010
00101100
01010111
01110100
01111111
01111000
01011101
00110100
00000010
11010001
10100111
10001010
/tags/ver-1/nco.vhd
0,0 → 1,308
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
 
 
 
ENTITY nco IS
-- Declarations
port ( clk : in std_logic;
reset : in std_logic;
din : in signed(11 downto 0);
dout : out signed(7 downto 0)
);
END nco ;
 
-- hds interface_end
ARCHITECTURE behavior OF nco IS
type vectype is array (0 to 256) of signed(7 downto 0);
-- ROM cosrom
constant cosrom : vectype := (
0 => "01111111",
1 => "01111111",
2 => "01111111",
3 => "01111111",
4 => "01111111",
5 => "01111111",
6 => "01111111",
7 => "01111111",
8 => "01111111",
9 => "01111111",
10 => "01111111",
11 => "01111111",
12 => "01111111",
13 => "01111111",
14 => "01111111",
15 => "01111111",
16 => "01111111",
17 => "01111111",
18 => "01111111",
19 => "01111111",
20 => "01111111",
21 => "01111111",
22 => "01111111",
23 => "01111111",
24 => "01111111",
25 => "01111110",
26 => "01111110",
27 => "01111110",
28 => "01111110",
29 => "01111110",
30 => "01111110",
31 => "01111110",
32 => "01111110",
33 => "01111101",
34 => "01111101",
35 => "01111101",
36 => "01111101",
37 => "01111101",
38 => "01111101",
39 => "01111100",
40 => "01111100",
41 => "01111100",
42 => "01111100",
43 => "01111100",
44 => "01111011",
45 => "01111011",
46 => "01111011",
47 => "01111011",
48 => "01111010",
49 => "01111010",
50 => "01111010",
51 => "01111010",
52 => "01111010",
53 => "01111001",
54 => "01111001",
55 => "01111001",
56 => "01111001",
57 => "01111000",
58 => "01111000",
59 => "01111000",
60 => "01110111",
61 => "01110111",
62 => "01110111",
63 => "01110111",
64 => "01110110",
65 => "01110110",
66 => "01110110",
67 => "01110101",
68 => "01110101",
69 => "01110101",
70 => "01110100",
71 => "01110100",
72 => "01110100",
73 => "01110011",
74 => "01110011",
75 => "01110011",
76 => "01110010",
77 => "01110010",
78 => "01110010",
79 => "01110001",
80 => "01110001",
81 => "01110001",
82 => "01110000",
83 => "01110000",
84 => "01101111",
85 => "01101111",
86 => "01101111",
87 => "01101110",
88 => "01101110",
89 => "01101101",
90 => "01101101",
91 => "01101101",
92 => "01101100",
93 => "01101100",
94 => "01101011",
95 => "01101011",
96 => "01101010",
97 => "01101010",
98 => "01101010",
99 => "01101001",
100 => "01101001",
101 => "01101000",
102 => "01101000",
103 => "01100111",
104 => "01100111",
105 => "01100110",
106 => "01100110",
107 => "01100101",
108 => "01100101",
109 => "01100100",
110 => "01100100",
111 => "01100011",
112 => "01100011",
113 => "01100010",
114 => "01100010",
115 => "01100001",
116 => "01100001",
117 => "01100000",
118 => "01100000",
119 => "01011111",
120 => "01011111",
121 => "01011110",
122 => "01011110",
123 => "01011101",
124 => "01011101",
125 => "01011100",
126 => "01011100",
127 => "01011011",
128 => "01011011",
129 => "01011010",
130 => "01011001",
131 => "01011001",
132 => "01011000",
133 => "01011000",
134 => "01010111",
135 => "01010111",
136 => "01010110",
137 => "01010101",
138 => "01010101",
139 => "01010100",
140 => "01010100",
141 => "01010011",
142 => "01010010",
143 => "01010010",
144 => "01010001",
145 => "01010001",
146 => "01010000",
147 => "01001111",
148 => "01001111",
149 => "01001110",
150 => "01001110",
151 => "01001101",
152 => "01001100",
153 => "01001100",
154 => "01001011",
155 => "01001010",
156 => "01001010",
157 => "01001001",
158 => "01001000",
159 => "01001000",
160 => "01000111",
161 => "01000111",
162 => "01000110",
163 => "01000101",
164 => "01000101",
165 => "01000100",
166 => "01000011",
167 => "01000011",
168 => "01000010",
169 => "01000001",
170 => "01000001",
171 => "01000000",
172 => "00111111",
173 => "00111110",
174 => "00111110",
175 => "00111101",
176 => "00111100",
177 => "00111100",
178 => "00111011",
179 => "00111010",
180 => "00111010",
181 => "00111001",
182 => "00111000",
183 => "00111000",
184 => "00110111",
185 => "00110110",
186 => "00110101",
187 => "00110101",
188 => "00110100",
189 => "00110011",
190 => "00110011",
191 => "00110010",
192 => "00110001",
193 => "00110000",
194 => "00110000",
195 => "00101111",
196 => "00101110",
197 => "00101101",
198 => "00101101",
199 => "00101100",
200 => "00101011",
201 => "00101010",
202 => "00101010",
203 => "00101001",
204 => "00101000",
205 => "00100111",
206 => "00100111",
207 => "00100110",
208 => "00100101",
209 => "00100100",
210 => "00100100",
211 => "00100011",
212 => "00100010",
213 => "00100001",
214 => "00100001",
215 => "00100000",
216 => "00011111",
217 => "00011110",
218 => "00011110",
219 => "00011101",
220 => "00011100",
221 => "00011011",
222 => "00011011",
223 => "00011010",
224 => "00011001",
225 => "00011000",
226 => "00011000",
227 => "00010111",
228 => "00010110",
229 => "00010101",
230 => "00010100",
231 => "00010100",
232 => "00010011",
233 => "00010010",
234 => "00010001",
235 => "00010001",
236 => "00010000",
237 => "00001111",
238 => "00001110",
239 => "00001101",
240 => "00001101",
241 => "00001100",
242 => "00001011",
243 => "00001010",
244 => "00001010",
245 => "00001001",
246 => "00001000",
247 => "00000111",
248 => "00000110",
249 => "00000110",
250 => "00000101",
251 => "00000100",
252 => "00000011",
253 => "00000010",
254 => "00000010",
255 => "00000001",
256 => "00000000");
 
signal dtemp : unsigned(17 downto 0);
signal din_buf : signed(17 downto 0);
signal dtemp1 : integer;
constant offset : unsigned(17 downto 0) := "000100000000000000";
 
begin
 
process(CLK, RESET)
begin
if (RESET='1') then
dout <= (others => '0');
din_buf <= (others => '0');
dtemp <= (others => '0');
dtemp1 <= 0;
elsif rising_edge(CLK) then
din_buf <= din(11)&din(11)&din(11)&din(11)&din(11)&din(11)&din;
dtemp <= dtemp + unsigned(din_buf) + offset;
dtemp1 <= to_integer(dtemp(17 downto 8));
if (dtemp1 >= 0) and (dtemp1 < 257) then
dout <= cosrom(dtemp1);
elsif (dtemp1 >= 257) and (dtemp1 < 513) then
dout <= -cosrom(512-dtemp1);
elsif (dtemp1 >= 513) and (dtemp1 < 769) then
dout <= -cosrom(dtemp1-512);
else
dout <= cosrom(1024-dtemp1);
end if;
end if;
end process;
END behavior;
/tags/ver-1/fir.vhd
0,0 → 1,64
LIBRARY ieee;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
 
 
entity FIR is
port(
clock : in std_logic;
reset : in std_logic;
data_in : in signed(11 downto 0);
data_out : out std_logic_vector(11 downto 0)
);
end FIR;
 
architecture behavior of FIR is
 
signal d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15 : signed(15 downto 0);
signal sum : signed(15 downto 0);
 
begin
 
process(clock,reset)
begin
if (reset = '1') then
d0 <= (others => '0');
d1 <= (others => '0');
d2 <= (others => '0');
d3 <= (others => '0');
d4 <= (others => '0');
d5 <= (others => '0');
d6 <= (others => '0');
d7 <= (others => '0');
d8 <= (others => '0');
d9 <= (others => '0');
d10 <= (others => '0');
d11 <= (others => '0');
d12 <= (others => '0');
d13 <= (others => '0');
d14 <= (others => '0');
d15 <= (others => '0');
sum <= (others => '0');
data_out <= (others => '0');
ELSIF rising_edge(clock) THEN
d0 <= data_in(11)&data_in(11)&data_in(11)&data_in(11)&data_in;
d1 <= d0;
d2 <= d1;
d3 <= d2;
d4 <= d3;
d5 <= d4;
d6 <= d5;
d7 <= d6;
d8 <= d7;
d9 <= d8;
d10 <= d9;
d11 <= d10;
d12 <= d11;
d13 <= d12;
d14 <= d13;
d15 <= d14;
sum <= (d0+d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15) srl 4;
data_out <= std_logic_vector(sum(11 downto 0));
end if;
end process;
end behavior;
/tags/ver-1/fm.txt
0,0 → 1,1000
01111111
01110110
01011010
00110000
11111110
11001101
10100011
10001000
10000000
10001100
10101001
11010100
00000110
00110111
01011111
01111001
01111111
01110011
01010100
00101000
11110110
11000101
10011110
10000110
10000001
10001111
10101111
11011100
00001110
00111110
01100101
01111011
01111111
01101111
01001110
00100000
11101110
10111110
10011001
10000100
10000010
10010011
10110110
11100100
00010110
01000101
01101001
01111101
01111110
01101011
01000111
00011000
11100110
10111000
10010100
10000010
10000011
10011000
10111100
11101011
00011110
01001100
01101110
01111111
01111100
01100110
01000000
00010001
11011110
10110001
10010000
10000001
10000101
10011100
11000011
11110011
00100110
01010010
01110010
01111111
01111010
01100001
00111001
00001001
11010111
10101011
10001101
10000000
10001000
10100010
11001010
11111011
00101101
01011000
01110101
01111111
01110111
01011100
00110010
00000001
11001111
10100101
10001001
10000000
10001011
10100111
11010010
00000100
00110101
01011110
01111000
01111111
01110100
01010110
00101010
11111000
11001000
10100000
10000111
10000000
10001110
10101101
11011001
00001100
00111100
01100011
01111011
01111111
01110000
01010000
00100011
11110000
11000001
10011011
10000100
10000001
10010010
10110100
11100001
00010100
01000011
01101000
01111101
01111110
01101100
01001001
00011011
11101001
10111010
10010110
10000010
10000011
10010110
10111010
11101001
00011011
01001010
01101100
01111110
01111101
01101000
01000010
00010011
11100001
10110011
10010010
10000001
10000100
10011011
11000001
11110001
00100011
01010000
01110000
01111111
01111010
01100011
00111011
00001011
11011001
10101101
10001110
10000000
10000111
10100000
11001000
11111001
00101011
01010110
01110100
01111111
01111000
01011101
00110100
00000011
11010001
10100111
10001010
10000000
10001010
10100101
11001111
11111111
00110000
01011001
01110101
01111111
01111000
01011101
00110101
00000101
11010100
10101010
10001100
10000000
10000111
10100000
11000111
11110111
00101000
01010011
01110010
01111111
01111010
01100011
00111100
00001101
11011100
10110000
10010000
10000001
10000101
10011011
11000000
11101111
00100000
01001101
01101110
01111111
01111100
01101000
01000011
00010101
11100100
10110110
10010100
10000010
10000011
10010110
10111001
11100111
00011000
01000110
01101010
01111101
01111110
01101100
01001010
00011101
11101011
10111101
10011001
10000100
10000001
10010010
10110011
11011111
00010001
00111111
01100101
01111011
01111111
01110000
01010000
00100101
11110011
11000100
10011110
10000110
10000000
10001110
10101100
11010111
00001001
00111000
01100000
01111001
01111111
01110100
01010111
00101100
11111011
11001011
10100011
10001001
10000000
10001011
10100111
11010000
00000001
00110001
01011010
01110110
01111111
01110111
01011100
00110100
00000100
11010011
10101001
10001100
10000000
10001000
10100001
11001001
11111000
00101001
01010100
01110011
01111111
01111010
01100010
00111011
00001100
11011010
10101111
10001111
10000001
10000101
10011100
11000001
11110000
00100010
01001110
01101111
01111111
01111100
01100111
01000010
00010100
11100010
10110101
10010011
10000010
10000011
10010111
10111011
11101001
00011010
01001000
01101010
01111101
01111110
01101011
01001001
00011011
11101010
10111100
10011000
10000011
10000010
10010011
10110100
11100001
00010010
01000001
01100110
01111100
01111111
01101111
01001111
00100011
11110010
11000011
10011101
10000110
10000001
10001111
10101110
11011001
00001010
00111010
01100001
01111001
01111111
01110011
01010101
00101011
11111010
11001010
10100010
10001000
10000000
10001011
10101000
11010001
00000010
00110010
01011011
01110110
01111111
01110110
01011010
00110000
11111110
11001101
10100011
10001000
10000000
10001100
10101001
11010100
00000110
00110111
01011111
01111001
01111111
01110011
01010100
00101000
11110110
11000101
10011110
10000110
10000001
10001111
10101111
11011100
00001110
00111110
01100101
01111011
01111111
01101111
01001110
00100000
11101110
10111110
10011001
10000100
10000010
10010011
10110110
11100100
00010110
01000101
01101001
01111101
01111110
01101011
01000111
00011000
11100110
10111000
10010100
10000010
10000011
10011000
10111100
11101011
00011110
01001100
01101110
01111111
01111100
01100110
01000000
00010001
11011110
10110001
10010000
10000001
10000101
10011100
11000011
11110011
00100110
01010010
01110010
01111111
01111010
01100001
00111001
00001001
11010111
10101011
10001101
10000000
10001000
10100010
11001010
11111011
00101101
01011000
01110101
01111111
01110111
01011100
00110010
00000001
11001111
10100101
10001001
10000000
10001011
10100111
11010010
00000100
00110101
01011110
01111000
01111111
01110100
01010110
00101010
11111000
11001000
10100000
10000111
10000000
10001110
10101101
11011001
00001100
00111100
01100011
01111011
01111111
01110000
01010000
00100011
11110000
11000001
10011011
10000100
10000001
10010010
10110100
11100001
00010100
01000011
01101000
01111101
01111110
01101100
01001001
00011011
11101001
10111010
10010110
10000010
10000011
10010110
10111010
11101001
00011011
01001010
01101100
01111110
01111101
01101000
01000010
00010011
11100001
10110011
10010010
10000001
10000100
10011011
11000001
11110001
00100011
01010000
01110000
01111111
01111010
01100011
00111011
00001011
11011001
10101101
10001110
10000000
10000111
10100000
11001000
11111001
00101011
01010110
01110100
01111111
01111000
01011101
00110100
00000011
11010001
10100111
10001010
10000000
10001010
10100101
11001111
11111111
00110000
01011001
01110101
01111111
01111000
01011101
00110101
00000101
11010100
10101010
10001100
10000000
10000111
10100000
11000111
11110111
00101000
01010011
01110010
01111111
01111010
01100011
00111100
00001101
11011100
10110000
10010000
10000001
10000101
10011011
11000000
11101111
00100000
01001101
01101110
01111111
01111100
01101000
01000011
00010101
11100100
10110110
10010100
10000010
10000011
10010110
10111001
11100111
00011000
01000110
01101010
01111101
01111110
01101100
01001010
00011101
11101011
10111101
10011001
10000100
10000001
10010010
10110011
11011111
00010001
00111111
01100101
01111011
01111111
01110000
01010000
00100101
11110011
11000100
10011110
10000110
10000000
10001110
10101100
11010111
00001001
00111000
01100000
01111001
01111111
01110100
01010111
00101100
11111011
11001011
10100011
10001001
10000000
10001011
10100111
11010000
00000001
00110001
01011010
01110110
01111111
01110111
01011100
00110100
00000100
11010011
10101001
10001100
10000000
10001000
10100001
11001001
11111000
00101001
01010100
01110011
01111111
01111010
01100010
00111011
00001100
11011010
10101111
10001111
10000001
10000101
10011100
11000001
11110000
00100010
01001110
01101111
01111111
01111100
01100111
01000010
00010100
11100010
10110101
10010011
10000010
10000011
10010111
10111011
11101001
00011010
01001000
01101010
01111101
01111110
01101011
01001001
00011011
11101010
10111100
10011000
10000011
10000010
10010011
10110100
11100001
00010010
01000001
01100110
01111100
01111111
01101111
01001111
00100011
11110010
11000011
10011101
10000110
10000001
10001111
10101110
11011001
00001010
00111010
01100001
01111001
01111111
01110011
01010101
00101011
11111010
11001010
10100010
10001000
10000000
10001011
10101000
11010001
00000010
00110010
01011011
01110110
01111111
01110110
01011010
00110000
11111110
11001101
10100011
10001000
10000000
10001100
10101001
11010100
00000110
00110111
01011111
01111001
01111111
01110011
01010100
00101000
11110110
11000101
10011110
10000110
10000001
10001111
10101111
11011100
00001110
00111110
01100101
01111011
01111111
01101111
01001110
00100000
11101110
10111110
10011001
10000100
10000010
10010011
10110110
11100100
00010110
01000101
01101001
01111101
01111110
01101011
01000111
00011000
11100110
10111000
10010100
10000010
10000011
10011000
10111100
11101011
00011110
01001100
01101110
01111111
01111100
01100110
01000000
00010001
11011110
10110001
10010000
10000001
10000101
10011100
11000011
11110011
00100110
01010010
01110010
01111111
01111010
01100001
00111001
00001001
11010111
10101011
10001101
10000000
10001000
10100010
11001010
11111011
00101101
01011000
01110101
01111111
01110111
01011100
00110010
00000001
11001111
10100101
10001001
10000000
10001011
10100111
11010010
00000100
00110101
01011110
01111000
01111111
01110100
01010110
00101010
11111000
11001000
10100000
10000111
10000000
10001110
10101101
11011001
00001100
00111100
01100011
01111011
01111111
01110000
01010000
00100011
11110000
11000001
10011011
10000100
10000001
10010010
10110100
11100001
00010100
01000011
01101000
01111101
01111110
01101100
01001001
00011011
11101001
10111010
10010110
10000010
10000011
10010110
10111010
11101001
00011011
01001010
01101100
01111110
01111101
01101000
01000010
00010011
11100001
10110011
10010010
10000001
10000100
10011011
11000001
11110001
00100011
01010000
01110000
01111111
01111010
01100011
00111011
00001011
11011001
10101101
10001110
10000000
10000111
10100000
11001000
11111001
00101011
01010110
01110100
01111111
01111000
01011101
00110100
00000011
11010001
10100111
10001010
10000000
10001010
/tags/ver-1/circuit.vhd
0,0 → 1,101
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
 
 
 
ENTITY circuit IS
-- Declarations
PORT(
clk : IN std_logic;
reset : IN std_logic;
fmin : IN std_logic_vector(7 downto 0);
dmout : OUT std_logic_vector (11 DOWNTO 0)
);
END circuit ;
 
 
ARCHITECTURE behavior OF circuit IS
 
-- Architecture declarations
 
-- Internal signal declarations
SIGNAL d1 : signed(11 DOWNTO 0);
SIGNAL d2 : signed(11 DOWNTO 0);
SIGNAL dout : signed(7 DOWNTO 0);
SIGNAL output : signed(7 DOWNTO 0);
-- Component Declarations
COMPONENT multiplier
PORT (
clk : IN std_logic ;
reset : IN std_logic ;
input1 : IN std_logic_vector (7 DOWNTO 0);
input2 : IN signed (7 DOWNTO 0);
output : OUT signed (7 DOWNTO 0)
);
END COMPONENT;
COMPONENT fir
PORT (
clock : IN std_logic ;
reset : IN std_logic ;
data_in : IN signed (11 DOWNTO 0);
data_out : OUT std_logic_vector (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT loop_filter
PORT (
clk : IN std_logic ;
reset : IN std_logic ;
c : IN signed (7 DOWNTO 0);
d1 : OUT signed (11 DOWNTO 0);
d2 : OUT signed (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT nco
PORT (
clk : IN std_logic ;
reset : IN std_logic ;
din : IN signed (11 DOWNTO 0);
dout : OUT signed (7 DOWNTO 0)
);
END COMPONENT;
BEGIN
-- Instance port mappings.
I1 : multiplier
PORT MAP (
clk => clk,
reset => reset,
input1 => fmin,
input2 => dout,
output => output
);
I4 : fir
PORT MAP (
clock => clk,
reset => reset,
data_in => d1,
data_out => dmout
);
I3 : loop_filter
PORT MAP (
clk => clk,
reset => reset,
c => output,
d1 => d1,
d2 => d2
);
I2 : nco
PORT MAP (
clk => clk,
reset => reset,
din => d2,
dout => dout
);
END behavior;
/tags/ver-1/cos.txt
0,0 → 1,1024
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111110
01111110
01111110
01111110
01111110
01111110
01111110
01111110
01111101
01111101
01111101
01111101
01111101
01111101
01111100
01111100
01111100
01111100
01111100
01111011
01111011
01111011
01111011
01111010
01111010
01111010
01111010
01111010
01111001
01111001
01111001
01111001
01111000
01111000
01111000
01110111
01110111
01110111
01110111
01110110
01110110
01110110
01110101
01110101
01110101
01110100
01110100
01110100
01110011
01110011
01110011
01110010
01110010
01110010
01110001
01110001
01110001
01110000
01110000
01101111
01101111
01101111
01101110
01101110
01101101
01101101
01101101
01101100
01101100
01101011
01101011
01101010
01101010
01101010
01101001
01101001
01101000
01101000
01100111
01100111
01100110
01100110
01100101
01100101
01100100
01100100
01100011
01100011
01100010
01100010
01100001
01100001
01100000
01100000
01011111
01011111
01011110
01011110
01011101
01011101
01011100
01011100
01011011
01011011
01011010
01011001
01011001
01011000
01011000
01010111
01010111
01010110
01010101
01010101
01010100
01010100
01010011
01010010
01010010
01010001
01010001
01010000
01001111
01001111
01001110
01001110
01001101
01001100
01001100
01001011
01001010
01001010
01001001
01001000
01001000
01000111
01000111
01000110
01000101
01000101
01000100
01000011
01000011
01000010
01000001
01000001
01000000
00111111
00111110
00111110
00111101
00111100
00111100
00111011
00111010
00111010
00111001
00111000
00111000
00110111
00110110
00110101
00110101
00110100
00110011
00110011
00110010
00110001
00110000
00110000
00101111
00101110
00101101
00101101
00101100
00101011
00101010
00101010
00101001
00101000
00100111
00100111
00100110
00100101
00100100
00100100
00100011
00100010
00100001
00100001
00100000
00011111
00011110
00011110
00011101
00011100
00011011
00011011
00011010
00011001
00011000
00011000
00010111
00010110
00010101
00010100
00010100
00010011
00010010
00010001
00010001
00010000
00001111
00001110
00001101
00001101
00001100
00001011
00001010
00001010
00001001
00001000
00000111
00000110
00000110
00000101
00000100
00000011
00000010
00000010
00000001
00000000
11111111
11111111
11111110
11111101
11111100
11111011
11111011
11111010
11111001
11111000
11110111
11110111
11110110
11110101
11110100
11110100
11110011
11110010
11110001
11110000
11110000
11101111
11101110
11101101
11101101
11101100
11101011
11101010
11101001
11101001
11101000
11100111
11100110
11100110
11100101
11100100
11100011
11100011
11100010
11100001
11100000
11011111
11011111
11011110
11011101
11011100
11011100
11011011
11011010
11011001
11011001
11011000
11010111
11010110
11010110
11010101
11010100
11010100
11010011
11010010
11010001
11010001
11010000
11001111
11001110
11001110
11001101
11001100
11001100
11001011
11001010
11001001
11001001
11001000
11000111
11000111
11000110
11000101
11000100
11000100
11000011
11000010
11000010
11000001
11000000
11000000
10111111
10111110
10111110
10111101
10111100
10111100
10111011
10111010
10111010
10111001
10111000
10111000
10110111
10110110
10110110
10110101
10110100
10110100
10110011
10110011
10110010
10110001
10110001
10110000
10110000
10101111
10101110
10101110
10101101
10101101
10101100
10101011
10101011
10101010
10101010
10101001
10101000
10101000
10100111
10100111
10100110
10100110
10100101
10100100
10100100
10100011
10100011
10100010
10100010
10100001
10100001
10100000
10100000
10011111
10011111
10011110
10011110
10011101
10011101
10011100
10011100
10011011
10011011
10011010
10011010
10011001
10011001
10011000
10011000
10010111
10010111
10010111
10010110
10010110
10010101
10010101
10010100
10010100
10010100
10010011
10010011
10010010
10010010
10010001
10010001
10010001
10010000
10010000
10010000
10001111
10001111
10001110
10001110
10001110
10001101
10001101
10001101
10001100
10001100
10001100
10001011
10001011
10001011
10001010
10001010
10001010
10001010
10001001
10001001
10001001
10001000
10001000
10001000
10001000
10000111
10000111
10000111
10000111
10000110
10000110
10000110
10000110
10000101
10000101
10000101
10000101
10000100
10000100
10000100
10000100
10000100
10000100
10000011
10000011
10000011
10000011
10000011
10000010
10000010
10000010
10000010
10000010
10000010
10000010
10000010
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000001
10000010
10000010
10000010
10000010
10000010
10000010
10000010
10000011
10000011
10000011
10000011
10000011
10000011
10000100
10000100
10000100
10000100
10000100
10000101
10000101
10000101
10000101
10000101
10000110
10000110
10000110
10000110
10000111
10000111
10000111
10000111
10001000
10001000
10001000
10001000
10001001
10001001
10001001
10001010
10001010
10001010
10001011
10001011
10001011
10001100
10001100
10001100
10001101
10001101
10001101
10001110
10001110
10001110
10001111
10001111
10001111
10010000
10010000
10010001
10010001
10010001
10010010
10010010
10010010
10010011
10010011
10010100
10010100
10010101
10010101
10010101
10010110
10010110
10010111
10010111
10011000
10011000
10011001
10011001
10011010
10011010
10011010
10011011
10011011
10011100
10011100
10011101
10011101
10011110
10011110
10011111
10011111
10100000
10100000
10100001
10100010
10100010
10100011
10100011
10100100
10100100
10100101
10100101
10100110
10100110
10100111
10101000
10101000
10101001
10101001
10101010
10101010
10101011
10101100
10101100
10101101
10101101
10101110
10101111
10101111
10110000
10110000
10110001
10110010
10110010
10110011
10110100
10110100
10110101
10110101
10110110
10110111
10110111
10111000
10111001
10111001
10111010
10111011
10111011
10111100
10111101
10111101
10111110
10111111
10111111
11000000
11000001
11000001
11000010
11000011
11000011
11000100
11000101
11000110
11000110
11000111
11001000
11001000
11001001
11001010
11001010
11001011
11001100
11001101
11001101
11001110
11001111
11001111
11010000
11010001
11010010
11010010
11010011
11010100
11010101
11010101
11010110
11010111
11011000
11011000
11011001
11011010
11011011
11011011
11011100
11011101
11011110
11011110
11011111
11100000
11100001
11100001
11100010
11100011
11100100
11100100
11100101
11100110
11100111
11101000
11101000
11101001
11101010
11101011
11101011
11101100
11101101
11101110
11101110
11101111
11110000
11110001
11110010
11110010
11110011
11110100
11110101
11110110
11110110
11110111
11111000
11111001
11111001
11111010
11111011
11111100
11111101
11111101
11111110
11111111
00000000
00000000
00000001
00000010
00000011
00000100
00000100
00000101
00000110
00000111
00001000
00001000
00001001
00001010
00001011
00001011
00001100
00001101
00001110
00001111
00001111
00010000
00010001
00010010
00010010
00010011
00010100
00010101
00010110
00010110
00010111
00011000
00011001
00011001
00011010
00011011
00011100
00011100
00011101
00011110
00011111
00100000
00100000
00100001
00100010
00100011
00100011
00100100
00100101
00100110
00100110
00100111
00101000
00101001
00101001
00101010
00101011
00101100
00101100
00101101
00101110
00101110
00101111
00110000
00110001
00110001
00110010
00110011
00110100
00110100
00110101
00110110
00110110
00110111
00111000
00111001
00111001
00111010
00111011
00111011
00111100
00111101
00111101
00111110
00111111
00111111
01000000
01000001
01000010
01000010
01000011
01000100
01000100
01000101
01000110
01000110
01000111
01000111
01001000
01001001
01001001
01001010
01001011
01001011
01001100
01001101
01001101
01001110
01001110
01001111
01010000
01010000
01010001
01010010
01010010
01010011
01010011
01010100
01010101
01010101
01010110
01010110
01010111
01010111
01011000
01011001
01011001
01011010
01011010
01011011
01011011
01011100
01011100
01011101
01011110
01011110
01011111
01011111
01100000
01100000
01100001
01100001
01100010
01100010
01100011
01100011
01100100
01100100
01100101
01100101
01100110
01100110
01100111
01100111
01101000
01101000
01101000
01101001
01101001
01101010
01101010
01101011
01101011
01101100
01101100
01101100
01101101
01101101
01101110
01101110
01101110
01101111
01101111
01110000
01110000
01110000
01110001
01110001
01110001
01110010
01110010
01110011
01110011
01110011
01110100
01110100
01110100
01110101
01110101
01110101
01110101
01110110
01110110
01110110
01110111
01110111
01110111
01111000
01111000
01111000
01111000
01111001
01111001
01111001
01111001
01111010
01111010
01111010
01111010
01111011
01111011
01111011
01111011
01111011
01111100
01111100
01111100
01111100
01111100
01111101
01111101
01111101
01111101
01111101
01111101
01111110
01111110
01111110
01111110
01111110
01111110
01111110
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
01111111
/tags/ver-1/multiplier.vhd
0,0 → 1,142
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
 
 
ENTITY multiplier IS
-- Declarations
port (CLK : in std_logic;
RESET : in std_logic;
input1 : in std_logic_vector(7 downto 0);
input2 : in signed(7 downto 0);
output : out signed(7 downto 0)
);
END multiplier ;
 
 
ARCHITECTURE behavior OF multiplier IS
 
signal out_temp : signed(15 downto 0);
signal input1_buf : signed(15 downto 0);
signal part0, part1, part2, part3, part4, part5, part6, part7 : signed(15 downto 0);
 
begin
 
process(CLK, RESET)
begin
if (RESET='1') then
out_temp <= (others => '0');
output <= (others => '0');
input1_buf <= (others => '0');
part0 <= (others => '0');
part1 <= (others => '0');
part2 <= (others => '0');
part3 <= (others => '0');
part4 <= (others => '0');
part5 <= (others => '0');
part6 <= (others => '0');
part7 <= (others => '0');
elsif rising_edge(CLK) then
input1_buf <= input1(7)&input1(7)&input1(7)&input1(7)&input1(7)&input1(7)&input1(7)&input1(7)&signed(input1);
if (input2(0)='1') then
part0 <= -(input1_buf);
else
part0 <= (others => '0');
end if;
if (input2(1)='1') then
if (input2(0)='1') then
part1 <= (others => '0');
else
part1 <= -(input1_buf);
end if;
else
if (input2(0)='1') then
part1 <= input1_buf;
else
part1 <= (others => '0');
end if;
end if;
if (input2(2)='1') then
if (input2(1)='1') then
part2 <= (others => '0');
else
part2 <= -(input1_buf);
end if;
else
if (input2(1)='1') then
part2 <= input1_buf;
else
part2 <= (others => '0');
end if;
end if;
if (input2(3)='1') then
if (input2(2)='1') then
part3 <= (others => '0');
else
part3 <= -(input1_buf);
end if;
else
if (input2(2)='1') then
part3 <= input1_buf;
else
part3 <= (others => '0');
end if;
end if;
if (input2(4)='1') then
if (input2(3)='1') then
part4 <= (others => '0');
else
part4 <= -(input1_buf);
end if;
else
if (input2(3)='1') then
part4 <= input1_buf;
else
part4 <= (others => '0');
end if;
end if;
if (input2(5)='1') then
if (input2(4)='1') then
part5 <= (others => '0');
else
part5 <= -(input1_buf);
end if;
else
if (input2(4)='1') then
part5 <= input1_buf;
else
part5 <= (others => '0');
end if;
end if;
if (input2(6)='1') then
if (input2(5)='1') then
part6 <= (others => '0');
else
part6 <= -(input1_buf);
end if;
else
if (input2(5)='1') then
part6 <= input1_buf;
else
part6 <= (others => '0');
end if;
end if;
if (input2(7)='1') then
if (input2(6)='1') then
part7 <= (others => '0');
else
part7 <= -(input1_buf);
end if;
else
if (input2(6)='1') then
part7 <= input1_buf;
else
part7 <= (others => '0');
end if;
end if;
out_temp <= part0+(part1(14 downto 0)&'0')+(part2(13 downto 0)&"00")+(part3(12 downto 0)&"000")+(part4(11 downto 0)&"0000")+(part5(10 downto 0)&"00000")+(part6(9 downto 0)&"000000")+(part7(8 downto 0)&"0000000");
output <= out_temp(15 downto 8);
end if;
end process;
END behavior;
 
/tags/ver-1/circuit_tb.vhd
0,0 → 1,64
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE IEEE.numeric_std.ALL;
USE std.textio.ALL;
 
ENTITY circuit_tb IS
END circuit_tb;
 
ARCHITECTURE behavior OF circuit_tb IS
 
file vectors: text open read_mode is "fm.txt";
 
 
COMPONENT circuit
PORT(
clk : IN std_logic;
reset : IN std_logic;
fmin : IN std_logic_vector(7 downto 0);
dmout : OUT std_logic_vector(11 downto 0)
);
END COMPONENT;
 
SIGNAL clk : std_logic := '0' ;
SIGNAL reset : std_logic := '1';
SIGNAL fmin : std_logic_vector(7 downto 0);
SIGNAL dmout : std_logic_vector(11 downto 0);
constant clkperiod : time := 62.5 ns; -- 16 MHz of frequency
 
BEGIN
 
uut: circuit PORT MAP(
clk => clk,
reset => reset,
fmin => fmin,
dmout => dmout
);
 
RESET_GEN: process
begin
LOOP1: for N in 0 to 3 loop
wait until falling_edge(CLK);
end loop LOOP1;
RESET <= '0' ;
end process RESET_GEN;
 
clk <= not clk after clkperiod / 2;
 
process
variable vectorline : line;
variable fmin_var : bit_vector(7 downto 0);
begin
while not endfile(vectors) loop
if (reset = '1') then
fmin <= (others => '0');
else
readline(vectors, vectorline);
read(vectorline, fmin_var);
fmin <= to_stdlogicvector(fmin_var);
end if;
wait for clkperiod;
end loop;
end process;
 
END;
/tags/ver-1/loop_filter.vhd
0,0 → 1,38
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
 
 
 
ENTITY loop_filter IS
-- Declarations
port ( CLK : in std_logic;
RESET : in std_logic;
C : in signed(7 downto 0);
D1 : out signed(11 downto 0);
D2 : out signed(11 downto 0)
);
END loop_filter ;
 
 
ARCHITECTURE behavior OF loop_filter IS
 
signal E : signed(11 downto 0);
signal dtemp : signed(11 downto 0);
 
begin
process(CLK, RESET)
begin
if (RESET='1') then
D1 <= (others => '0');
D2 <= (others => '0');
E <= (others => '0');
dtemp <= (others => '0');
elsif rising_edge(CLK) then
dtemp <= (C(7)&C(7)&C(7)&C&'0') + dtemp - E;
E <= dtemp(11)&dtemp(11)&dtemp(11)&dtemp(11)&dtemp(11 downto 4);
D1 <= dtemp;
D2 <= dtemp(11 downto 4)&"0000";
end if;
end process;
END behavior;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.