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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [adder_15bit.vhdl] - Blame information for rev 47

Go to most recent revision | 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 adder_15bit is
34
   port (
35
      addend_15bit  : in  bit_vector (14 downto 0);
36
      augend_15bit  : in  bit_vector (14 downto 0);
37
      adder15_output: out bit_vector (15 downto 0) -- 16 bit output
38
      );
39
end adder_15bit;
40
 
41
architecture structural of adder_15bit is
42
 
43
   component fulladder
44
      port (
45
      addend        : in   bit;
46
      augend        : in   bit;
47
      carry_in      : in   bit;
48
      sum           : out  bit;
49
      carry         : out  bit
50
      );
51
   end component;
52
 
53
-- internal signal
54
signal c00 : bit;
55
signal c01 : bit;
56
signal c02 : bit;
57
signal c03 : bit;
58
signal c04 : bit;
59
signal c05 : bit;
60
signal c06 : bit;
61
signal c07 : bit;
62
signal c08 : bit;
63
signal c09 : bit;
64
signal c10 : bit;
65
signal c11 : bit;
66
signal c12 : bit;
67
signal c13 : bit;
68
signal c14 : bit;
69
signal c15 : bit;
70
signal over15 : bit;
71 22 arif_endro
signal adder15_output_int : bit_vector (14 downto 0);
72
signal ov  : bit;
73 2 arif_endro
 
74
begin
75
 
76
c00                     <= '0';
77
over15                  <= (addend_15bit (14) xor augend_15bit (14));
78 22 arif_endro
ov                      <= ((adder15_output_int (14) and over15) or
79 2 arif_endro
                           (c15 and (not (over15))));
80 22 arif_endro
adder15_output(14 downto 00) <= adder15_output_int;
81
adder15_output(15)           <= ov;
82 2 arif_endro
 
83
fa14 : fulladder
84
   port map (
85
      addend     => addend_15bit(14),
86
      augend     => augend_15bit(14),
87
      carry_in   => c14,
88
      sum        => adder15_output_int(14),
89
      carry      => c15
90
      );
91
 
92
fa13 : fulladder
93
   port map (
94
      addend     => addend_15bit(13),
95
      augend     => augend_15bit(13),
96
      carry_in   => c13,
97
      sum        => adder15_output_int(13),
98
      carry      => c14
99
      );
100
 
101
fa12 : fulladder
102
   port map (
103
      addend     => addend_15bit(12),
104
      augend     => augend_15bit(12),
105
      carry_in   => c12,
106
      sum        => adder15_output_int(12),
107
      carry      => c13
108
      );
109
 
110
fa11 : fulladder
111
   port map (
112
      addend     => addend_15bit(11),
113
      augend     => augend_15bit(11),
114
      carry_in   => c11,
115
      sum        => adder15_output_int(11),
116
      carry      => c12
117
      );
118
 
119
fa10 : fulladder
120
   port map (
121
      addend     => addend_15bit(10),
122
      augend     => augend_15bit(10),
123
      carry_in   => c10,
124
      sum        => adder15_output_int(10),
125
      carry      => c11
126
      );
127
 
128
fa09 : fulladder
129
   port map (
130
      addend     => addend_15bit(09),
131
      augend     => augend_15bit(09),
132
      carry_in   => c09,
133
      sum        => adder15_output_int(09),
134
      carry      => c10
135
      );
136
 
137
fa08 : fulladder
138
   port map (
139
      addend     => addend_15bit(08),
140
      augend     => augend_15bit(08),
141
      carry_in   => c08,
142
      sum        => adder15_output_int(08),
143
      carry      => c09
144
      );
145
 
146
fa07 : fulladder
147
   port map (
148
      addend     => addend_15bit(07),
149
      augend     => augend_15bit(07),
150
      carry_in   => c07,
151
      sum        => adder15_output_int(07),
152
      carry      => c08
153
      );
154
 
155
fa06 : fulladder
156
   port map (
157
      addend     => addend_15bit(06),
158
      augend     => augend_15bit(06),
159
      carry_in   => c06,
160
      sum        => adder15_output_int(06),
161
      carry      => c07
162
      );
163
 
164
fa05 : fulladder
165
   port map (
166
      addend     => addend_15bit(05),
167
      augend     => augend_15bit(05),
168
      carry_in   => c05,
169
      sum        => adder15_output_int(05),
170
      carry      => c06
171
      );
172
 
173
fa04 : fulladder
174
   port map (
175
      addend     => addend_15bit(04),
176
      augend     => augend_15bit(04),
177
      carry_in   => c04,
178
      sum        => adder15_output_int(04),
179
      carry      => c05
180
      );
181
 
182
fa03 : fulladder
183
   port map (
184
      addend     => addend_15bit(03),
185
      augend     => augend_15bit(03),
186
      carry_in   => c03,
187
      sum        => adder15_output_int(03),
188
      carry      => c04
189
      );
190
 
191
fa02 : fulladder
192
   port map (
193
      addend     => addend_15bit(02),
194
      augend     => augend_15bit(02),
195
      carry_in   => c02,
196
      sum        => adder15_output_int(02),
197
      carry      => c03
198
      );
199
 
200
fa01 : fulladder
201
   port map (
202
      addend     => addend_15bit(01),
203
      augend     => augend_15bit(01),
204
      carry_in   => c01,
205
      sum        => adder15_output_int(01),
206
      carry      => c02
207
      );
208
 
209
fa00 : fulladder
210
   port map (
211
      addend     => addend_15bit(00),
212
      augend     => augend_15bit(00),
213
      carry_in   => c00,
214
      sum        => adder15_output_int(00),
215
      carry      => c01
216
      );
217
 
218
end structural;

powered by: WebSVN 2.1.0

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