Interactive-Book icon indicating copy to clipboard operation
Interactive-Book copied to clipboard

Flip flop State Table gives wrong results

Open sakshi1499 opened this issue 5 years ago • 8 comments

The flip flop State Generator Table gives undefined on all sets of outputs. This should be taken care of and corrected. Steps to reproduce:

  1. Go to the interactive book page and click Flip Flop interaction.
  2. Click on the type of flip flop and enter the inputs and outputs you desire.
  3. Once you confirm for he state table, the state table shown below will appear. The output result should however be different.

Capture

This task is for GCI

sakshi1499 avatar Dec 22 '19 05:12 sakshi1499

Hi, for this issue can I just add a more informative instruction on user input rather than fixing the code itself(fixing the html). It seems that the problem with undefined results is due to invalid userinput on flip flop input and output function. If there is something better than I can do, please tell me.

ericsheng495 avatar Jan 04 '20 14:01 ericsheng495

Yes @ericsheng495, I'll explain everything to you in a minute

sakshi1499 avatar Jan 04 '20 15:01 sakshi1499

So see T flip flop is basically a JK flip flop where both the inputs are the same. That is why in the above picture we only have TA because both the inputs are same. So when the input is 0 your next state is your present state and when it is 1 your next state is the negation of the present state. So in case of A and y when both the inputs are different i.e 0 and 1 or vice versa, it should be undefined because that is not possible. But in case of 0 and 0 and 1 and 1 it should be as said above. I know this is a little tough. If you don't get it, I'll explain again feel free to ask that. @ericsheng495

sakshi1499 avatar Jan 04 '20 15:01 sakshi1499

Heyyy I found something that can help you. Look at this picture ff

Just in the last row it should be negated present state and first row should be present state

sakshi1499 avatar Jan 04 '20 15:01 sakshi1499

Screen Shot 2020-01-05 at 10 46 42 AM Screen Shot 2020-01-05 at 10 47 11 AM Screen Shot 2020-01-05 at 10 47 24 AM

If I use the pictured inputs, I don't see undefined values. I thinks the error actually occurs with how the user inputs.

ericsheng495 avatar Jan 05 '20 02:01 ericsheng495

Firstly, is this what you got in your development environment? Because when I am actually accessing the original website link the following comes.

Screenshot (1) Screenshot (2)

sakshi1499 avatar Jan 05 '20 04:01 sakshi1499

Secondly, your step 2 doesn't really make sense A+y?? Why did you use the addition/OR operator here?

sakshi1499 avatar Jan 05 '20 05:01 sakshi1499

Thirdly, you look at the truth table you just sent, the output is 0 and 1 when the input is 1. How is that correct? Like look at the truth table I sent when Ta gets 1 as an input it should give the negation of previous state, but in second row the previous output was 0 so it should be 1 in second row.

sakshi1499 avatar Jan 05 '20 05:01 sakshi1499