Help: set the converter xinclude aware 91/11991/4
Clément DAVID [Fri, 12 Jul 2013 11:37:33 +0000 (13:37 +0200)]
Use JKFLIPFLOP Xcos block as an example.

Change-Id: Ie7fdda54a13f32275dba945e2eb4f3c9e3c1ae42

26 files changed:
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/JKFLIPFLOP_content_1.png [new file with mode: 0644]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_1.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_1.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_10.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_10.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_11.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_11.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_12.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_12.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_13.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_13.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_14.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_14.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_15.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_15.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_16.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_16.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_17.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_17.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_18.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_18.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_19.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_19.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_2.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_2.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_20.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_20.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_3.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_3.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_4.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_4.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_5.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_5.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_6.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_6.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_7.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_7.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_8.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_8.png with 100% similarity]
scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP_content.dbk_9.png [moved from scilab/modules/helptools/images/_LaTeX_JKFLIPFLOP.xml_9.png with 100% similarity]
scilab/modules/helptools/src/java/org/scilab/modules/helptools/DocbookTagConverter.java
scilab/modules/helptools/src/java/org/scilab/modules/helptools/HTMLDocbookLinkResolver.java
scilab/modules/xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP.xml
scilab/modules/xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk [new file with mode: 0644]

index 1809a92..75b0f43 100644 (file)
@@ -128,7 +128,7 @@ INTEGRAL_m_1.png=819a0959f064d7afdfb7cc858016a945
 INTEGRAL_m_2.png=8ac71675d74bdfb8aa5a5b79397749d3
 INTRPLBLK_f_1.png=33cb18a7088876691af4f5917a228ae0
 IN_f_1.png=14ebefc5c6f0a4168285be7f53de873e
-JKFLIPFLOP_1.png=41633bba65cdd898d6d40657e606618f
+JKFLIPFLOP_content_1.png=41633bba65cdd898d6d40657e606618f
 LOGIC_1.png=fedbff23681192420b1d1b2780d716a3
 LOGIC_fr_FR_1.png=61b39bb2fa0f137d7cdc7f857f1e1de9
 LineSpec_1.png=3865808691b21c492ceb231a78009863
@@ -274,26 +274,26 @@ _LaTeX_GENSQR_f.xml_2.png=aa318bdb2a27d84eca5689f9e78acaaf
 _LaTeX_GENSQR_f.xml_3.png=b6e19724204b26861523de89ac4da149
 _LaTeX_GENSQR_f.xml_4.png=aa318bdb2a27d84eca5689f9e78acaaf
 _LaTeX_INTRPLBLK_f.xml_1.png=82f1018ad624f54faa176b27fa4f92fd
