Autopilot configuration reference: Difference between revisions

Jump to navigation Jump to search
Flip Flop
m (→‎logic: remove double logic)
(Flip Flop)
Line 255: Line 255:
   </input>
   </input>
   <output>output</output>
   <output>output</output>
  </logic>  
  </logic>
 
== Flip Flop ==
A flip flop is a controller that has two stable states so it can be used as a one bit memory. Four types of flip flops are implemented: <b>RS</b>, <b>JK</b>, <b>D</b> and <b>T</b>. All use positive logic and operate on the raising edge of the clock signal if a clock is used.
All input lines, including the clock line, are encoded as condition constructs.
If negative logic for the input line is required, wrap the condition into a &lt;not&gt; tag to invert the logic.
 
=== RS Flip Flop ===
This flip flop sets its output according to the set (S) or reset (R) input lines. If the set line is set, the output gets set. If the reset line is set, the output gets reset. If no line is set, the output stays unchanged. Setting both lines, set and reset, the state of the output is undefined.
 
Example: simple RS flip flop
<flipflop>
  <type>RS</type>
  &lt;S&gt;
    <property>/myflipflop/set</property>
  </S>
  <R>
    <property>/myflipflop/reset</property>
  </R>
  <output>/myflipflop/output</output>
</flipflop>
 
=== JK Flip Flop ===
The JK flip flop is an extension of the RS flip flop. The J line serves as the set input while the K line does the reset job. Optionally, a clock input may be provided. State changes do not occour immediately, but on the next raising edge of the clock signal. The state of set=reset=true is allowed here. This state causes the output to toggle it's current state on the next raising edge of the clock signal.
If no clock signal is provided, the frame rate serves as the clock input.
 
Example: simple JK flip flop with negative edge clock
<flipflop>
  <type>JK</type>
  <J>
    <property>/myflipflop/set</property>
  </J>
  <K>
    <property>/myflipflop/reset</property>
  </K>
  <clock>
    <not>
      <property>/myflipflop/clock</property>
    </not>
  </clock>
  <output>/myflipflop/output</output>
</flipflop>
 
=== D Flip Flop ===
The D flip flop transfers the state of the input signal <b>D</b> to the output line at the next raising edge of the clock signal, which is mandatory for this flip flop.
 
Example: simple D flip flop with inverted output
<flipflop>
  <type>D</type>
  <D>
    <property>/myflipflop/data</property>
  </D>
  <clock>
    <property>/myflipflop/clock</property>
  </clock>
  <output>/myflipflop/output</output>
  <inverted type="bool">true</inverted>
</flipflop>
 
=== T Flip Flop ===
The T flip flop toggles the state of the output signal at the next raising edge of the clock signal, which is mandatory for this flip flop.
 
Example: simple T flip flop
<flipflop>
  <type>T</type>
  <clock>
    <property>/myflipflop/clock</property>
  </clock>
  <output>/myflipflop/output</output>
</flipflop>
 
== filter ==
== filter ==


Navigation menu