Public Class Form1 Dim Z_A As Integer Dim z_B As Integer Dim z_C As Integer Dim not_c As Integer Dim not_v As Integer Dim and_a As Integer Dim and_b As Integer Dim and_not As Integer Dim and_v As Integer Dim xor_a As Integer Dim xor_and As Integer Dim xor_v as Integer Dim or_and As Integer Dim or_not As Integer Dim or_c As Integer Dim or_v As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub 'Vizuální část... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'krokování jednotlivích sekvencí krok_1() krok_2() Krok_3() krok_4() End Sub Private Sub krok_1() 'načtení ze zadání z klávesnice and_a = Val(txt_A) and_b = Val(txt_B) xor_a = Val(txt_A) not_c = Val(txt_C) or_c = Val(txt_C) If not_c = 1 Then not_v = 0 ElseIf not_c = 0 Then not_v = 1 End If End Sub Private Sub krok_2() 'pokračování přepisu a podmínka zda AND obsahuje tři jedničky and_not = not_v or_not = not_v If and_a = 1 Then If and_b = 1 Then If and_not = 1 Then and_v = 1 Else and_v = 0 End If Else and_v = 0 End If Else and_v = 0 End If End Sub Private Sub Krok_3() 'Daší pokračování a podmínka, zda XOR má lichý počet jedniček or_and = and_v xor_and = and_v If xor_a + xor_and = 2 Then xor_v = 0 ElseIf xor_a + xor_and = 0 Then xor_v = 0 Else xor_v = 1 End If If or_and + or_c + or_not > 1 Then or_v = 1 Else or_v = 0 End If End Sub Private Sub krok_4() 'A ted už nevím jak dál... Print("hradlo XOR je " & xor_v) Print("hradlo OR je " & or_v) End Sub Private Sub Nacteni_1() End Sub End Class