# AND 게이트
def AND(x1, x2):
    w1, w2, b = 0.5, 0.5, -0.7

    if x1*w1 + x2*w2 + b >= 0:
        return 1
    else:
        return 0


# OR 게이트
def OR(x1, x2):
    w1, w2, b = 0.5, 0.5, -0.2

    if x1*w1 + x2*w2 + b >= 0:
        return 1
    else:
        return 0


# NAND 게이트
def NAND(x1, x2):
    w1, w2, b = -0.5, -0.5, 0.7

    if x1*w1 + x2*w2 + b >= 0:
        return 1
    else:
        return 0


# NOR 게이트
def NOR(x1, x2):
    w1, w2, b = -0.5, -0.5, 0.2

    if x1*w1 + x2*w2 + b >= 0:
        return 1
    else:
        return 0
