26 Description = QObject::tr (
"1bit half 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 HalfAdder");
52 BitmapFile = (
char *)
"ha1b";
54 if(getNewOne)
return new ha1b();
60 Lines.append(
new Line(-30, -40, 30,-40,QPen(Qt::darkBlue,2)));
61 Lines.append(
new Line( 30, -40, 30, 30,QPen(Qt::darkBlue,2)));
62 Lines.append(
new Line( 30, 30,-30, 30,QPen(Qt::darkBlue,2)));
63 Lines.append(
new Line(-30, 30,-30,-40,QPen(Qt::darkBlue,2)));
65 Lines.append(
new Line(-50,-10,-30,-10,QPen(Qt::darkBlue,2)));
66 Lines.append(
new Line(-50, 10,-30, 10,QPen(Qt::darkBlue,2)));
67 Lines.append(
new Line( 30, 10, 50, 10,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line( 30,-10, 50,-10,QPen(Qt::darkBlue,2)));
70 Texts.append(
new Text(0, -3,
"CO", Qt::darkBlue, 12.0));
72 Lines.append(
new Line(-10,-35, 10, -35, QPen(Qt::darkBlue,2)));
73 Lines.append(
new Line(-10,-35, 5, -25, QPen(Qt::darkBlue,2)));
74 Lines.append(
new Line( 5,-25,-10, -15, QPen(Qt::darkBlue,2)));
75 Lines.append(
new Line(-10,-15, 10, -15, QPen(Qt::darkBlue,2)));
90 QString td =
Props.at(1)->Value;
94 QString A =
Ports.at(0)->Connection->Name;
95 QString B =
Ports.at(1)->Connection->Name;
96 QString CO =
Ports.at(2)->Connection->Name;
97 QString S =
Ports.at(3)->Connection->Name;
99 s =
"\n " +
Name +
":process (" + A +
", " + B +
")\n" +
101 " " + CO +
" <= " + A +
" and " + B + td +
102 " " + S +
" <= " + A +
" xor " + B + td +
109 QString td =
Props.at(1)->Value;
114 QString A =
Ports.at(0)->Connection->Name;
115 QString B =
Ports.at(1)->Connection->Name;
116 QString CO =
Ports.at(2)->Connection->Name;
117 QString S =
Ports.at(3)->Connection->Name;
119 QString COR =
"CO_reg" +
Name + CO;
120 QString SR =
"S_reg" +
Name + S;
122 l =
"\n // " +
Name +
" 1bit halfadder\n" +
123 " assign " + CO +
" = " + COR +
";\n" +
124 " reg " + COR +
" = 0;\n" +
125 " assign " + S +
" = " + SR +
";\n" +
126 " reg " + SR +
" = 0;\n" +
127 " always @ ("+ A +
" or " + B +
")\n" +
129 " " + COR +
" <=" + td +
" (" + A +
" && " + B +
");\n" +
130 " " + SR +
" <=" + td +
" (" + A +
" ^ " + B +
");\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
Superclass of all schematic drawing elements.
static Element * info(QString &, char *&, bool getNewOne=false)
virtual void recreate(Schematic *)