URL
https://opencores.org/ocsvn/idea/idea/trunk
Subversion Repositories idea
[/] [idea/] [trunk/] [behavioral/] [key_regulator/] [comparator2.vbe] - Rev 9
Compare with Previous | Blame | View Log
-- File Name : comparator2.vbe
-- Description : compare 2 input and generate output as
-- "0000000000000000" or "0000000000000001"
-- Author : Mas Adit
-- Date : 29 Agustus 2001
ENTITY comparator2 IS
PORT(
a : IN BIT_VECTOR (15 DOWNTO 0);
b : IN BIT_VECTOR (15 DOWNTO 0);
o : OUT BIT_VECTOR (15 DOWNTO 0);
vdd : IN BIT;
vss : IN BIT
);
END comparator2;
ARCHITECTURE VBE OF comparator2 IS
SIGNAL nq, yq : BIT_VECTOR (15 DOWNTO 0);
SIGNAL sa, ku : BIT;
BEGIN
ASSERT ((vdd and not (vss)) = '1')
REPORT "power supply is missing on comparator2"
SEVERITY WARNING;
nq(0) <= (not (a(0)) and not (b(0))) or (a(0) and b(0));
nq(1) <= (not (a(1)) and not (b(1))) or (a(1) and b(1));
nq(2) <= (not (a(2)) and not (b(2))) or (a(2) and b(2));
nq(3) <= (not (a(3)) and not (b(3))) or (a(3) and b(3));
nq(4) <= (not (a(4)) and not (b(4))) or (a(4) and b(4));
nq(5) <= (not (a(5)) and not (b(5))) or (a(5) and b(5));
nq(6) <= (not (a(6)) and not (b(6))) or (a(6) and b(6));
nq(7) <= (not (a(7)) and not (b(7))) or (a(7) and b(7));
nq(8) <= (not (a(8)) and not (b(8))) or (a(8) and b(8));
nq(9) <= (not (a(9)) and not (b(9))) or (a(9) and b(9));
nq(10) <= (not (a(10)) and not (b(10))) or (a(10) and b(10));
nq(11) <= (not (a(11)) and not (b(11))) or (a(11) and b(11));
nq(12) <= (not (a(12)) and not (b(12))) or (a(12) and b(12));
nq(13) <= (not (a(13)) and not (b(13))) or (a(13) and b(13));
nq(14) <= (not (a(14)) and not (b(14))) or (a(14) and b(14));
nq(15) <= (not (a(15)) and not (b(15))) or (a(15) and b(15));
sa <= nq(0) and nq(1) and nq(2) and nq(3) and nq(4) and nq(5) and nq(6)
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);
yq(0) <= (b(0) and not (a(0))) and (((not (a(1)) and not (b(1))) or (a(1) and b(1))))
and (((not (a(2)) and not (b(2))) or (a(2) and b(2))))
and (((not (a(3)) and not (b(3))) or (a(3) and b(3))))
and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(1) <= (b(1) and not (a(1))) and (((not (a(2)) and not (b(2))) or (a(2) and b(2))))
and (((not (a(3)) and not (b(3))) or (a(3) and b(3))))
and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(2) <= (b(2) and not (a(2))) and (((not (a(3)) and not (b(3))) or (a(3) and b(3))))
and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(3) <= (b(3) and not (a(3))) and (((not (a(4)) and not (b(4))) or (a(4) and b(4))))
and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(4) <= (b(4) and not (a(4))) and (((not (a(5)) and not (b(5))) or (a(5) and b(5))))
and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(5) <= (b(5) and not (a(5))) and (((not (a(6)) and not (b(6))) or (a(6) and b(6))))
and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(6) <= (b(6) and not (a(6))) and (((not (a(7)) and not (b(7))) or (a(7) and b(7))))
and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(7) <= (b(7) and not (a(7))) and (((not (a(8)) and not (b(8))) or (a(8) and b(8))))
and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(8) <= (b(8) and not (a(8))) and (((not (a(9)) and not (b(9))) or (a(9) and b(9))))
and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(9) <= (b(9) and not (a(9))) and (((not (a(10)) and not (b(10))) or (a(10) and b(10))))
and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(10) <= (b(10) and not (a(10))) and (((not (a(11)) and not (b(11))) or (a(11) and b(11))))
and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(11) <= (b(11) and not (a(11))) and (((not (a(12)) and not (b(12))) or (a(12) and b(12))))
and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(12) <= (b(12) and not (a(12))) and (((not (a(13)) and not (b(13))) or (a(13) and b(13))))
and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(13) <= (b(13) and not (a(13))) and (((not (a(14)) and not (b(14))) or (a(14) and b(14))))
and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(14) <= (b(14) and not (a(14))) and (((not (a(15)) and not (b(15))) or (a(15) and b(15))));
yq(15) <= (b(15) and not (a(15)));
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)
or yq(10) or yq(11) or yq(12) or yq(13) or yq(14) or yq(15);
o <= "0000000000000001" WHEN ((sa = '1') OR (ku = '1')) ELSE "0000000000000000";
END VBE;