How to add CLEAR, PRESET terminals in J-K FLIP FLOP

17 Ansichten (letzte 30 Tage)
수형
수형 am 5 Sep. 2023
Beantwortet: Prinsca am 13 Mär. 2024
I want to make MOD-3 counter with 2 J-K flip flop, 1 and gate like picture that I upload
but in library there is no CLR,PR port in J-K flip flop. How can i make this?

Antworten (2)

Kunal Kandhari
Kunal Kandhari am 5 Sep. 2023
If you want to create a MOD-3 counter using J-K flip-flops in Simulink and as there is no direct CLR (Clear) or PR (Preset) port in the J-K flip-flop block, you can implement the clear and preset functionality using additional logic gates.
Here's how you can create a MOD-3 counter using J-K flip-flops:
1. Create the J-K Flip-Flops:
  • Place two J-K Flip-Flop blocks from the Simulink library onto your model.
2. Connect the Clock Signal:
  • Connect a clock signal to the clock (CLK) inputs of both J-K Flip-Flops.
3. Implement the Clear and Preset Functionality:
  • Since the J-K Flip-Flop block in Simulink might not have direct CLR (Clear) or PR (Preset) ports, you can use additional logic gates to achieve these functions.
  • For the first J-K Flip-Flop (FF1):
  • Connect the J input to an AND gate:
  • One input of the AND gate should be your desired preset signal.
  • The other input of the AND gate should be your clock signal inverted using a NOT gate.
  • Connect the K input to an AND gate:
  • One input of the AND gate should be your desired clear signal.
  • The other input of the AND gate should be your clock signal inverted using a NOT gate.
  • For the second J-K Flip-Flop (FF2):
  • Connect the J input to an AND gate:
  • One input of the AND gate should be your desired preset signal.
  • The other input of the AND gate should be the output of FF1 (Q1).
  • Connect the K input to an AND gate:
  • One input of the AND gate should be your desired clear signal.
  • The other input of the AND gate should be the output of FF1 (Q1).
4. Connect the Feedback Logic:
  • Connect the Q output of FF1 to the J input of FF2.
  • Connect the Q output of FF2 back to the K input of FF2.
5. Create the Output:
  • Connect the Q outputs of the J-K Flip-Flops to your output or display blocks to observe the counter's behavior.
By following these steps, you can create a MOD-3 counter using J-K flip-flops in Simulink, implementing clear and preset functionality using additional logic gates as needed. Be sure to configure the preset and clear signals according to your specific requirements.

Prinsca
Prinsca am 13 Mär. 2024
what if it is a d flip flop and I want to create a preset signal

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by