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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [mult_8bit.vhdl] - Blame information for rev 46

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 46 arif_endro
-- ------------------------------------------------------------------------
2 39 arif_endro
-- Copyright (C) 2004 Arif Endro Nugroho
3 46 arif_endro
-- All rights reserved.
4 13 arif_endro
-- 
5 46 arif_endro
-- Redistribution and use in source and binary forms, with or without
6
-- modification, are permitted provided that the following conditions
7
-- are met:
8 13 arif_endro
-- 
9 46 arif_endro
-- 1. Redistributions of source code must retain the above copyright
10
--    notice, this list of conditions and the following disclaimer.
11
-- 2. Redistributions in binary form must reproduce the above copyright
12
--    notice, this list of conditions and the following disclaimer in the
13
--    documentation and/or other materials provided with the distribution.
14 13 arif_endro
-- 
15 46 arif_endro
-- THIS SOFTWARE IS PROVIDED BY ARIF ENDRO NUGROHO "AS IS" AND ANY EXPRESS
16
-- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
-- DISCLAIMED. IN NO EVENT SHALL ARIF ENDRO NUGROHO BE LIABLE FOR ANY
19
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21
-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23
-- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24
-- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
-- POSSIBILITY OF SUCH DAMAGE.
26 13 arif_endro
-- 
27 46 arif_endro
-- End Of License.
28
-- ------------------------------------------------------------------------
29 2 arif_endro
 
30
library IEEE;
31
use IEEE.STD_LOGIC_1164.ALL;
32
 
33
entity mult_8bit is
34
   port (
35
   mult_01     : in  bit_vector (07 downto 0);
36
   mult_02     : in  bit_vector (07 downto 0);
37
   result_mult : out bit_vector (15 downto 0)
38
   );
39
end mult_8bit;
40
 
41
architecture structural of mult_8bit is
42
   component adder_16bit
43
     port (
44
     addend_16bit   : in  bit_vector (15 downto 0);
45
     augend_16bit   : in  bit_vector (15 downto 0);
46
     adder16_output : out bit_vector (16 downto 0)
47
     );
48
   end component;
49
 
50
   component adder_16bit_u
51
     port (
52
     addend_16bit   : in  bit_vector (15 downto 0);
53
     augend_16bit   : in  bit_vector (15 downto 0);
54
     adder16_output : out bit_vector (15 downto 0)
55
     );
56
   end component;
57
 
58
   component adder_15bit
59
     port (
60
     addend_15bit   : in  bit_vector (14 downto 0);
61
     augend_15bit   : in  bit_vector (14 downto 0);
62
     adder15_output : out bit_vector (15 downto 0)
63
     );
64
   end component;
65
 
66
   component adder_14bit
67
     port (
68
     addend_14bit   : in  bit_vector (13 downto 0);
69
     augend_14bit   : in  bit_vector (13 downto 0);
70
     adder14_output : out bit_vector (14 downto 0)
71
     );
72
   end component;
73
 
74
   component adder_13bit
75
     port (
76
     addend_13bit   : in  bit_vector (12 downto 0);
77
     augend_13bit   : in  bit_vector (12 downto 0);
78
     adder13_output : out bit_vector (13 downto 0)
79
     );
80
   end component;
81
 
82
   component adder_12bit
83
     port (
84
     addend_12bit   : in  bit_vector (11 downto 0);
85
     augend_12bit   : in  bit_vector (11 downto 0);
86
     adder12_output : out bit_vector (12 downto 0)
87
     );
88
   end component;
89
 
90
   component adder_11bit
91
     port (
92
     addend_11bit   : in  bit_vector (10 downto 0);
93
     augend_11bit   : in  bit_vector (10 downto 0);
94
     adder11_output : out bit_vector (11 downto 0)
95
     );
96
   end component;
97
 
98
   component adder_10bit
99
     port (
100
     addend_10bit   : in  bit_vector (09 downto 0);
101
     augend_10bit   : in  bit_vector (09 downto 0);
102
     adder10_output : out bit_vector (10 downto 0)
103
     );
104
   end component;
105
 
106
   component adder_09bit
107
     port (
108
     addend_09bit   : in  bit_vector (08 downto 0);
109
     augend_09bit   : in  bit_vector (08 downto 0);
110
     adder09_output : out bit_vector (09 downto 0)
111
     );
112
   end component;
113
 
114
   signal input_phase    : bit_vector (07 downto 0);
115
   signal signal_nco     : bit_vector (07 downto 0);
