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/] [comparator_7bit.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 comparator_7bit is
34
   port (
35
   a_7bit_i   : in  bit_vector (06 downto 00);
36
   b_7bit_i   : in  bit_vector (06 downto 00);
37
   a_eq_b     : out bit;
38
   a_gt_b     : out bit;
39
   a_lt_b     : out bit
40
   );
41
end comparator_7bit;
42
 
43
architecture structural of comparator_7bit is
44
 
45
   component bit_comparator
46
       port (
47
          a_i   : in  bit;
48
          b_i   : in  bit;
49
          eq_i  : in  bit;
50
          gt_i  : in  bit;
51
          lt_i  : in  bit;
52
          eq_o  : out bit;
53
          gt_o  : out bit;
54
          lt_o  : out bit
55
          );
56
   end component;
57
 
58
signal eq_i_0 : bit;
59
signal gt_i_0 : bit;
60
signal lt_i_0 : bit;
61
 
62
signal eq_o_0 : bit;
63
signal gt_o_0 : bit;
64
signal lt_o_0 : bit;
65
 
66
signal eq_o_1 : bit;
67
signal gt_o_1 : bit;
68
signal lt_o_1 : bit;
69
 
70
signal eq_o_2 : bit;
71
signal gt_o_2 : bit;
72
signal lt_o_2 : bit;
73
 
74
signal eq_o_3 : bit;
75
signal gt_o_3 : bit;
76
signal lt_o_3 : bit;
77
 
78
signal eq_o_4 : bit;
79
signal gt_o_4 : bit;
80
signal lt_o_4 : bit;
81
 
82
signal eq_o_5 : bit;
83
signal gt_o_5 : bit;
84
signal lt_o_5 : bit;
85
 
86
signal eq_o_6 : bit;
87
signal gt_o_6 : bit;
88
signal lt_o_6 : bit;
89
 
90
 
91
begin
92
 
93
eq_i_0 <= '1'; -- 20051015 Fixed
94
gt_i_0 <= '0';
95
lt_i_0 <= '0';
96
 
97
a_eq_b <= eq_o_6;
98
a_gt_b <= gt_o_6;
99
a_lt_b <= lt_o_6;
100
 
101
cmp6 : bit_comparator
102
   port map (
103
     a_i   =>  a_7bit_i (06),
104
     b_i   =>  b_7bit_i (06),
105
     eq_i  =>  eq_o_5,
106
     gt_i  =>  gt_o_5,
107
     lt_i  =>  lt_o_5,
108
     eq_o  =>  eq_o_6,
109
     gt_o  =>  gt_o_6,
110
     lt_o  =>  lt_o_6
111
     );
112
 
113
cmp5 : bit_comparator
114
   port map (
115
     a_i   =>  a_7bit_i (05),
116
     b_i   =>  b_7bit_i (05),
117
     eq_i  =>  eq_o_4,
118
     gt_i  =>  gt_o_4,
119
     lt_i  =>  lt_o_4,
120
     eq_o  =>  eq_o_5,
121
     gt_o  =>  gt_o_5,
122
     lt_o  =>  lt_o_5
123
     );
124
 
125
cmp4 : bit_comparator
126
   port map (
127
     a_i   =>  a_7bit_i (04),
128
     b_i   =>  b_7bit_i (04),
129
     eq_i  =>  eq_o_3,
130
     gt_i  =>  gt_o_3,
131
     lt_i  =>  lt_o_3,
132
     eq_o  =>  eq_o_4,
133
     gt_o  =>  gt_o_4,
134
     lt_o  =>  lt_o_4
135
     );
136
 
137
cmp3 : bit_comparator
138
   port map (
139
     a_i   =>  a_7bit_i (03),
140
     b_i   =>  b_7bit_i (03),
141
     eq_i  =>  eq_o_2,
142
     gt_i  =>  gt_o_2,
143
     lt_i  =>  lt_o_2,
144
     eq_o  =>  eq_o_3,
145
     gt_o  =>  gt_o_3,
146
     lt_o  =>  lt_o_3
147
     );
148
 
149
cmp2 : bit_comparator
150
   port map (
151
     a_i   =>  a_7bit_i (02),
152
     b_i   =>  b_7bit_i (02),
153
     eq_i  =>  eq_o_1,
154
     gt_i  =>  gt_o_1,
155
     lt_i  =>  lt_o_1,
156
     eq_o  =>  eq_o_2,
157
     gt_o  =>  gt_o_2,
158
     lt_o  =>  lt_o_2
159
     );
160
 
161
cmp1 : bit_comparator
162
   port map (
163
     a_i   =>  a_7bit_i (01),
164
     b_i   =>  b_7bit_i (01),
165
     eq_i  =>  eq_o_0,
166
     gt_i  =>  gt_o_0,
167
     lt_i  =>  lt_o_0,
168
     eq_o  =>  eq_o_1,
169
     gt_o  =>  gt_o_1,
170
     lt_o  =>  lt_o_1
171
     );
172
 
173
cmp0 : bit_comparator
174
   port map (
175
     a_i   =>  a_7bit_i (00),
176
     b_i   =>  b_7bit_i (00),
177
     eq_i  =>  eq_i_0,
178
     gt_i  =>  gt_i_0,
179
     lt_i  =>  lt_i_0,
180
     eq_o  =>  eq_o_0,
181
     gt_o  =>  gt_o_0,
182
     lt_o  =>  lt_o_0
183
     );
184
 
185
end structural;

powered by: WebSVN 2.1.0

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