26 Description = QObject::tr (
"1bit 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(
"1Bit FullAdder");
52 BitmapFile = (
char *)
"fa1b";
54 if(getNewOne)
return new fa1b();
60 Lines.append(
new Line(-30, -40, 30,-40,QPen(QPen::darkBlue,2)));
61 Lines.append(
new Line( 30, -40, 30, 50,QPen(QPen::darkBlue,2)));
62 Lines.append(
new Line( 30, 50,-30, 50,QPen(QPen::darkBlue,2)));
63 Lines.append(
new Line(-30, 50,-30,-40,QPen(QPen::darkBlue,2)));
65 Lines.append(
new Line(-50,-10,-30,-10,QPen(QPen::darkBlue,2)));
66 Lines.append(
new Line(-50, 10,-30, 10,QPen(QPen::darkBlue,2)));
67 Lines.append(
new Line(-50, 30,-30, 30,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)));
71 Texts.append(
new Text(-25, 17,
"CI", QPen::darkBlue, 12.0));
72 Texts.append(
new Text( 0, -3,
"CO", QPen::darkBlue, 12.0));
74 Lines.append(
new Line(-10,-35, 10, -35, QPen(QPen::darkBlue,2)));
75 Lines.append(
new Line(-10,-35, 5, -25, QPen(QPen::darkBlue,2)));
76 Lines.append(
new Line( 5,-25,-10, -15, QPen(QPen::darkBlue,2)));
77 Lines.append(
new Line(-10,-15, 10, -15, QPen(QPen::darkBlue,2)));
93 QString td =
Props.at(1)->Value;
97 QString
A =
Ports.at(0)->Connection->Name;
98 QString
B =
Ports.at(1)->Connection->Name;
99 QString
CI =
Ports.at(2)->Connection->Name;
100 QString
CO =
Ports.at(3)->Connection->Name;
101 QString
S =
Ports.at(4)->Connection->Name;
103 s =
"\n " +
Name +
":process (" + A +
", " + B +
", " + CI +
")\n" +
105 " " + CO +
" <= (" + A +
" and " + B +
") or (" + CI +
" and (" + A +
" xor " + B +
"))" + td +
106 " " + S +
" <= " + CI +
" xor " + A +
" xor " + B + td +
113 QString td =
Props.at(1)->Value;
118 QString
A =
Ports.at(0)->Connection->Name;
119 QString
B =
Ports.at(1)->Connection->Name;
120 QString
CI =
Ports.at(2)->Connection->Name;
121 QString
CO =
Ports.at(3)->Connection->Name;
122 QString
S =
Ports.at(4)->Connection->Name;
124 QString COR =
"CO_reg" +
Name +
CO;
125 QString SR =
"S_reg" +
Name +
S;
127 l =
"\n // " +
Name +
" 1bit fulladder\n" +
128 " assign " + CO +
" = " + COR +
";\n" +
129 " reg " + COR +
" = 0;\n" +
130 " assign " + S +
" = " + SR +
";\n" +
131 " reg " + SR +
" = 0;\n" +
132 " always @ ("+ A +
" or " + B +
" or " + CI +
")\n" +
134 " " + COR +
" <=" + td +
" (" + A +
" && " + B +
") || " + CI +
" && " +
"(" + A +
" ^ " + B +
");\n" +
135 " " + SR +
" <=" + td +
" (" + CI +
" ^ " + A +
" ^ " + B +
");\n" +