116
 
117
   signal sum_part01     : bit_vector (08 downto 0);
118
   signal sum_part01_z   : bit_vector (08 downto 0);
119
   signal sum_part02     : bit_vector (09 downto 0);
120
   signal sum_part03     : bit_vector (10 downto 0);
121
   signal sum_part04     : bit_vector (11 downto 0);
122
   signal sum_part05     : bit_vector (12 downto 0);
123
   signal sum_part06     : bit_vector (13 downto 0);
124
   signal sum_part07     : bit_vector (14 downto 0);
125
   signal sum_part08_t   : bit_vector (15 downto 0);
126
   signal sum_part08_o   : bit_vector (15 downto 0);
127
   signal sum_part08_a   : bit_vector (15 downto 0);
128
   signal sum_part08     : bit_vector (15 downto 0);
129
 
130
   signal adder_stage_01 : bit_vector (09 downto 0);
131
   signal adder_stage_02 : bit_vector (10 downto 0);
132
   signal adder_stage_03 : bit_vector (11 downto 0);
133
   signal adder_stage_04 : bit_vector (12 downto 0);
134
   signal adder_stage_05 : bit_vector (13 downto 0);
135
   signal adder_stage_06 : bit_vector (14 downto 0);
136
   signal adder_stage_07 : bit_vector (15 downto 0);
137
   signal adder_stage_08 : bit_vector (16 downto 0);
138
 
139
   begin
140
 
141
   sum_part01_z (00) <= '0';
142
   sum_part01_z (01) <= '0';
143
   sum_part01_z (02) <= '0';
144
   sum_part01_z (03) <= '0';
145
   sum_part01_z (04) <= '0';
146
   sum_part01_z (05) <= '0';
147
   sum_part01_z (06) <= '0';
148
   sum_part01_z (07) <= '0';
149
   sum_part01_z (08) <= '0';
150
 
151
   sum_part01(00) <= signal_nco(0) and input_phase(0);
152
   sum_part01(01) <= signal_nco(0) and input_phase(1);
153
   sum_part01(02) <= signal_nco(0) and input_phase(2);
154
   sum_part01(03) <= signal_nco(0) and input_phase(3);
155
   sum_part01(04) <= signal_nco(0) and input_phase(4);
156
   sum_part01(05) <= signal_nco(0) and input_phase(5);
157
   sum_part01(06) <= signal_nco(0) and input_phase(6);
158
   sum_part01(07) <= signal_nco(0) and input_phase(7);
159
   sum_part01(08) <= signal_nco(0) and input_phase(7);
160
 
161
   sum_part02(00) <= '0';
162
   sum_part02(01) <= signal_nco(1) and input_phase(0);
163
   sum_part02(02) <= signal_nco(1) and input_phase(1);
164
   sum_part02(03) <= signal_nco(1) and input_phase(2);
165
   sum_part02(04) <= signal_nco(1) and input_phase(3);
166
   sum_part02(05) <= signal_nco(1) and input_phase(4);
167
   sum_part02(06) <= signal_nco(1) and input_phase(5);
168
   sum_part02(07) <= signal_nco(1) and input_phase(6);
169
   sum_part02(08) <= signal_nco(1) and input_phase(7);
170
   sum_part02(09) <= signal_nco(1) and input_phase(7);
171
 
172
   sum_part03(00) <= '0';
173
   sum_part03(01) <= '0';
174
   sum_part03(02) <= signal_nco(2) and input_phase(0);
175
   sum_part03(03) <= signal_nco(2) and input_phase(1);
176
   sum_part03(04) <= signal_nco(2) and input_phase(2);
177
   sum_part03(05) <= signal_nco(2) and input_phase(3);
178
   sum_part03(06) <= signal_nco(2) and input_phase(4);
179
   sum_part03(07) <= signal_nco(2) and input_phase(5);
180
   sum_part03(08) <= signal_nco(2) and input_phase(6);
181
   sum_part03(09) <= signal_nco(2) and input_phase(7);
182
   sum_part03(10) <= signal_nco(2) and input_phase(7);
183
 
184
   sum_part04(00) <= '0';
185
   sum_part04(01) <= '0';
186
   sum_part04(02) <= '0';
187
   sum_part04(03) <= signal_nco(3) and input_phase(0);
188
   sum_part04(04) <= signal_nco(3) and input_phase(1);
189
   sum_part04(05) <= signal_nco(3) and input_phase(2);