-_LaTeX_JKFLIPFLOP.xml_1.png=268c8a111a4f0706e82e926c47212724
-_LaTeX_JKFLIPFLOP.xml_10.png=c4ca4238a0b923820dcc509a6f75849b
-_LaTeX_JKFLIPFLOP.xml_11.png=cfcd208495d565ef66e7dff9f98764da
-_LaTeX_JKFLIPFLOP.xml_12.png=c4ca4238a0b923820dcc509a6f75849b
-_LaTeX_JKFLIPFLOP.xml_13.png=c4ca4238a0b923820dcc509a6f75849b
-_LaTeX_JKFLIPFLOP.xml_14.png=cfcd208495d565ef66e7dff9f98764da
-_LaTeX_JKFLIPFLOP.xml_15.png=c4ca4238a0b923820dcc509a6f75849b
-_LaTeX_JKFLIPFLOP.xml_16.png=cfcd208495d565ef66e7dff9f98764da
-_LaTeX_JKFLIPFLOP.xml_17.png=c4ca4238a0b923820dcc509a6f75849b
-_LaTeX_JKFLIPFLOP.xml_18.png=c4ca4238a0b923820dcc509a6f75849b
-_LaTeX_JKFLIPFLOP.xml_19.png=574c44a7bfd9f5229484328e422c48d7
-_LaTeX_JKFLIPFLOP.xml_2.png=dfaca0f8aad55df388e07eeb190a086
-_LaTeX_JKFLIPFLOP.xml_20.png=ec9e5c721c4fcc0e2d249a1973ff64d4
-_LaTeX_JKFLIPFLOP.xml_3.png=4aad400c526ad874538c8881c19bf2f1
-_LaTeX_JKFLIPFLOP.xml_4.png=621990decae739107d16ea4303773252
-_LaTeX_JKFLIPFLOP.xml_5.png=cfcd208495d565ef66e7dff9f98764da
-_LaTeX_JKFLIPFLOP.xml_6.png=cfcd208495d565ef66e7dff9f98764da
-_LaTeX_JKFLIPFLOP.xml_7.png=ec9e5c721c4fcc0e2d249a1973ff64d4
-_LaTeX_JKFLIPFLOP.xml_8.png=574c44a7bfd9f5229484328e422c48d7
-_LaTeX_JKFLIPFLOP.xml_9.png=cfcd208495d565ef66e7dff9f98764da
+_LaTeX_JKFLIPFLOP_content.dbk_1.png=268c8a111a4f0706e82e926c47212724
+_LaTeX_JKFLIPFLOP_content.dbk_10.png=c4ca4238a0b923820dcc509a6f75849b
+_LaTeX_JKFLIPFLOP_content.dbk_11.png=cfcd208495d565ef66e7dff9f98764da
+_LaTeX_JKFLIPFLOP_content.dbk_12.png=c4ca4238a0b923820dcc509a6f75849b
+_LaTeX_JKFLIPFLOP_content.dbk_13.png=c4ca4238a0b923820dcc509a6f75849b
+_LaTeX_JKFLIPFLOP_content.dbk_14.png=cfcd208495d565ef66e7dff9f98764da
+_LaTeX_JKFLIPFLOP_content.dbk_15.png=c4ca4238a0b923820dcc509a6f75849b
+_LaTeX_JKFLIPFLOP_content.dbk_16.png=cfcd208495d565ef66e7dff9f98764da
+_LaTeX_JKFLIPFLOP_content.dbk_17.png=c4ca4238a0b923820dcc509a6f75849b
+_LaTeX_JKFLIPFLOP_content.dbk_18.png=c4ca4238a0b923820dcc509a6f75849b
+_LaTeX_JKFLIPFLOP_content.dbk_19.png=574c44a7bfd9f5229484328e422c48d7
+_LaTeX_JKFLIPFLOP_content.dbk_2.png=dfaca0f8aad55df388e07eeb190a086
+_LaTeX_JKFLIPFLOP_content.dbk_20.png=ec9e5c721c4fcc0e2d249a1973ff64d4
+_LaTeX_JKFLIPFLOP_content.dbk_3.png=4aad400c526ad874538c8881c19bf2f1
+_LaTeX_JKFLIPFLOP_content.dbk_4.png=621990decae739107d16ea4303773252
+_LaTeX_JKFLIPFLOP_content.dbk_5.png=cfcd208495d565ef66e7dff9f98764da
+_LaTeX_JKFLIPFLOP_content.dbk_6.png=cfcd208495d565ef66e7dff9f98764da
+_LaTeX_JKFLIPFLOP_content.dbk_7.png=ec9e5c721c4fcc0e2d249a1973ff64d4
+_LaTeX_JKFLIPFLOP_content.dbk_8.png=574c44a7bfd9f5229484328e422c48d7
+_LaTeX_JKFLIPFLOP_content.dbk_9.png=cfcd208495d565ef66e7dff9f98764da
 _LaTeX_LOGIC.xml_1.png=e19cac88e786393f792adb75013e7d0a
 _LaTeX_LOGIC.xml_fr_FR_1.png=bf10ac30d0fee3333d2dae9f5f8c1b33
 _LaTeX_RAMP.xml_1.png=c851aba90cb36bc4a4d869245c01a167
