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

Subversion Repositories product_code_iterative_decoder

[/] [product_code_iterative_decoder/] [trunk/] [source/] [adder_08bit.vhdl] - Blame information for rev 18

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 arif_endro
-- ------------------------------------------------------------------------
2 14 arif_endro
-- Copyright (C) 2005 Arif Endro Nugroho
3 18 arif_endro
-- All rights reserved.
4 2 arif_endro
-- 
5 18 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 2 arif_endro
-- 
9 18 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 2 arif_endro
-- 
15 18 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 2 arif_endro
-- 
27 18 arif_endro
-- End Of License.
28
-- ------------------------------------------------------------------------
29 2 arif_endro
 
30
library IEEE;
31
use IEEE.std_logic_1164.all;
32
 
33
entity adder_08bit is
34
   port (
35
      addend_08bit  : in  bit_vector (07 downto 0);
36
      augend_08bit  : in  bit_vector (07 downto 0);
37
      adder08_output: out bit_vector (08 downto 0)
38
      );
39
end adder_08bit;
40
 
41
architecture structural of adder_08bit 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
signal c00 : bit;
54
signal c01 : bit;
55
signal c02 : bit;
56
signal c03 : bit;
57
signal c04 : bit;
58
signal c05 : bit;
59
signal c06 : bit;
60
signal c07 : bit;
61
signal c08 : bit;
62
signal over08 : bit;
63
signal adder08_output_int : bit_vector (08 downto 0);
64
 
65
begin
66
 
67
c00                     <= '0';
68
over08                  <= (addend_08bit (07) xor augend_08bit (07));
69
adder08_output_int (08) <= ((adder08_output_int (07) and over08) or
70
                           (c08 and (not (over08))));
71
adder08_output          <= adder08_output_int;
72
 
73
fa07 : fulladder
74
   port map (
75
      addend     => addend_08bit(07),
76
      augend     => augend_08bit(07),
77
      carry_in   => c07,
78
      sum        => adder08_output_int(07),
79
      carry      => c08
80
      );
81
 
82
fa06 : fulladder
83
   port map (
84
      addend     => addend_08bit(06),
85
      augend     => augend_08bit(06),
86
      carry_in   => c06,
87
      sum        => adder08_output_int(06),
88
      carry      => c07
89
      );
90
 
91
fa05 : fulladder
92
   port map (
93
      addend     => addend_08bit(05),
94
      augend     => augend_08bit(05),
95
      carry_in   => c05,
96
      sum        => adder08_output_int(05),
97
      carry      => c06
98
      );
99
 
100
fa04 : fulladder
101
   port map (
102
      addend     => addend_08bit(04),
103
      augend     => augend_08bit(04),
104
      carry_in   => c04,
105
      sum        => adder08_output_int(04),
106
      carry      => c05
107
      );
108
 
109
fa03 : fulladder
110
   port map (
111
      addend     => addend_08bit(03),
112
      augend     => augend_08bit(03),
113
      carry_in   => c03,
114
      sum        => adder08_output_int(03),
115
      carry      => c04
116
      );
117
 
118
fa02 : fulladder
119
   port map (
120
      addend     => addend_08bit(02),
121
      augend     => augend_08bit(02),
122
      carry_in   => c02,
123
      sum        => adder08_output_int(02),
124
      carry      => c03
125
      );
126
 
127
fa01 : fulladder
128
   port map (
129
      addend     => addend_08bit(01),
130
      augend     => augend_08bit(01),
131
      carry_in   => c01,
132
      sum        => adder08_output_int(01),
133
      carry      => c02
134
      );
135
 
136
fa00 : fulladder
137
   port map (
138
      addend     => addend_08bit(00),
139
      augend     => augend_08bit(00),
140
      carry_in   => c00,
141
      sum        => adder08_output_int(00),
142
      carry      => c01
143
      );
144
 
145
end structural;

powered by: WebSVN 2.1.0

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