190
   sum_part04(06) <= signal_nco(3) and input_phase(3);
191
   sum_part04(07) <= signal_nco(3) and input_phase(4);
192
   sum_part04(08) <= signal_nco(3) and input_phase(5);
193
   sum_part04(09) <= signal_nco(3) and input_phase(6);
194
   sum_part04(10) <= signal_nco(3) and input_phase(7);
195
   sum_part04(11) <= signal_nco(3) and input_phase(7);
196
 
197
   sum_part05(00) <= '0';
198
   sum_part05(01) <= '0';
199
   sum_part05(02) <= '0';
200
   sum_part05(03) <= '0';
201
   sum_part05(04) <= signal_nco(4) and input_phase(0);
202
   sum_part05(05) <= signal_nco(4) and input_phase(1);
203
   sum_part05(06) <= signal_nco(4) and input_phase(2);
204
   sum_part05(07) <= signal_nco(4) and input_phase(3);
205
   sum_part05(08) <= signal_nco(4) and input_phase(4);
206
   sum_part05(09) <= signal_nco(4) and input_phase(5);
207
   sum_part05(10) <= signal_nco(4) and input_phase(6);
208
   sum_part05(11) <= signal_nco(4) and input_phase(7);
209
   sum_part05(12) <= signal_nco(4) and input_phase(7);
210
 
211
   sum_part06(00) <= '0';
212
   sum_part06(01) <= '0';
213
   sum_part06(02) <= '0';
214
   sum_part06(03) <= '0';
215
   sum_part06(04) <= '0';
216
   sum_part06(05) <= signal_nco(5) and input_phase(0);
217
   sum_part06(06) <= signal_nco(5) and input_phase(1);
218
   sum_part06(07) <= signal_nco(5) and input_phase(2);
219
   sum_part06(08) <= signal_nco(5) and input_phase(3);
220
   sum_part06(09) <= signal_nco(5) and input_phase(4);
221
   sum_part06(10) <= signal_nco(5) and input_phase(5);
222
   sum_part06(11) <= signal_nco(5) and input_phase(6);
223
   sum_part06(12) <= signal_nco(5) and input_phase(7);
224
   sum_part06(13) <= signal_nco(5) and input_phase(7);
225
 
226
   sum_part07(00) <= '0';
227
   sum_part07(01) <= '0';
228
   sum_part07(02) <= '0';
229
   sum_part07(03) <= '0';
230
   sum_part07(04) <= '0';
231
   sum_part07(05) <= '0';
232
   sum_part07(06) <= signal_nco(6) and input_phase(0);
233
   sum_part07(07) <= signal_nco(6) and input_phase(1);
234
   sum_part07(08) <= signal_nco(6) and input_phase(2);
235
   sum_part07(09) <= signal_nco(6) and input_phase(3);
236
   sum_part07(10) <= signal_nco(6) and input_phase(4);
237
   sum_part07(11) <= signal_nco(6) and input_phase(5);
238
   sum_part07(12) <= signal_nco(6) and input_phase(6);
239
   sum_part07(13) <= signal_nco(6) and input_phase(7);
240
   sum_part07(14) <= signal_nco(6) and input_phase(7);
241
 
242
   sum_part08(00) <= '0';
243
   sum_part08(01) <= '0';
244
   sum_part08(02) <= '0';
245
   sum_part08(03) <= '0';
246
   sum_part08(04) <= '0';
247
   sum_part08(05) <= '0';
248
   sum_part08(06) <= '0';
249
   sum_part08(07) <= signal_nco(7) and input_phase(0);
250
   sum_part08(08) <= signal_nco(7) and input_phase(1);
251
   sum_part08(09) <= signal_nco(7) and input_phase(2);
252
   sum_part08(10) <= signal_nco(7) and input_phase(3);
253
   sum_part08(11) <= signal_nco(7) and input_phase(4);
254
   sum_part08(12) <= signal_nco(7) and input_phase(5);
255
   sum_part08(13) <= signal_nco(7) and input_phase(6);
256
   sum_part08(14) <= signal_nco(7) and input_phase(7);
257
   sum_part08(15) <= signal_nco(7) and input_phase(7);
258
 
259
   sum_part08_t (00) <= (not (sum_part08 (00)));
260
   sum_part08_t (01) <= (not (sum_part08 (01)));
261
   sum_part08_t (02) <= (not (sum_part08 (02)));
262
   sum_part08_t (03) <= (not (sum_part08 (03)));
