26 Description = QObject::tr (
"1bit comparator verilog device");
29 QObject::tr (
"transfer function high scaling factor")));
31 QObject::tr (
"output delay")
32 +
" ("+QObject::tr (
"s")+
")"));
44 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
51 Name = QObject::tr(
"1Bit Comparator");
52 BitmapFile = (
char *)
"comp_1bit";
60 Lines.append(
new Line(-30, -60, 30,-60,QPen(QPen::darkBlue,2)));
61 Lines.append(
new Line( 30, -60, 30, 30,QPen(QPen::darkBlue,2)));
62 Lines.append(
new Line( 30, 30,-30, 30,QPen(QPen::darkBlue,2)));
63 Lines.append(
new Line(-30, 30,-30, -60,QPen(QPen::darkBlue,2)));
65 Lines.append(
new Line(-50,-10,-30,-10,QPen(QPen::darkBlue,2)));
66 Lines.append(
new Line(-50, 10,-30, 10,QPen(QPen::darkBlue,2)));
67 Lines.append(
new Line( 30, 20, 50, 20,QPen(QPen::darkBlue,2)));
68 Lines.append(
new Line( 30, 0, 50, 0,QPen(QPen::darkBlue,2)));
69 Lines.append(
new Line( 30,-20, 50,-20,QPen(QPen::darkBlue,2)));
71 Texts.append(
new Text(-25,-55,
"COMP", QPen::darkBlue, 12.0));
73 Texts.append(
new Text(-25,-23,
"X", QPen::darkBlue, 12.0));
74 Texts.append(
new Text(-25, -3,
"Y", QPen::darkBlue, 12.0));
75 Texts.append(
new Text( -5, 7,
"X<Y", QPen::darkBlue, 12.0));
76 Texts.append(
new Text( -5,-13,
"X>Y", QPen::darkBlue, 12.0));
77 Texts.append(
new Text( -5,-33,
"X=Y", QPen::darkBlue, 12.0));
93 QString td =
Props.at(1)->Value;
97 QString
X =
Ports.at(0)->Connection->Name;
98 QString
Y =
Ports.at(1)->Connection->Name;
99 QString
L =
Ports.at(2)->Connection->Name;
100 QString
G =
Ports.at(3)->Connection->Name;
101 QString
E =
Ports.at(4)->Connection->Name;
103 s =
"\n "+
Name+
":process ("+X+
", "+Y+
")\n"+
105 " "+L+
" <= (not "+X+
") and "+Y+td+
106 " "+G+
" <= "+X+
" and (not "+Y+
")"+td+
107 " "+E+
" <= not ("+X+
" xor "+Y+
")"+td+
116 QString td =
Props.at(1)->Value;
119 QString
X =
Ports.at(0)->Connection->Name;
120 QString
Y =
Ports.at(1)->Connection->Name;
121 QString
L =
Ports.at(2)->Connection->Name;
122 QString
G =
Ports.at(3)->Connection->Name;
123 QString
E =
Ports.at(4)->Connection->Name;
125 QString LR =
"L_reg" +
Name +
L;
126 QString GR =
"G_reg" +
Name +
G;
127 QString ER =
"E_reg" +
Name +
E;
129 l =
"\n // "+
Name+
" 1bit comparator\n"+
130 " assign "+L+
" = "+LR+
";\n"+
131 " reg "+LR+
" = 0;\n"+
132 " assign "+G+
" = "+GR+
";\n"+
133 " reg "+GR+
" = 0;\n"+
134 " assign "+E+
" = "+ER+
";\n"+
135 " reg "+ER+
" = 0;\n"+
136 " always @ ("+X+
" or "+Y+
")\n"+
138 " "+LR+
" <="+td+
" (~"+X+
") && "+Y+
";\n"+
139 " "+GR+
" <="+td+
" "+X+
" && (~"+Y+
");\n"+
140 " "+ER+
" <="+td+
" ~("+X+
" ^ "+Y+
");\n"+