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(Qt::darkBlue,2)));
61 Lines.append(
new Line( 30, -80, 30, 100,QPen(Qt::darkBlue,2)));
62 Lines.append(
new Line( 30, 100,-30, 100,QPen(Qt::darkBlue,2)));
63 Lines.append(
new Line(-30, 100,-30, -80,QPen(Qt::darkBlue,2)));
65 Lines.append(
new Line(-50,-40,-40,-40,QPen(Qt::darkBlue,2)));
66 Lines.append(
new Line(-50,-20,-30, -20,QPen(Qt::darkBlue,2)));
67 Lines.append(
new Line(-50, 0, -30, 0,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line(-50, 30, -30, 30,QPen(Qt::darkBlue,2)));
69 Lines.append(
new Line(-50, 50,-30, 50,QPen(Qt::darkBlue,2)));
70 Lines.append(
new Line(-50, 70, -30, 70,QPen(Qt::darkBlue,2)));
71 Lines.append(
new Line(-50, 90, -30, 90,QPen(Qt::darkBlue,2)));
73 Lines.append(
new Line( 30, 10, 50, 10,QPen(Qt::darkBlue,2)));
75 Arcs.append(
new Arc( -40, -45, 10, 10, 0, 16*360, QPen(Qt::darkBlue,2)));
77 Texts.append(
new Text(-17,-75,
"MUX", Qt::darkBlue, 12.0));
79 Texts.append(
new Text(-25,-53,
"En", Qt::darkBlue, 12.0));
80 Texts.append(
new Text(-14,-23,
"G", Qt::darkBlue, 12.0));
81 Texts.append(
new Text(-1, -28,
"}", Qt::darkBlue, 16.0));
82 Texts.append(
new Text( 12,-30,
"0", Qt::darkBlue, 12.0));
83 Texts.append(
new Text( 12,-10,
"3", Qt::darkBlue, 12.0));
85 Texts.append(
new Text(-25,-31,
"0", Qt::darkBlue, 12.0));
86 Texts.append(
new Text(-25,-11,
"1", Qt::darkBlue, 12.0));
88 Texts.append(
new Text(-25, 17,
"0", Qt::darkBlue, 12.0));
89 Texts.append(
new Text(-25, 37,
"1", Qt::darkBlue, 12.0));
90 Texts.append(
new Text(-25, 57,
"2", Qt::darkBlue, 12.0));
91 Texts.append(
new Text(-25, 77,
"3", Qt::darkBlue, 12.0));
93 Lines.append(
new Line(11, -8, 23, -8, QPen(Qt::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";
bool VHDL_Delay(QString &td, const QString &Name)
Q3PtrList< struct Arc > Arcs
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
static Element * info(QString &, char *&, bool getNewOne=false)
virtual void recreate(Schematic *)