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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [adder_11bit.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 adder_11bit is
34
   port (
35
      addend_11bit  : in  bit_vector (10 downto 0);
36
      augend_11bit  : in  bit_vector (10 downto 0);
37
      adder11_output: out bit_vector (11 downto 0) -- 12 bit output
38
      );
39
end adder_11bit;
40
 
41
architecture structural of adder_11bit 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 over11 : bit;
67 22 arif_endro
signal adder11_output_int : bit_vector (10 downto 0);
68
signal ov  : bit;
69 2 arif_endro
 
70
begin
71
 
72
c00                     <= '0';
73
over11                  <= (addend_11bit (10) xor augend_11bit (10));
74 22 arif_endro
ov                      <= ((adder11_output_int (10) and over11) or
75 2 arif_endro
                           (c11 and (not (over11))));
76 22 arif_endro
adder11_output(10 downto 00) <= adder11_output_int;
77
adder11_output(11)           <= ov;
78 2 arif_endro
 
79
fa10 : fulladder
80
   port map (
81
      addend     => addend_11bit(10),
82
      augend     => augend_11bit(10),
83
      carry_in   => c10,
84
      sum        => adder11_output_int(10),
85
      carry      => c11
86
      );
87
 
88
fa09 : fulladder
89
   port map (
90
      addend     => addend_11bit(09),
91
      augend     => augend_11bit(09),
92
      carry_in   => c09,
93
      sum        => adder11_output_int(09),
94
      carry      => c10
95
      );
96
 
97
fa08 : fulladder
98
   port map (
99
      addend     => addend_11bit(08),
100
      augend     => augend_11bit(08),
101
      carry_in   => c08,
102
      sum        => adder11_output_int(08),
103
      carry      => c09
104
      );
105
 
106
fa07 : fulladder
107
   port map (
108
      addend     => addend_11bit(07),
109
      augend     => augend_11bit(07),
110
      carry_in   => c07,
111
      sum        => adder11_output_int(07),
112
      carry      => c08
113
      );
114
 
115
fa06 : fulladder
116
   port map (
117
      addend     => addend_11bit(06),
118
      augend     => augend_11bit(06),
119
      carry_in   => c06,
120
      sum        => adder11_output_int(06),
121
      carry      => c07
122
      );
123
 
124
fa05 : fulladder
125
   port map (
126
      addend     => addend_11bit(05),
127
      augend     => augend_11bit(05),
128
      carry_in   => c05,
129
      sum        => adder11_output_int(05),
130
      carry      => c06
131
      );
132
 
133
fa04 : fulladder
134
   port map (
135
      addend     => addend_11bit(04),
136
      augend     => augend_11bit(04),
137
      carry_in   => c04,
138
      sum        => adder11_output_int(04),
139
      carry      => c05
140
      );
141
 
142
fa03 : fulladder
143
   port map (
144
      addend     => addend_11bit(03),
145
      augend     => augend_11bit(03),
146
      carry_in   => c03,
147
      sum        => adder11_output_int(03),
148
      carry      => c04
149
      );
150
 
151
fa02 : fulladder
152
   port map (
153
      addend     => addend_11bit(02),
154
      augend     => augend_11bit(02),
155
      carry_in   => c02,
156
      sum        => adder11_output_int(02),
157
      carry      => c03
158
      );
159
 
160
fa01 : fulladder
161
   port map (
162
      addend     => addend_11bit(01),
163
      augend     => augend_11bit(01),
164
      carry_in   => c01,
165
      sum        => adder11_output_int(01),
166
      carry      => c02
167
      );
168
 
169
fa00 : fulladder
170
   port map (
171
      addend     => addend_11bit(00),
172
      augend     => augend_11bit(00),
173
      carry_in   => c00,
174
      sum        => adder11_output_int(00),
175
      carry      => c01
176
      );
177
 
178
end structural;

powered by: WebSVN 2.1.0

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