diff --git a/scilab/modules/helptools/images/JKFLIPFLOP_content_1.png b/scilab/modules/helptools/images/JKFLIPFLOP_content_1.png
new file mode 100644 (file)
index 0000000..114e4b9
Binary files /dev/null and b/scilab/modules/helptools/images/JKFLIPFLOP_content_1.png differ
index 62c49cd..c997d09 100644 (file)
@@ -219,6 +219,7 @@ public class DocbookTagConverter extends DefaultHandler {
         SAXParserFactory factory = SAXParserFactory.newInstance();
         factory.setValidating(false);
         factory.setNamespaceAware(true);
+        factory.setXIncludeAware(true);
 
         try {
             factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
index 84c3c93..48496e7 100644 (file)
@@ -290,6 +290,7 @@ public class HTMLDocbookLinkResolver extends DefaultHandler {
         SAXParserFactory factory = SAXParserFactory.newInstance();
         factory.setValidating(false);
         factory.setNamespaceAware(true);
+        factory.setXIncludeAware(true);
 
         try {
             SAXParser parser = factory.newSAXParser();
index 520fad8..16770b6 100644 (file)
  * 
  * See the file ./license.txt
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="JKFLIPFLOP" xmln.mml="http://www.w3.org/1998/Math/MathML">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="JKFLIPFLOP" xmln.mml="http://www.w3.org/1998/Math/MathML">
     <refnamediv>
         <refname>JKFLIPFLOP</refname>
-        <refpurpose>JK flip-flop</refpurpose>
+        <xi:include href="../xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk" xpointer="element(/1/1/2)"/>
     </refnamediv>
     <refsection>
         <title>Block Screenshot</title>
                     </listitem>
                     <listitem>
                         <para>
-                            <xref linkend="Data_Type_JKFLIPFLOP">Data types</xref>
-                        </para>
-                    </listitem>
-                    <listitem>
-                        <para>
                             <xref linkend="Dialogbox_JKFLIPFLOP">Dialog box</xref>
                         </para>
                     </listitem>
@@ -74,7 +69,7 @@
                     </listitem>
                     <listitem>
                         <para>
-                            <xref linkend="Example_JKFLIPFLOP">Example</xref>
+                            <xref linkend="Examples_JKFLIPFLOP">Examples</xref>
                         </para>
                     </listitem>
                     <listitem>
             </listitem>
         </itemizedlist>
     </refsection>
-    <refsection id="Description_JKFLIPFLOP">
-        <title>Description</title>
-        <para>
-            The JK flip flop is the most versatile of the basic flip-flops. It has two inputs traditionally labeled
-            <emphasis role="bold">J</emphasis> (Set) and <emphasis role="bold">K</emphasis> (Reset).
-        </para>
-        <itemizedlist>
-            <listitem>
-                <para>
-                    When the inputs  <emphasis role="bold">J</emphasis> and <emphasis role="bold">K</emphasis>
-                    are different, the output <emphasis role="bold">Q</emphasis> takes the value of
-                    <emphasis role="bold">J</emphasis> at the next falling edge.
-                </para>
-                <para/>
-            </listitem>
-            <listitem>
-                <para>
-                    When the inputs <emphasis role="bold">J</emphasis> and <emphasis role="bold">K</emphasis> are both low, no change occurs in the output state.
-                </para>
-                <para/>
-            </listitem>
-            <listitem>
-                <para>
-                    When the inputs are both high the output <emphasis role="bold">Q</emphasis> will toggle from
-                    one state to other. It can perform the functions of the set/reset (SR) flip-flop and has the advantage that there are no ambiguous states.
-                </para>
-            </listitem>
-        </itemizedlist>
-        <para>
-            The <emphasis role="bold">!Q</emphasis> output is the logical negation of <emphasis role="bold">Q</emphasis>
-        </para>
-        <para>
-            It can also act as a T flip-flop to accomplish toggling action if <emphasis role="bold">J</emphasis>
-            and <emphasis role="bold">K</emphasis> are tied together. This toggle application finds extensive use
-            in binary counters.
-        </para>
-        <para>
-            The user can set the initial output state with <emphasis role="bold">Initial Value</emphasis>
-            parameter.
-        </para>
-        <para> The truth table of this block is:</para>
-        <para/>
-        <informaltable border="1" cellpadding="3">
-            <tr>
-                <td align="left">
-                    <latex><![CDATA[\boldsymbol{J}]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[\boldsymbol{K}]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[\boldsymbol{Q_n}]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[\boldsymbol{!Q_n}]]></latex>
-                </td>
-                <td align="left"/>
-            </tr>
-            <tr>
-                <td align="left">
-                    <latex><![CDATA[0]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[0]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[Q_{n-1}]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[!Q_{n-1}]]></latex>
-                </td>
-                <td align="left">Hold</td>
-            </tr>
-            <tr>
-                <td align="left">
-                    <latex><![CDATA[0]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[1]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[0]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[1]]></latex>
-                </td>
-                <td align="left">Reset</td>
-            </tr>
-            <tr>
-                <td align="left">
-                    <latex><![CDATA[1]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[0]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[1]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[0]]></latex>
-                </td>
-                <td align="left">Set</td>
-            </tr>
-            <tr>
-                <td align="left">
-                    <latex><![CDATA[1]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[1]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[!Q_{n-1}]]></latex>
-                </td>
-                <td align="left">
-                    <latex><![CDATA[Q_{n-1}]]></latex>
-                </td>
-                <td align="left">Toggle</td>
-            </tr>
-        </informaltable>
-        <para>
-            where 
-            <emphasis><literal>
-                    Q<subscript>n-1</subscript>
-                </literal>
-            </emphasis>
-            is the previous state of
-            <emphasis><literal>
-                    Q<subscript>n</subscript>
-                </literal>
-            </emphasis>
-            .
-        </para>
-    </refsection>
-    <refsection id="Data_Type_JKFLIPFLOP">
-        <title>Data types</title>
-        <para>
-            The block supports the following types :
-        </para>
-        <itemizedlist>
-            <listitem>
-                <para>
-                    Inputs:
-                </para>
-                <itemizedlist>
-                    <listitem>
-                        <para>
-                            <emphasis role="bold">J</emphasis>: scalar. Scilab's int8 data type only.
-                        </para>
-                    </listitem>
-                    <listitem>
-                        <para>
-                            <emphasis role="bold">clk</emphasis>: scalar. Scilab's real double.
-                        </para>
-                    </listitem>
-                    <listitem>
-                        <para>
-                            <emphasis role="bold">K</emphasis>: scalar. Scilab's int8 data type only.
-                        </para>
-                    </listitem>
-                </itemizedlist>
-                <para>
-                    A positive input is considered as logical 1, a negative or a null input as logical 0.
-                </para>
-                <para/>
-            </listitem>
-            <listitem>
-                <para>
-                    Outputs: scalar. Scilab's int8 data type.
-                </para>
-            </listitem>
-        </itemizedlist>
-    </refsection>
+    <xi:include href="../xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk" xpointer="element(/1/2)"/>
     <refsection id="Dialogbox_JKFLIPFLOP">
         <title>Dialog box</title>
         <para>
             </listitem>
         </itemizedlist>
     </refsection>
-    <refsection id="Example_JKFLIPFLOP">
-        <title>Example</title>
-        <para>
-            The following example builds a 3 bits asynchronous counter with JK flipflops wired as T flipflops. You can show on the
-            right the timing diagram of the 
-            <emphasis><literal>
-                    Q<subscript>0</subscript>
-                </literal>
-            </emphasis>
-            to 
-            <emphasis><literal>
-                    Q<subscript>2</subscript>
-                </literal>
-            </emphasis>
-            outputs of counter.
-            <link type="scilab" linkend="scilab.zcos/xcos/examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos">
-                Open this example in Xcos
-            </link>
-        </para>
-        <para/>
-        <para>
-            <link type="scilab" linkend="scilab.zcos/xcos/examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos">
-                <inlinemediaobject>
-                    <imageobject>
-                        <imagedata fileref="../../../../examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos" align="center" valign="middle"/>
-                    </imageobject>
-                </inlinemediaobject>
-            </link>
-            <scilab:image><![CDATA[
-importXcosDiagram(SCI + "/modules/xcos/examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos");
-xcos_simulate(scs_m, 4);
-]]></scilab:image>
-        </para>
-    </refsection>
+    <xi:include href="../xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk" xpointer="element(/1/3)"/>
     <refsection id="Interfacingfunction_JKFLIPFLOP">
         <title>Interfacing function</title>
         <itemizedlist>
@@ -420,18 +211,5 @@ xcos_simulate(scs_m, 4);
             </listitem>
         </itemizedlist>
     </refsection>
-    <refsection role="see also" id="Seealso_JKFLIPFLOP">
-        <title>See also</title>
-        <itemizedlist>
-            <listitem>
-                <link linkend="DLATCH">DLATCH</link>
-            </listitem>
-            <listitem>
-                <link linkend="DFLIPFLOP">DFLIPFLOP</link>
-            </listitem>
-            <listitem>
-                <link linkend="SRFLIPFLOP">SRFLIPFLOP</link>
-            </listitem>
-        </itemizedlist>
-    </refsection>
+    <xi:include href="../xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk" xpointer="element(/1/4)"/>
 </refentry>
diff --git a/scilab/modules/xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk b/scilab/modules/xcos/help/en_US/palettes/Integer_pal/JKFLIPFLOP_content.dbk
new file mode 100644 (file)
index 0000000..792528e
--- /dev/null
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Xcos
+ *
+ * Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
+ * Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
+ * Copyright 2011 - Bernard DUJARDIN <bernard.dujardin@contrib.scilab.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * 
+ * See the file ./license.txt
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xmln.mml="http://www.w3.org/1998/Math/MathML">
+    <refnamediv>
+        <refname>JKFLIPFLOP</refname>
+        <refpurpose id="Purpose_JKFLIPFLOP">JK flip-flop</refpurpose>
+    </refnamediv>
+    <refsection id="Description_JKFLIPFLOP">
+        <title>Description</title>
+        <para>
+            The JK flip flop is the most versatile of the basic flip-flops. It has two inputs traditionally labeled
+            <emphasis role="bold">J</emphasis> (Set) and <emphasis role="bold">K</emphasis> (Reset).
+        </para>
+        <itemizedlist>
+            <listitem>
+                <para>
+                    When the inputs  <emphasis role="bold">J</emphasis> and <emphasis role="bold">K</emphasis>
+                    are different, the output <emphasis role="bold">Q</emphasis> takes the value of
+                    <emphasis role="bold">J</emphasis> at the next falling edge.
+                </para>
+                <para/>
+            </listitem>
+            <listitem>
+                <para>
+                    When the inputs <emphasis role="bold">J</emphasis> and <emphasis role="bold">K</emphasis> are both low, no change occurs in the output state.
+                </para>
+                <para/>
+            </listitem>
+            <listitem>
+                <para>
+                    When the inputs are both high the output <emphasis role="bold">Q</emphasis> will toggle from
+                    one state to other. It can perform the functions of the set/reset (SR) flip-flop and has the advantage that there are no ambiguous states.
+                </para>
+            </listitem>
+        </itemizedlist>
+        <para>
+            The <emphasis role="bold">!Q</emphasis> output is the logical negation of <emphasis role="bold">Q</emphasis>
+        </para>
+        <para>
+            It can also act as a T flip-flop to accomplish toggling action if <emphasis role="bold">J</emphasis>
+            and <emphasis role="bold">K</emphasis> are tied together. This toggle application finds extensive use
+            in binary counters.
+        </para>
+        <para>
+            The user can set the initial output state with <emphasis role="bold">Initial Value</emphasis>
+            parameter.
+        </para>
+        <para> The truth table of this block is:</para>
+        <para/>
+        <informaltable border="1" cellpadding="3">
+            <tr>
+                <td align="left">
+                    <latex><![CDATA[\boldsymbol{J}]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[\boldsymbol{K}]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[\boldsymbol{Q_n}]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[\boldsymbol{!Q_n}]]></latex>
+                </td>
+                <td align="left"/>
+            </tr>
+            <tr>
+                <td align="left">
+                    <latex><![CDATA[0]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[0]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[Q_{n-1}]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[!Q_{n-1}]]></latex>
+                </td>
+                <td align="left">Hold</td>
+            </tr>
+            <tr>
+                <td align="left">
+                    <latex><![CDATA[0]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[1]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[0]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[1]]></latex>
+                </td>
+                <td align="left">Reset</td>
+            </tr>
+            <tr>
+                <td align="left">
+                    <latex><![CDATA[1]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[0]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[1]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[0]]></latex>
+                </td>
+                <td align="left">Set</td>
+            </tr>
+            <tr>
+                <td align="left">
+                    <latex><![CDATA[1]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[1]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[!Q_{n-1}]]></latex>
+                </td>
+                <td align="left">
+                    <latex><![CDATA[Q_{n-1}]]></latex>
+                </td>
+                <td align="left">Toggle</td>
+            </tr>
+        </informaltable>
+        <para>
+            where 
+            <emphasis><literal>
+                    Q<subscript>n-1</subscript>
+                </literal>
+            </emphasis>
+            is the previous state of
+            <emphasis><literal>
+                    Q<subscript>n</subscript>
+                </literal>
+            </emphasis>
+            .
+        </para>
+        <refsection id="Data_Type_JKFLIPFLOP">
+            <title>Data types</title>
+            <para>
+                The block supports the following types :
+            </para>
+            <itemizedlist>
+                <listitem>
+                    <para>
+                        Inputs:
+                    </para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                <emphasis role="bold">J</emphasis>: scalar. Scilab's int8 data type only.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                <emphasis role="bold">clk</emphasis>: scalar. Scilab's real double.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                <emphasis role="bold">K</emphasis>: scalar. Scilab's int8 data type only.
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                    <para>
+                        A positive input is considered as logical 1, a negative or a null input as logical 0.
+                    </para>
+                    <para/>
+                </listitem>
+                <listitem>
+                    <para>
+                        Outputs: scalar. Scilab's int8 data type.
+                    </para>
+                </listitem>
+            </itemizedlist>
+        </refsection>
+    </refsection>
+    <refsection id="Examples_JKFLIPFLOP">
+        <title>Example</title>
+        <para>
+            The following example builds a 3 bits asynchronous counter with JK flipflops wired as T flipflops. You can show on the
+            right the timing diagram of the 
+            <emphasis><literal>
+                    Q<subscript>0</subscript>
+                </literal>
+            </emphasis>
+            to 
+            <emphasis><literal>
+                    Q<subscript>2</subscript>
+                </literal>
+            </emphasis>
+            outputs of counter.
+            <link type="scilab" linkend="scilab.zcos/xcos/examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos">
+                Open this example in Xcos
+            </link>
+        </para>
+        <para/>
+        <para>
+            <link type="scilab" linkend="scilab.zcos/xcos/examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos">
+                <inlinemediaobject>
+                    <imageobject>
+                        <imagedata fileref="../../../../examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos" align="center" valign="middle"/>
+                    </imageobject>
+                </inlinemediaobject>
+            </link>
+            <scilab:image><![CDATA[
+importXcosDiagram(SCI + "/modules/xcos/examples/integer_pal/en_US/JKFLIPFLOP_en_US.zcos");
+xcos_simulate(scs_m, 4);
+]]></scilab:image>
+        </para>
+    </refsection>
+    <refsection role="see also" id="Seealso_JKFLIPFLOP">
+        <title>See also</title>
+        <itemizedlist>
+            <listitem>
+                <link linkend="DLATCH">DLATCH</link>
+            </listitem>
+            <listitem>
+                <link linkend="DFLIPFLOP">DFLIPFLOP</link>
+            </listitem>
+            <listitem>
+                <link linkend="SRFLIPFLOP">SRFLIPFLOP</link>
+            </listitem>
+        </itemizedlist>
+    </refsection>
+</refentry>