26 Description = QObject::tr (
"2to4 demultiplexer 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(
"2to4 Demux");
52 BitmapFile = (
char *)
"dmux2to4";
60 Lines.append(
new Line(-30, -90, 30,-90,QPen(QPen::darkBlue,2)));
61 Lines.append(
new Line( 30, -90, 30, 20,QPen(QPen::darkBlue,2)));
62 Lines.append(
new Line( 30, 20,-30, 20,QPen(QPen::darkBlue,2)));
63 Lines.append(
new Line(-30, 20,-30,-90,QPen(QPen::darkBlue,2)));
65 Lines.append(
new Line(-50,-50,-40,-50,QPen(QPen::darkBlue,2)));
66 Lines.append(
new Line(-50,-30,-30,-30,QPen(QPen::darkBlue,2)));
67 Lines.append(
new Line(-50,-10,-30,-10,QPen(QPen::darkBlue,2)));
68 Lines.append(
new Line( 30, 10, 50, 10,QPen(QPen::darkBlue,2)));
69 Lines.append(
new Line( 30,-10, 50,-10,QPen(QPen::darkBlue,2)));
70 Lines.append(
new Line( 30,-30, 50,-30,QPen(QPen::darkBlue,2)));
71 Lines.append(
new Line( 30,-50, 50,-50,QPen(QPen::darkBlue,2)));
73 Arcs.append(
new Arc( -40, -55, 10, 10, 0, 16*360, QPen(QPen::darkBlue,2)));
75 Texts.append(
new Text(-25,-85,
"DMUX", QPen::darkBlue, 12.0));
77 Texts.append(
new Text(-28,-63,
"En",QPen::darkBlue, 12.0));
78 Texts.append(
new Text(-20,-33,
"G", QPen::darkBlue, 12.0));
79 Texts.append(
new Text(-8, -38,
"}", QPen::darkBlue, 16.0));
80 Texts.append(
new Text( 2, -40,
"0", QPen::darkBlue, 12.0));
81 Texts.append(
new Text( 2, -20,
"3", QPen::darkBlue, 12.0));
83 Texts.append(
new Text(-28,-43,
"0", QPen::darkBlue, 12.0));
84 Texts.append(
new Text(-28,-23,
"1", QPen::darkBlue, 12.0));
86 Texts.append(
new Text( 15,-63,
"0", QPen::darkBlue, 12.0));
87 Texts.append(
new Text( 15,-43,
"1", QPen::darkBlue, 12.0));
88 Texts.append(
new Text( 15,-23,
"2", QPen::darkBlue, 12.0));
89 Texts.append(
new Text( 15, -3,
"3", QPen::darkBlue, 12.0));
91 Lines.append(
new Line(0, -18, 12, -18, QPen(QPen::darkBlue,2)));
109 QString td =
Props.at(1)->Value;
113 QString En =
Ports.at(0)->Connection->Name;
114 QString
A =
Ports.at(1)->Connection->Name;
115 QString
B =
Ports.at(2)->Connection->Name;
116 QString
Y3 =
Ports.at(3)->Connection->Name;
117 QString
Y2 =
Ports.at(4)->Connection->Name;
118 QString
Y1 =
Ports.at(5)->Connection->Name;
119 QString
Y0 =
Ports.at(6)->Connection->Name;
121 s =
"\n "+
Name+
":process ("+En+
", "+A+
", "+B+
")\n"+
123 " "+Y0+
" <= "+
"(not "+En+
") and (not "+B+
") and (not "+A+
")"+td+
124 " "+Y1+
" <= "+
"(not "+En+
") and (not "+B+
") and "+A+td+
125 " "+Y2+
" <= "+
"(not "+En+
") and "+B+
" and (not "+A+
")"+td+
126 " "+Y3+
" <= "+
"(not "+En+
") and "+B+
" and "+A+td+
133 QString td =
Props.at(1)->Value;
138 QString En =
Ports.at(0)->Connection->Name;
139 QString
A =
Ports.at(1)->Connection->Name;
140 QString
B =
Ports.at(2)->Connection->Name;
141 QString
Y3 =
Ports.at(3)->Connection->Name;
142 QString
Y2 =
Ports.at(4)->Connection->Name;
143 QString
Y1 =
Ports.at(5)->Connection->Name;
144 QString
Y0 =
Ports.at(6)->Connection->Name;
146 QString Y3R =
"net_reg" +
Name +
Y3;
147 QString Y2R =
"net_reg" +
Name +
Y2;
148 QString Y1R =
"net_reg" +
Name +
Y1;
149 QString Y0R =
"net_reg" +
Name +
Y0;
151 l =
"\n // " +
Name +
" 2to4 demux\n" +
152 " assign " + Y0 +
" = " + Y0R +
";\n" +
153 " reg " + Y0R +
" = 0;\n" +
154 " assign " + Y1 +
" = " + Y1R +
";\n" +
155 " reg " + Y1R +
" = 0;\n" +
156 " assign " + Y2 +
" = " + Y2R +
";\n" +
157 " reg " + Y2R +
" = 0;\n" +
158 " assign " + Y3 +
" = " + Y3R +
";\n" +
159 " reg " + Y3R +
" = 0;\n" +
161 " always @ ("+En+
" or "+A+
" or "+B+
")\n" +
163 " "+Y0R+
" <="+td+
" (~"+En+
") && (~"+B+
") && (~"+A+
")"+
";\n" +
164 " "+Y1R+
" <="+td+
" (~"+En+
") && (~"+B+
") && ("+A+
")"+
";\n" +
165 " "+Y2R+
" <="+td+
" (~"+En+
") && ("+B+
") && (~"+A+
")"+
";\n" +
166 " "+Y3R+
" <="+td+
" (~"+En+
") && ("+B+
") && ("+A+
")"+
";\n" +