26 Description = QObject::tr (
"4to1 multiplexer 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(
"4to1 Mux");
52 BitmapFile = (
char *)
"mux4to1";
54 if(getNewOne)
return new mux4to1();
60 Lines.append(
new Line(-30, -80, 30,-80,QPen(QPen::darkBlue,2)));
61 Lines.append(
new Line( 30, -80, 30, 100,QPen(QPen::darkBlue,2)));
62 Lines.append(
new Line( 30, 100,-30, 100,QPen(QPen::darkBlue,2)));
63 Lines.append(
new Line(-30, 100,-30, -80,QPen(QPen::darkBlue,2)));
65 Lines.append(
new Line(-50,-40,-40,-40,QPen(QPen::darkBlue,2)));
66 Lines.append(
new Line(-50,-20,-30, -20,QPen(QPen::darkBlue,2)));
67 Lines.append(
new Line(-50, 0, -30, 0,QPen(QPen::darkBlue,2)));
68 Lines.append(
new Line(-50, 30, -30, 30,QPen(QPen::darkBlue,2)));
69 Lines.append(
new Line(-50, 50,-30, 50,QPen(QPen::darkBlue,2)));
70 Lines.append(
new Line(-50, 70, -30, 70,QPen(QPen::darkBlue,2)));
71 Lines.append(
new Line(-50, 90, -30, 90,QPen(QPen::darkBlue,2)));
73 Lines.append(
new Line( 30, 10, 50, 10,QPen(QPen::darkBlue,2)));
75 Arcs.append(
new Arc( -40, -45, 10, 10, 0, 16*360, QPen(QPen::darkBlue,2)));
77 Texts.append(
new Text(-17,-75,
"MUX", QPen::darkBlue, 12.0));
79 Texts.append(
new Text(-25,-53,
"En", QPen::darkBlue, 12.0));
80 Texts.append(
new Text(-14,-23,
"G", QPen::darkBlue, 12.0));
81 Texts.append(
new Text(-1, -28,
"}", QPen::darkBlue, 16.0));
82 Texts.append(
new Text( 12,-30,
"0", QPen::darkBlue, 12.0));
83 Texts.append(
new Text( 12,-10,
"3", QPen::darkBlue, 12.0));
85 Texts.append(
new Text(-25,-31,
"0", QPen::darkBlue, 12.0));
86 Texts.append(
new Text(-25,-11,
"1", QPen::darkBlue, 12.0));
88 Texts.append(
new Text(-25, 17,
"0", QPen::darkBlue, 12.0));
89 Texts.append(
new Text(-25, 37,
"1", QPen::darkBlue, 12.0));
90 Texts.append(
new Text(-25, 57,
"2", QPen::darkBlue, 12.0));
91 Texts.append(
new Text(-25, 77,
"3", QPen::darkBlue, 12.0));
93 Lines.append(
new Line(11, -8, 23, -8, QPen(QPen::darkBlue,2)));
112 QString td =
Props.at(1)->Value;
116 QString En =
Ports.at(0)->Connection->Name;
117 QString
A =
Ports.at(1)->Connection->Name;
118 QString
B =
Ports.at(2)->Connection->Name;
119 QString
D0 =
Ports.at(3)->Connection->Name;
120 QString
D1 =
Ports.at(4)->Connection->Name;
121 QString
D2 =
Ports.at(5)->Connection->Name;
122 QString
D3 =
Ports.at(6)->Connection->Name;
123 QString y =
Ports.at(7)->Connection->Name;
125 s =
"\n " +
Name +
":process (" + En +
", " + A +
", " + B +
", " +
126 D0 +
", " + D1 +
", " + D2 +
", " + D3 +
")\n" +
128 y +
" <= " +
"(not " + En +
") and ((" + D3 +
" and " + B +
" and " + A +
") or\n" +
129 " (" + D2 +
" and " + B +
" and not " + A +
") or\n" +
130 " (" + D1 +
" and not " + B +
" and " + A +
") or\n" +
131 " (" + D0 +
" and not " + B +
" and not " + A +
")" +
")" + td +
138 QString td =
Props.at(1)->Value;
143 QString En =
Ports.at(0)->Connection->Name;
144 QString
A =
Ports.at(1)->Connection->Name;
145 QString
B =
Ports.at(2)->Connection->Name;
146 QString
D0 =
Ports.at(3)->Connection->Name;
147 QString
D1 =
Ports.at(4)->Connection->Name;
148 QString
D2 =
Ports.at(5)->Connection->Name;
149 QString
D3 =
Ports.at(6)->Connection->Name;
150 QString y =
Ports.at(7)->Connection->Name;
152 QString v =
"net_reg" +
Name + y;
154 l =
"\n // " +
Name +
" 4to1 mux\n" +
155 " assign " + y +
" = " + v +
";\n" +
156 " reg " + v +
" = 0;\n" +
157 " always @ (" + En +
" or " + A +
" or " + B +
" or "
158 + D0 +
" or " + D1 +
" or " + D2 +
" or " + D0 +
")\n" +
159 " " + v +
" <=" + td +
" (" + D3 +
" && " + B +
" && " + A +
")" +
" ||\n" +
160 " (" + D2 +
" && " + B +
" && ~"+ A +
")" +
" ||\n" +
161 " (" + D1 +
" && ~"+ B +
" && " + A +
")" +
" ||\n" +
162 " (" + D0 +
" && ~"+ B +
" && ~"+ A +
");\n";