263
   sum_part08_t (04) <= (not (sum_part08 (04)));
264
   sum_part08_t (05) <= (not (sum_part08 (05)));
265
   sum_part08_t (06) <= (not (sum_part08 (06)));
266
   sum_part08_t (07) <= (not (sum_part08 (07)));
267
   sum_part08_t (08) <= (not (sum_part08 (08)));
268
   sum_part08_t (09) <= (not (sum_part08 (09)));
269
   sum_part08_t (10) <= (not (sum_part08 (10)));
270
   sum_part08_t (11) <= (not (sum_part08 (11)));
271
   sum_part08_t (12) <= (not (sum_part08 (12)));
272
   sum_part08_t (13) <= (not (sum_part08 (13)));
273
   sum_part08_t (14) <= (not (sum_part08 (14)));
274
   sum_part08_t (15) <= (not (sum_part08 (15)));
275
 
276
   sum_part08_o (00) <= '1';
277
   sum_part08_o (01) <= '0';
278
   sum_part08_o (02) <= '0';
279
   sum_part08_o (03) <= '0';
280
   sum_part08_o (04) <= '0';
281
   sum_part08_o (05) <= '0';
282
   sum_part08_o (06) <= '0';
283
   sum_part08_o (07) <= '0';
284
   sum_part08_o (08) <= '0';
285
   sum_part08_o (09) <= '0';
286
   sum_part08_o (10) <= '0';
287
   sum_part08_o (11) <= '0';
288
   sum_part08_o (12) <= '0';
289
   sum_part08_o (13) <= '0';
290
   sum_part08_o (14) <= '0';
291
   sum_part08_o (15) <= '0';
292
 
293
stage_01 : adder_09bit
294
   port map (
295
   addend_09bit   (08 downto 0)  => sum_part01_z,
296
   augend_09bit   (08 downto 0)  => sum_part01,
297
   adder09_output (09 downto 0)  => adder_stage_01
298
   );
299
 
300
stage_02 : adder_10bit
301
   port map (
302
   addend_10bit   (09 downto 0)  => adder_stage_01,
303
   augend_10bit   (09 downto 0)  => sum_part02,
304
   adder10_output (10 downto 0)  => adder_stage_02
305
   );
306
 
307
stage_03 : adder_11bit
308
   port map (
309
   addend_11bit   (10 downto 0)  => adder_stage_02,
310
   augend_11bit   (10 downto 0)  => sum_part03,
311
   adder11_output (11 downto 0)  => adder_stage_03
312
   );
313
 
314
stage_04 : adder_12bit
315
   port map (
316
   addend_12bit   (11 downto 0)  => adder_stage_03,
317
   augend_12bit   (11 downto 0)  => sum_part04,
318
   adder12_output (12 downto 0)  => adder_stage_04
319
   );
320
 
321
stage_05 : adder_13bit
322
   port map (
323
   addend_13bit   (12 downto 0)  => adder_stage_04,
324
   augend_13bit   (12 downto 0)  => sum_part05,
325
   adder13_output (13 downto 0)  => adder_stage_05
326
   );
327
 
328
stage_06 : adder_14bit
329
   port map (
330
   addend_14bit   (13 downto 0)  => adder_stage_05,
331
   augend_14bit   (13 downto 0)  => sum_part06,
332
   adder14_output (14 downto 0)  => adder_stage_06
333
   );
334
 
335
stage_07 : adder_15bit
336
   port map (
337
   addend_15bit   (14 downto 0)  => adder_stage_06,
338
   augend_15bit   (14 downto 0)  => sum_part07,
339
   adder15_output (15 downto 0)  => adder_stage_07
340
   );
341
 
342
stage_08_a : adder_16bit_u
343
   port map (
344
   addend_16bit   (15 downto 0)  => sum_part08_t,
345
   augend_16bit   (15 downto 0)  => sum_part08_o,
346
   adder16_output (15 downto 0)  => sum_part08_a
347
   );
348
 
349
stage_08 : adder_16bit
350
   port map (
351
   addend_16bit   (15 downto 0)  => adder_stage_07,
352
   augend_16bit   (15 downto 0)  => sum_part08_a,
353
   adder16_output (16 downto 0)  => adder_stage_08
354
   );
355
 
356
   input_phase <= mult_01;
357
   signal_nco  <= mult_02;
358
   result_mult <= adder_stage_08(15 downto 0);
359
 
360
end structural;

powered by: WebSVN 2.1.0

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