25 Description = QObject::tr(
"D flip flop with asynchron reset");
27 Props.append(
new Property(
"t",
"0",
false, QObject::tr(
"delay time")));
29 Lines.append(
new Line(-20,-20, 20,-20,QPen(Qt::darkBlue,2)));
30 Lines.append(
new Line(-20, 20, 20, 20,QPen(Qt::darkBlue,2)));
31 Lines.append(
new Line(-20,-20,-20, 20,QPen(Qt::darkBlue,2)));
32 Lines.append(
new Line( 20,-20, 20, 20,QPen(Qt::darkBlue,2)));
34 Lines.append(
new Line(-30,-10,-20,-10,QPen(Qt::darkBlue,2)));
35 Lines.append(
new Line(-30, 10,-20, 10,QPen(Qt::darkBlue,2)));
36 Lines.append(
new Line( 30,-10, 20,-10,QPen(Qt::darkBlue,2)));
37 Lines.append(
new Line( 0, 20, 0, 30,QPen(Qt::darkBlue,2)));
39 Texts.append(
new Text(-18,-21,
"D", Qt::darkBlue, 12.0));
40 Texts.append(
new Text( 6,-21,
"Q", Qt::darkBlue, 12.0));
41 Texts.append(
new Text( -4, 4,
"R", Qt::darkBlue, 9.0));
42 Lines.append(
new Line(-20, 6,-12, 10,QPen(Qt::darkBlue,0)));
43 Lines.append(
new Line(-20, 14,-12, 10,QPen(Qt::darkBlue,0)));
63 QString td =
Props.at(0)->Value;
69 s =
" " +
Name +
" : process (" +
70 Ports.at(0)->Connection->Name +
", " +
71 Ports.at(1)->Connection->Name +
")\n begin\n if (" +
72 Ports.at(3)->Connection->Name +
"='1') then " +
73 Ports.at(2)->Connection->Name +
" <= '0'" + s +
" elsif (" +
74 Ports.at(1)->Connection->Name +
"='1' and " +
75 Ports.at(1)->Connection->Name +
"'event) then\n " +
76 Ports.at(2)->Connection->Name +
" <= " +
77 Ports.at(0)->Connection->Name + s +
" end if;\n end process;\n\n";
86 QString td =
Props.at(0)->Value;
88 if(!td.isEmpty()) t =
" " + td +
";\n";
92 QString q =
Ports.at(2)->Connection->Name;
93 QString d =
Ports.at(0)->Connection->Name;
94 QString r =
Ports.at(3)->Connection->Name;
95 QString c =
Ports.at(1)->Connection->Name;
96 QString v =
"net_reg" +
Name + q;
98 s =
"\n // " +
Name +
" D-flipflop\n" +
99 " assign " + q +
" = " + v +
";\n" +
100 " reg " + v +
" = 0;\n" +
101 " always @ (" + c +
" or " + r +
") begin\n" + t +
102 " if (" + r +
") " + v +
" <= 0;\n" +
103 " else if (~" + r +
" && " + c +
") " + v +
" <= " + d +
";\n" +
117 Name = QObject::tr(
"D-FlipFlop");
118 BitmapFile = (
char *)
"dflipflop";
bool VHDL_Delay(QString &td, const QString &Name)
static Element * info(QString &, char *&, bool getNewOne=false)
#define isDigitalComponent
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.