1 |
2 |
kavi |
----==============================================================----
|
2 |
|
|
---- ----
|
3 |
|
|
---- Filename: cmpeq.vhd ----
|
4 |
|
|
---- Module description: Equality comparator ----
|
5 |
|
|
---- ----
|
6 |
|
|
---- Author: Nikolaos Kavvadias ----
|
7 |
|
|
---- nkavv@skiathos.physics.auth.gr ----
|
8 |
|
|
---- ----
|
9 |
|
|
---- ----
|
10 |
|
|
---- Downloaded from: http://wwww.opencores.org/cores/hwlu ----
|
11 |
|
|
---- ----
|
12 |
|
|
---- To Do: ----
|
13 |
|
|
---- Probably remains as current ----
|
14 |
|
|
---- (to promote as stable version) ----
|
15 |
|
|
---- ----
|
16 |
|
|
---- Author: Nikolaos Kavvadias ----
|
17 |
|
|
---- nkavv@skiathos.physics.auth.gr ----
|
18 |
|
|
---- ----
|
19 |
|
|
----==============================================================----
|
20 |
|
|
---- ----
|
21 |
|
|
---- Copyright (C) 2004 Nikolaos Kavvadias ----
|
22 |
|
|
---- nick-kavi.8m.com ----
|
23 |
|
|
---- nkavv@skiathos.physics.auth.gr ----
|
24 |
|
|
---- nick_ka_vi@hotmail.com ----
|
25 |
|
|
---- ----
|
26 |
|
|
---- This source file may be used and distributed without ----
|
27 |
|
|
---- restriction provided that this copyright statement is not ----
|
28 |
|
|
---- removed from the file and that any derivative work contains ----
|
29 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
30 |
|
|
---- ----
|
31 |
|
|
---- This source file is free software; you can redistribute it ----
|
32 |
|
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
33 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
34 |
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
35 |
|
|
---- later version. ----
|
36 |
|
|
---- ----
|
37 |
|
|
---- This source is distributed in the hope that it will be ----
|
38 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
39 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
40 |
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
41 |
|
|
---- details. ----
|
42 |
|
|
---- ----
|
43 |
|
|
---- You should have received a copy of the GNU Lesser General ----
|
44 |
|
|
---- Public License along with this source; if not, download it ----
|
45 |
|
|
---- from <http://www.opencores.org/lgpl.shtml> ----
|
46 |
|
|
---- ----
|
47 |
|
|
----==============================================================----
|
48 |
|
|
--
|
49 |
|
|
-- CVS Revision History
|
50 |
|
|
--
|
51 |
|
|
|
52 |
|
|
library IEEE;
|
53 |
|
|
use IEEE.std_logic_1164.all;
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
entity cmpeq is
|
57 |
|
|
generic (
|
58 |
|
|
DW : integer := 8
|
59 |
|
|
);
|
60 |
|
|
port (
|
61 |
|
|
a : in std_logic_vector(DW-1 downto 0);
|
62 |
|
|
b : in std_logic_vector(DW-1 downto 0);
|
63 |
|
|
reset : in std_logic;
|
64 |
|
|
a_eq_b : out std_logic
|
65 |
|
|
);
|
66 |
|
|
end cmpeq;
|
67 |
|
|
|
68 |
|
|
architecture rtl of cmpeq is
|
69 |
|
|
begin
|
70 |
|
|
--
|
71 |
|
|
a_eq_b <= '1' when (a = b and reset = '0') else '0';
|
72 |
|
|
--
|
73 |
|
|
end rtl;
|