27 Description = QObject::tr(
"JK flip flop with asynchron set and reset");
29 Props.append(
new Property(
"t",
"0",
false, QObject::tr(
"delay time")));
31 Lines.append(
new Line(-20,-30, 20,-30,QPen(Qt::darkBlue,2)));
32 Lines.append(
new Line(-20, 30, 20, 30,QPen(Qt::darkBlue,2)));
33 Lines.append(
new Line(-20,-30,-20, 30,QPen(Qt::darkBlue,2)));
34 Lines.append(
new Line( 20,-30, 20, 30,QPen(Qt::darkBlue,2)));
36 Lines.append(
new Line(-30,-20,-20,-20,QPen(Qt::darkBlue,2)));
37 Lines.append(
new Line(-30, 20,-20, 20,QPen(Qt::darkBlue,2)));
38 Lines.append(
new Line( 30,-20, 20,-20,QPen(Qt::darkBlue,2)));
39 Lines.append(
new Line( 30, 20, 20, 20,QPen(Qt::darkBlue,2)));
40 Lines.append(
new Line(-30, 0,-20, 0,QPen(Qt::darkBlue,2)));
41 Lines.append(
new Line( 0,-30, 0,-40,QPen(Qt::darkBlue,2)));
42 Lines.append(
new Line( 0, 30, 0, 40,QPen(Qt::darkBlue,2)));
44 Texts.append(
new Text( -4,-29,
"S", Qt::darkBlue, 9.0));
45 Texts.append(
new Text( -4, 14,
"R", Qt::darkBlue, 9.0));
46 Texts.append(
new Text(-18,-31,
"J", Qt::darkBlue, 12.0));
47 Texts.append(
new Text(-18, 8,
"K", Qt::darkBlue, 12.0));
48 Texts.append(
new Text( 6,-31,
"Q", Qt::darkBlue, 12.0));
49 Texts.append(
new Text( 6, 8,
"Q", Qt::darkBlue, 12.0));
50 Texts.current()->over=
true;
51 Lines.append(
new Line(-20, -4,-12, 0,QPen(Qt::darkBlue,0)));
52 Lines.append(
new Line(-20, 4,-12, 0,QPen(Qt::darkBlue,0)));
75 QString td =
Props.at(0)->Value;
81 s =
" " +
Name +
" : process (" +
82 Ports.at(5)->Connection->Name +
", " +
83 Ports.at(6)->Connection->Name +
", " +
84 Ports.at(4)->Connection->Name +
")\n begin\n if (" +
85 Ports.at(6)->Connection->Name +
"='1') then " +
86 Ports.at(2)->Connection->Name +
" <= '0'" + s +
" elsif (" +
87 Ports.at(5)->Connection->Name +
"='1') then " +
88 Ports.at(2)->Connection->Name +
" <= '1'" + s +
" elsif (" +
89 Ports.at(4)->Connection->Name +
"='1' and " +
90 Ports.at(4)->Connection->Name +
"'event) then\n " +
91 Ports.at(2)->Connection->Name +
" <= (" +
92 Ports.at(0)->Connection->Name +
" and not " +
93 Ports.at(2)->Connection->Name +
") or (not " +
94 Ports.at(1)->Connection->Name +
" and " +
95 Ports.at(2)->Connection->Name +
")" + s +
96 " end if;\n end process;\n " +
97 Ports.at(3)->Connection->Name +
" <= not " +
98 Ports.at(2)->Connection->Name +
";\n\n";
107 QString td =
Props.at(0)->Value;
109 if(!td.isEmpty()) t =
" " + td +
";\n";
114 QString s =
Ports.at(5)->Connection->Name;
115 QString r =
Ports.at(6)->Connection->Name;
116 QString j =
Ports.at(0)->Connection->Name;
117 QString k =
Ports.at(1)->Connection->Name;
118 QString q =
Ports.at(2)->Connection->Name;
119 QString b =
Ports.at(3)->Connection->Name;
120 QString c =
Ports.at(4)->Connection->Name;
121 QString v =
"net_reg" +
Name + q;
123 l =
"\n // " +
Name +
" JK-flipflop\n" +
124 " assign " + q +
" = " + v +
";\n" +
125 " assign " + b +
" = ~" + q +
";\n" +
126 " reg " + v +
" = 0;\n" +
127 " always @ (" + c +
" or " + r +
" or " + s +
") begin\n" + t +
128 " if (" + r +
") " + v +
" <= 0;\n" +
129 " else if (" + s +
") " + v +
" <= 1;\n" +
130 " else if (" + c +
")\n" +
131 " " + v +
" <= (" + j +
" && ~" + q +
") || (~" +
132 k +
" && " + q +
");\n" +
146 Name = QObject::tr(
"JK-FlipFlop");
147 BitmapFile = (
char *)
"jkflipflop";
bool VHDL_Delay(QString &td, const QString &Name)
#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.
static Element * info(QString &, char *&, bool getNewOne=false)