26 Description = QObject::tr (
"2to1 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(
"2to1 Mux");
52 BitmapFile = (
char *)
"mux2to1";
54 if(getNewOne)
return new mux2to1();
61 Lines.append(
new Line(-30, -60, 30,-60,QPen(Qt::darkBlue,2)));
62 Lines.append(
new Line( 30, -60, 30, 50,QPen(Qt::darkBlue,2)));
63 Lines.append(
new Line( 30, 50,-30, 50,QPen(Qt::darkBlue,2)));
64 Lines.append(
new Line(-30, 50,-30,-60,QPen(Qt::darkBlue,2)));
66 Lines.append(
new Line(-50,-20,-40,-20,QPen(Qt::darkBlue,2)));
67 Lines.append(
new Line(-50, 0,-30, 0,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line(-50, 20,-30, 20,QPen(Qt::darkBlue,2)));
69 Lines.append(
new Line(-50, 40,-30, 40,QPen(Qt::darkBlue,2)));
71 Lines.append(
new Line( 30, 0, 50, 0,QPen(Qt::darkBlue,2)));
73 Arcs.append(
new Arc(-40, -25, 10, 10, 0, 16*360, QPen(Qt::darkBlue,2)));
75 Texts.append(
new Text(-17,-55,
"MUX", Qt::darkBlue, 12.0));
77 Texts.append(
new Text(-25,-33,
"En", Qt::darkBlue, 12.0));
78 Texts.append(
new Text(-25,-13,
"0", Qt::darkBlue, 12.0));
80 Texts.append(
new Text(-15,-15,
"G", Qt::darkBlue, 12.0));
81 Texts.append(
new Text( -1,-21,
"}", Qt::darkBlue, 16.0));
82 Texts.append(
new Text( 12,-22,
"0", Qt::darkBlue, 12.0));
83 Texts.append(
new Text( 12, -2,
"1", Qt::darkBlue, 12.0));
85 Lines.append(
new Line(11, 0, 23, 0, QPen(Qt::darkBlue,2)));
87 Texts.append(
new Text(-25, 7,
"0", Qt::darkBlue, 12.0));
88 Texts.append(
new Text(-25, 27,
"1", Qt::darkBlue, 12.0));
104 QString td =
Props.at(1)->Value;
109 QString En =
Ports.at(0)->Connection->Name;
110 QString A =
Ports.at(1)->Connection->Name;
111 QString D0 =
Ports.at(2)->Connection->Name;
112 QString D1 =
Ports.at(3)->Connection->Name;
113 QString y =
Ports.at(4)->Connection->Name;
115 s =
"\n " +
Name +
":process (" + En +
", " + A +
", " + D0 +
", " + D1 +
")\n" +
117 " " + y +
" <= " +
"(not " + En +
") and ((" + D1 +
" and " + A +
") or " +
118 "(" + D0 +
" and " +
"(not " + A +
")))" + td +
125 QString td =
Props.at(1)->Value;
132 QString En =
Ports.at(0)->Connection->Name;
133 QString A =
Ports.at(1)->Connection->Name;
134 QString D0 =
Ports.at(2)->Connection->Name;
135 QString D1 =
Ports.at(3)->Connection->Name;
136 QString y =
Ports.at(4)->Connection->Name;
138 QString v =
"net_reg" +
Name + y;
140 l =
"\n // " +
Name +
" 2to1 mux\n" +
141 " assign " + y +
" = " + v +
";\n" +
142 " reg " + v +
" = 0;\n" +
143 " always @ (" + En +
" or " + A +
" or "
144 + D0 +
" or " + D1 +
")\n" +
145 " " + v +
" <=" + td +
"(" + D1 +
" && " + A +
")" +
" || " +
146 "(" + D0 +
" && (~" + A +
"));\n" ;
bool VHDL_Delay(QString &td, const QString &Name)
Q3PtrList< struct Arc > Arcs
static Element * info(QString &, char *&, bool getNewOne=false)
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
virtual void recreate(Schematic *)