26 Description = QObject::tr (
"2bit full adder 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(
"2Bit FullAdder");
52 BitmapFile = (
char *)
"fa2b";
54 if(getNewOne)
return new fa2b();
60 Lines.append(
new Line(-40, -60, 40,-60,QPen(QPen::darkBlue,2)));
61 Lines.append(
new Line( 40, -60, 40, 90,QPen(QPen::darkBlue,2)));
62 Lines.append(
new Line( 40, 90,-40, 90,QPen(QPen::darkBlue,2)));
63 Lines.append(
new Line(-40, 90,-40, -60,QPen(QPen::darkBlue,2)));
65 Lines.append(
new Line(-60,-10,-40,-10,QPen(QPen::darkBlue,2)));
66 Lines.append(
new Line(-60, 10,-40, 10,QPen(QPen::darkBlue,2)));
67 Lines.append(
new Line(-60, 30,-40, 30,QPen(QPen::darkBlue,2)));
68 Lines.append(
new Line(-60, 50,-40, 50,QPen(QPen::darkBlue,2)));
69 Lines.append(
new Line(-60, 70,-40, 70,QPen(QPen::darkBlue,2)));
71 Lines.append(
new Line( 40, 30, 60, 30,QPen(QPen::darkBlue,2)));
72 Lines.append(
new Line( 40, 10, 60, 10,QPen(QPen::darkBlue,2)));
73 Lines.append(
new Line( 40,-10, 60,-10,QPen(QPen::darkBlue,2)));
75 Lines.append(
new Line( -10, -55, 10, -55, QPen(QPen::darkBlue,2)));
76 Lines.append(
new Line( -10, -55, 0, -45, QPen(QPen::darkBlue,2)));
77 Lines.append(
new Line( 0, -45,-10, -35, QPen(QPen::darkBlue,2)));
78 Lines.append(
new Line( -10, -35, 10, -35, QPen(QPen::darkBlue,2)));
80 Texts.append(
new Text(-25,-20,
"{", QPen::darkBlue, 16.0));
81 Texts.append(
new Text(-15,-13,
"X", QPen::darkBlue, 12.0));
82 Texts.append(
new Text(-35,-23,
"0", QPen::darkBlue, 12.0));
83 Texts.append(
new Text(-35, -3,
"1", QPen::darkBlue, 12.0));
84 Texts.append(
new Text(-25, 22,
"{", QPen::darkBlue, 16.0));
85 Texts.append(
new Text(-15, 29,
"Y", QPen::darkBlue, 12.0));
86 Texts.append(
new Text(-35, 17,
"0", QPen::darkBlue, 12.0));
87 Texts.append(
new Text(-35, 37,
"1", QPen::darkBlue, 12.0));
88 Texts.append(
new Text(-35, 57,
"CI", QPen::darkBlue, 12.0));
89 Texts.append(
new Text( 17,-20,
"}", QPen::darkBlue, 16.0));
90 Texts.append(
new Text( 3, -13,
"S", QPen::darkBlue, 12.0));
91 Texts.append(
new Text( 28,-23,
"0", QPen::darkBlue, 12.0));
92 Texts.append(
new Text( 28, -3,
"1", QPen::darkBlue, 12.0));
93 Texts.append(
new Text( 10, 17,
"CO", QPen::darkBlue, 12.0));
112 QString td =
Props.at(1)->Value;
116 QString
D =
Ports.at(0)->Connection->Name;
117 QString
C =
Ports.at(1)->Connection->Name;
118 QString
B =
Ports.at(2)->Connection->Name;
119 QString
A =
Ports.at(3)->Connection->Name;
120 QString
E =
Ports.at(4)->Connection->Name;
121 QString
CO =
Ports.at(5)->Connection->Name;
122 QString
S1 =
Ports.at(6)->Connection->Name;
123 QString
S0 =
Ports.at(7)->Connection->Name;
125 s =
"\n "+
Name+
":process ("+A+
", "+B+
", "+C+
", "+D+
", "+E+
")\n"+
127 " "+CO+
" <= ("+A+
" and "+C+
") or (("+A+
" or "+C+
") and (("+B+
" and "+D+
") or ("+E+
" and "+B+
") or ("+E+
" and "+ D +
")))"+td+
128 " "+S1+
" <= (("+B+
" and "+D+
") or ("+E+
" and "+B+
") or ("+E+
" and "+D+
"))"+
" xor ("+A+
" xor "+C+
")"+td+
129 " "+S0+
" <= "+E+
" xor ("+B+
" xor "+D+
")"+td+
136 QString td =
Props.at(1)->Value;
141 QString
D =
Ports.at(0)->Connection->Name;
142 QString
C =
Ports.at(1)->Connection->Name;
143 QString
B =
Ports.at(2)->Connection->Name;
144 QString
A =
Ports.at(3)->Connection->Name;
145 QString
E =
Ports.at(4)->Connection->Name;
146 QString
CO =
Ports.at(5)->Connection->Name;
147 QString
S1 =
Ports.at(6)->Connection->Name;
148 QString
S0 =
Ports.at(7)->Connection->Name;
150 QString COR =
"CO_reg" +
Name +
CO;
151 QString S1R =
"S1_reg" +
Name +
S1;
152 QString S0R =
"S0_reg" +
Name +
S0;
154 l =
"\n // "+
Name+
" 2bit fulladder\n"+
155 " assign "+CO+
" = "+COR+
";\n"+
156 " reg "+COR+
" = 0;\n"+
157 " assign "+S1+
" = "+S1R+
";\n"+
158 " reg "+S1R+
" = 0;\n"+
159 " assign "+S0+
" = "+S0R+
";\n"+
160 " reg "+S0R+
" = 0;\n"+
161 " always @ ("+A+
" or "+B+
" or "+C+
" or "+D+
" or "+E+
")\n"+
163 " " +COR+
" <="+td+
" ("+A+
" && "+C+
") || ("+A+
" || "+C+
") && ("+B+
" && "+D+
" || "+E+
" && "+B+
" || "+E+
" && "+D+
");\n"+
164 " " +S1R+
" <="+td+
" ("+B+
" && "+D+
" || "+E+
" && "+B+
" || "+E+
" && "+D+
") ^ ("+A+
" ^ "+C+
");\n" +
165 " " +S0R+
" <="+td+
" "+E+
" ^ ("+B+
" ^ "+D+
");\n"+