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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [adder_12bit.vhdl] - Blame information for rev 41

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 arif_endro
-- $Id: adder_12bit.vhdl,v 1.4 2008-06-26 06:12:29 arif_endro Exp $
2 2 arif_endro
-------------------------------------------------------------------------------
3
-- Title       : Adder 12 bit
4
-- Project     : FM Receiver 
5
-------------------------------------------------------------------------------
6
-- File        : adder_12bit.vhdl
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2004/12/01
9
-- Last update : 
10 13 arif_endro
-- Simulators  : 
11 2 arif_endro
-- Synthesizers: 
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : Ripple carry adder 12 bit with output 13 bit
15
-------------------------------------------------------------------------------
16 39 arif_endro
-- Copyright (C) 2004 Arif Endro Nugroho
17 2 arif_endro
-------------------------------------------------------------------------------
18 13 arif_endro
-- 
19
--      THIS SOURCE FILE MAY BE USED AND DISTRIBUTED WITHOUT RESTRICTION
20
-- PROVIDED THAT THIS COPYRIGHT STATEMENT IS NOT REMOVED FROM THE FILE AND THAT
21
-- ANY DERIVATIVE WORK CONTAINS THE ORIGINAL COPYRIGHT NOTICE AND THE
22
-- ASSOCIATED DISCLAIMER.
23
-- 
24
-------------------------------------------------------------------------------
25
-- 
26
--      THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27
-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
29
-- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34
-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35
-- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
-- 
37
-------------------------------------------------------------------------------
38 2 arif_endro
 
39
library IEEE;
40
use IEEE.STD_LOGIC_1164.ALL;
41
 
42
entity adder_12bit is
43
   port (
44
      addend_12bit  : in  bit_vector (11 downto 0);
45
      augend_12bit  : in  bit_vector (11 downto 0);
46
      adder12_output: out bit_vector (12 downto 0)  -- 13bit output
47
      );
48
end adder_12bit;
49
 
50
architecture structural of adder_12bit is
51
 
52
   component fulladder
53
      port (
54
      addend        : in   bit;
55
      augend        : in   bit;
56
      carry_in      : in   bit;
57
      sum           : out  bit;
58
      carry         : out  bit
59
      );
60
   end component;
61
 
62
-- internal signal
63
signal over12 : bit;
64 22 arif_endro
signal adder12_output_int : bit_vector (11 downto 0);
65 2 arif_endro
signal c00 : bit;
66
signal c01 : bit;
67
signal c02 : bit;
68
signal c03 : bit;
69
signal c04 : bit;
70
signal c05 : bit;
71
signal c06 : bit;
72
signal c07 : bit;
73
signal c08 : bit;
74
signal c09 : bit;
75
signal c10 : bit;
76
signal c11 : bit;
77
signal c12 : bit;
78 22 arif_endro
signal ov  : bit;
79 2 arif_endro
 
80
begin
81
 
82
c00                     <= '0';
83
over12                  <= (addend_12bit (11) xor augend_12bit (11));
84 22 arif_endro
ov                      <= ((adder12_output_int (11) and over12) or
85 2 arif_endro
                           (c12 and (not (over12))));
86 22 arif_endro
adder12_output(11 downto 00) <= adder12_output_int;
87
adder12_output(12)           <= ov;
88 2 arif_endro
 
89
fa11 : fulladder
90
   port map (
91
      addend     => addend_12bit(11),
92
      augend     => augend_12bit(11),
93
      carry_in   => c11,
94
      sum        => adder12_output_int(11),
95
      carry      => c12
96
      );
97
 
98
fa10 : fulladder
99
   port map (
100
      addend     => addend_12bit(10),
101
      augend     => augend_12bit(10),
102
      carry_in   => c10,
103
      sum        => adder12_output_int(10),
104
      carry      => c11
105
      );
106
 
107
fa09 : fulladder
108
   port map (
109
      addend     => addend_12bit(09),
110
      augend     => augend_12bit(09),
111
      carry_in   => c09,
112
      sum        => adder12_output_int(09),
113
      carry      => c10
114
      );
115
 
116
fa08 : fulladder
117
   port map (
118
      addend     => addend_12bit(08),
119
      augend     => augend_12bit(08),
120
      carry_in   => c08,
121
      sum        => adder12_output_int(08),
122
      carry      => c09
123
      );
124
 
125
fa07 : fulladder
126
   port map (
127
      addend     => addend_12bit(07),
128
      augend     => augend_12bit(07),
129
      carry_in   => c07,
130
      sum        => adder12_output_int(07),
131
      carry      => c08
132
      );
133
 
134
fa06 : fulladder
135
   port map (
136
      addend     => addend_12bit(06),
137
      augend     => augend_12bit(06),
138
      carry_in   => c06,
139
      sum        => adder12_output_int(06),
140
      carry      => c07
141
      );
142
 
143
fa05 : fulladder
144
   port map (
145
      addend     => addend_12bit(05),
146
      augend     => augend_12bit(05),
147
      carry_in   => c05,
148
      sum        => adder12_output_int(05),
149
      carry      => c06
150
      );
151
 
152
fa04 : fulladder
153
   port map (
154
      addend     => addend_12bit(04),
155
      augend     => augend_12bit(04),
156
      carry_in   => c04,
157
      sum        => adder12_output_int(04),
158
      carry      => c05
159
      );
160
 
161
fa03 : fulladder
162
   port map (
163
      addend     => addend_12bit(03),
164
      augend     => augend_12bit(03),
165
      carry_in   => c03,
166
      sum        => adder12_output_int(03),
167
      carry      => c04
168
      );
169
 
170
fa02 : fulladder
171
   port map (
172
      addend     => addend_12bit(02),
173
      augend     => augend_12bit(02),
174
      carry_in   => c02,
175
      sum        => adder12_output_int(02),
176
      carry      => c03
177
      );
178
 
179
fa01 : fulladder
180
   port map (
181
      addend     => addend_12bit(01),
182
      augend     => augend_12bit(01),
183
      carry_in   => c01,
184
      sum        => adder12_output_int(01),
185
      carry      => c02
186
      );
187
 
188
fa00 : fulladder
189
   port map (
190
      addend     => addend_12bit(00),
191
      augend     => augend_12bit(00),
192
      carry_in   => c00,
193
      sum        => adder12_output_int(00),
194
      carry      => c01
195
      );
196
 
197
end structural;

powered by: WebSVN 2.1.0

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