Selasa, 22 Maret 2016

Flip Flop Tables



Private Sub Command1_Click()
If Text1.Text = "0" And Text2.Text = "0" Then Label1.Caption = "J = 0, K = X"
If Text1.Text = "0" And Text2.Text = "1" Then Label1.Caption = "J = 1, K = X"
If Text1.Text = "1" And Text2.Text = "0" Then Label1.Caption = "J = X, K = 1"
If Text1.Text = "1" And Text2.Text = "1" Then Label1.Caption = "J = X, K = 0"
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Label1.Caption = ""
End Sub

Private Sub Command3_Click()
End

End Sub

Private Sub Command4_Click()
If Text1.Text = "0" And Text2.Text = "0" Then Label1.Caption = "0"
If Text1.Text = "0" And Text2.Text = "1" Then Label1.Caption = "1"
If Text1.Text = "1" And Text2.Text = "0" Then Label1.Caption = "0"
If Text1.Text = "1" And Text2.Text = "1" Then Label1.Caption = "1"
End Sub

Private Sub Command5_Click()
If Text1.Text = "0" And Text2.Text = "0" Then Label1.Caption = "S = 0, R = X"
If Text1.Text = "0" And Text2.Text = "1" Then Label1.Caption = "S = 1, R = 0"
If Text1.Text = "1" And Text2.Text = "0" Then Label1.Caption = "S = 0, R = 1"
If Text1.Text = "1" And Text2.Text = "1" Then Label1.Caption = "S = X, R = 0"
End Sub

Private Sub Command6_Click()
If Text1.Text = "0" And Text2.Text = "0" Then Label1.Caption = "0"
If Text1.Text = "0" And Text2.Text = "1" Then Label1.Caption = "1"
If Text1.Text = "1" And Text2.Text = "0" Then Label1.Caption = "1"
If Text1.Text = "1" And Text2.Text = "1" Then Label1.Caption = "0"
End Sub