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

Subversion Repositories idea

[/] [idea/] [trunk/] [behavioral/] [key_regulator/] [comparator2.vbe] - Blame information for rev 10

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

Line No. Rev Author Line
1 6 marta
-- File Name    : comparator2.vbe
2
-- Description  : compare 2 input and generate output as
3
--                "0000000000000000" or "0000000000000001"
4
-- Author       : Mas Adit
5
-- Date         : 29 Agustus 2001
6
 
7
ENTITY comparator2 IS
8
PORT(
9
  a     : IN BIT_VECTOR (15 DOWNTO 0);
10
  b     : IN BIT_VECTOR (15 DOWNTO 0);
11
  o     : OUT BIT_VECTOR (15 DOWNTO 0);
12
  vdd   : IN  BIT;
13
  vss   : IN  BIT
14
);
15
END comparator2;
16
 
17
ARCHITECTURE VBE OF comparator2 IS
18
  SIGNAL nq, yq : BIT_VECTOR (15 DOWNTO 0);
19
  SIGNAL sa, ku : BIT;
20
 
21
 
22
BEGIN
23
  ASSERT ((vdd and not (vss)) = '1')
24
  REPORT "power supply is missing on comparator2"
25
  SEVERITY WARNING;
26
 
27
  nq(0) <= (not (a(0)) and not (b(0))) or (a(0) and b(0));
28
  nq(1) <= (not (a(1)) and not (b(1))) or (a(1) and b(1));
29
  nq(2) <= (not (a(2)) and not (b(2))) or (a(2) and b(2));
30
  nq(3) <= (not (a(3)) and not (b(3))) or (a(3) and b(3));
31
  nq(4) <= (not (a(4)) and not (b(4))) or (a(4) and b(4));
32
  nq(5) <= (not (a(5)) and not (b(5))) or (a(5) and b(5));
33
  nq(6) <= (not (a(6)) and not (b(6))) or (a(6) and b(6));
34
  nq(7) <= (not (a(7)) and not (b(7))) or (a(7) and b(7));
35
  nq(8) <= (not (a(8)) and not (b(8))) or (a(8) and b(8));
36
  nq(9) <= (not (a(9)) and not (b(9))) or (a(9) and b(9));
37
  nq(10) <= (not (a(10)) and not (b(10))) or (a(10) and b(10));
38
  nq(11) <= (not (a(11)) and not (b(11))) or (a(11) and b(11));
39
  nq(12) <= (not (a(12)) and not (b(12))) or (a(12) and b(12));
40
  nq(13) <= (not (a(13)) and not (b(13))) or (a(13) and b(13));
41
  nq(14) <= (not (a(14)) and not (b(14))) or (a(14) and b(14));
42
  nq(15) <= (not (a(15)) and not (b(15))) or (a(15) and b(15));
43
 
44
  sa <= nq(0) and nq(1) and nq(2) and nq(3) and nq(4) and nq(5) and nq(6)
45
        and nq(7) and nq(8) and nq(9) and nq(10) and nq(11) and nq(12) and nq(13) and nq(14) and nq(15);
46
 
47
  yq(0) <= (b(0) and not (a(0))) and (((not (a(1)) and not (b(1))) or (a(1) and b(1))))
48
                                and (((not (a(2)) and not (b(2))) or (a(2) and b(2))))
49
                                and (((not (a(3)) and not (b(3))) or (a(3) and b(3))))
50
                                and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
51
                                and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
52
                                and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
53
                                and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
54
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
55
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
56
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
57
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
58
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
59
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
60
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
61
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
62
  yq(1) <= (b(1) and not (a(1))) and (((not (a(2)) and not (b(2))) or (a(2) and b(2))))
63
                                and (((not (a(3)) and not (b(3))) or (a(3) and b(3))))
64
                                and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
65
                                and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
66
                                and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
67
                                and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
68
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
69
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
70
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
71
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
72
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
73
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
74
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
75
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
76
  yq(2) <= (b(2) and not (a(2))) and (((not (a(3)) and not (b(3))) or (a(3) and b(3))))
77
                                and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
78
                                and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
79
                                and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
80
                                and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
81
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
82
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
83
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
84
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
85
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
86
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
87
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
88
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
89
  yq(3) <= (b(3) and not (a(3))) and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
90
                                and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
91
                                and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
92
                                and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
93
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
94
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
95
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
96
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
97
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
98
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
99
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
100
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
101
  yq(4) <= (b(4) and not (a(4))) and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
102
                                and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
103
                                and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
104
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
105
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
106
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
107
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
108
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
109
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
110
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
111
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
112
  yq(5) <= (b(5) and not (a(5))) and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
113
                                and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
114
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
115
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
116
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
117
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
118
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
119
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
120
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
121
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
122
  yq(6) <= (b(6) and not (a(6))) and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
123
                                and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
124
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
125
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
126
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
127
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
128
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
129
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
130
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
131
  yq(7) <= (b(7) and not (a(7))) and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
132
                                and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
133
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
134
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
135
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
136
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
137
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
138
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
139
  yq(8) <= (b(8) and not (a(8))) and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
140
                                and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
141
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
142
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
143
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
144
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
145
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
146
  yq(9) <= (b(9) and not (a(9))) and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
147
                                and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
148
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
149
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
150
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
151
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
152
  yq(10) <= (b(10) and not (a(10))) and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
153
                                and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
154
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
155
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
156
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
157
  yq(11) <= (b(11) and not (a(11))) and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
158
                                and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
159
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
160
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
161
  yq(12) <= (b(12) and not (a(12))) and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
162
                                and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
163
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
164
  yq(13) <= (b(13) and not (a(13))) and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
165
                                and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
166
  yq(14) <= (b(14) and not (a(14))) and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
167
  yq(15) <= (b(15) and not (a(15)));
168
 
169
  ku <= yq(0) or yq(1) or yq(2) or yq(3) or yq(4) or yq(5) or yq(6) or yq(7) or yq(8) or yq(9)
170
        or yq(10) or yq(11) or yq(12) or yq(13) or yq(14) or yq(15);
171
 
172
  o <= "0000000000000001" WHEN ((sa = '1') OR (ku = '1')) ELSE "0000000000000000";
173
 
174
END VBE;

powered by: WebSVN 2.1.0

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