26 Description = QObject::tr (
"4bit binary to grey converter verilog device");
29 QObject::tr (
"transfer function scaling factor")));
31 QObject::tr (
"output delay")
32 +
" ("+QObject::tr (
"s")+
")"));
37 Model =
"binarytogrey4bit";
44 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
51 Name = QObject::tr(
"4Bit Bin2Grey");
52 BitmapFile = (
char *)
"binarytogrey4bit";
60 Lines.append(
new Line(-30, -60, 30,-60,QPen(Qt::darkBlue,2)));
61 Lines.append(
new Line( 30, -60, 30, 40,QPen(Qt::darkBlue,2)));
62 Lines.append(
new Line( 30, 40,-30, 40,QPen(Qt::darkBlue,2)));
63 Lines.append(
new Line(-30, 40,-30, -60,QPen(Qt::darkBlue,2)));
65 Lines.append(
new Line(-50,-30,-30,-30,QPen(Qt::darkBlue,2)));
66 Lines.append(
new Line(-50,-10,-30,-10,QPen(Qt::darkBlue,2)));
67 Lines.append(
new Line(-50, 10,-30, 10,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line(-50, 30,-30, 30,QPen(Qt::darkBlue,2)));
70 Lines.append(
new Line( 30, 30, 50, 30,QPen(Qt::darkBlue,2)));
71 Lines.append(
new Line( 30, 10, 50, 10,QPen(Qt::darkBlue,2)));
72 Lines.append(
new Line( 30,-10, 50,-10,QPen(Qt::darkBlue,2)));
73 Lines.append(
new Line( 30,-30, 50,-30,QPen(Qt::darkBlue,2)));
75 Texts.append(
new Text(-16,-59,
"B", Qt::darkBlue, 12.0));
76 Texts.append(
new Text( -2,-59,
"/", Qt::darkBlue, 12.0));
77 Texts.append(
new Text( 5,-59,
"G", Qt::darkBlue, 12.0));
79 Texts.append(
new Text(-25,-43,
"0", Qt::darkBlue, 12.0));
80 Texts.append(
new Text(-25,-23,
"1", Qt::darkBlue, 12.0));
81 Texts.append(
new Text(-25, -3,
"2", Qt::darkBlue, 12.0));
82 Texts.append(
new Text(-25, 17,
"3", Qt::darkBlue, 12.0));
84 Texts.append(
new Text( 15,-43,
"0", Qt::darkBlue, 12.0));
85 Texts.append(
new Text( 15,-23,
"1", Qt::darkBlue, 12.0));
86 Texts.append(
new Text( 15, -3,
"2", Qt::darkBlue, 12.0));
87 Texts.append(
new Text( 15, 17,
"3", Qt::darkBlue, 12.0));
107 QString td =
Props.at(1)->Value;
111 QString B0 =
Ports.at(0)->Connection->Name;
112 QString B1 =
Ports.at(1)->Connection->Name;
113 QString B2 =
Ports.at(2)->Connection->Name;
114 QString B3 =
Ports.at(3)->Connection->Name;
115 QString G3 =
Ports.at(4)->Connection->Name;
116 QString G2 =
Ports.at(5)->Connection->Name;
117 QString G1 =
Ports.at(6)->Connection->Name;
118 QString G0 =
Ports.at(7)->Connection->Name;
121 s =
"\n "+
Name +
":process ("+B0+
", "+B1+
", "+B2+
", "+B3+
")\n" +
123 " "+G0+
" <= "+B0+
" xor "+B1+td+
124 " "+G1+
" <= "+B1+
" xor "+B2+td+
125 " "+G2+
" <= "+B2+
" xor "+B3+td+
133 QString td =
Props.at(1)->Value;
136 QString B0 =
Ports.at(0)->Connection->Name;
137 QString B1 =
Ports.at(1)->Connection->Name;
138 QString B2 =
Ports.at(2)->Connection->Name;
139 QString B3 =
Ports.at(3)->Connection->Name;
140 QString G3 =
Ports.at(4)->Connection->Name;
141 QString G2 =
Ports.at(5)->Connection->Name;
142 QString G1 =
Ports.at(6)->Connection->Name;
143 QString G0 =
Ports.at(7)->Connection->Name;
147 QString G0R =
"net_reg" +
Name + G0;
148 QString G1R =
"net_reg" +
Name + G1;
149 QString G2R =
"net_reg" +
Name + G2;
150 QString G3R =
"net_reg" +
Name + G3;
152 l =
"\n // " +
Name +
" 4bit binary to grey\n" +
153 " assign " + G0 +
" = " + G0R +
";\n" +
154 " reg " + G0R +
" = 0;\n" +
155 " assign " + G1 +
" = " + G1R +
";\n" +
156 " reg " + G1R +
" = 0;\n" +
157 " assign " + G2 +
" = " + G2R +
";\n" +
158 " reg " + G2R +
" = 0;\n" +
159 " assign " + G3 +
" = " + G3R +
";\n" +
160 " reg " + G3R +
" = 0;\n" +
161 " always @ ("+B0+
" or "+B1+
" or "+B2+
" or "+B3+
")\n" +
163 " "+G0R+
" <="+td+
" "+B0+
" ^ "+B1+
";\n"+
164 " "+G1R+
" <="+td+
" "+B1+
" ^ "+B2+
";\n"+
165 " "+G2R+
" <="+td+
" "+B2+
" ^ "+B3+
";\n"+
166 " "+G3R+
" <="+td+
" "+B3+
";\n"+
bool VHDL_Delay(QString &td, const QString &Name)
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
static Element * info(QString &, char *&, bool getNewOne=false)
Superclass of all schematic drawing elements.
virtual void recreate(Schematic *)