from PyQt5 import QtCore, QtGui, QtWidgets, QtMultimedia
from PyQt5.QtCore import *
import sys
from PyQt5 import QtCore, QtGui, QtWidgets

import images_rc

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1011, 558)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.frame_6 = QtWidgets.QFrame(self.centralwidget)
        self.frame_6.setGeometry(QtCore.QRect(25, 400, 72, 135))
        self.frame_6.setAutoFillBackground(False)
        self.frame_6.setStyleSheet("background-color: lightblue")
        self.frame_6.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_6.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_6.setLineWidth(2)
        self.frame_6.setObjectName("frame_6")
        self.NandA = QtWidgets.QLCDNumber(self.frame_6)
        self.NandA.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.NandA.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.NandA.setDigitCount(1)
        self.NandA.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.NandA.setObjectName("NandA")
        self.NandInA = QtWidgets.QCheckBox(self.frame_6)
        self.NandInA.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.NandInA.setText("")
        self.NandInA.setObjectName("NandInA")
        self.frame_7 = QtWidgets.QFrame(self.centralwidget)
        self.frame_7.setGeometry(QtCore.QRect(115, 400, 72, 135))
        self.frame_7.setAutoFillBackground(False)
        self.frame_7.setStyleSheet("background-color: lightblue")
        self.frame_7.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_7.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_7.setLineWidth(2)
        self.frame_7.setObjectName("frame_7")
        self.NandB = QtWidgets.QLCDNumber(self.frame_7)
        self.NandB.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.NandB.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.NandB.setDigitCount(1)
        self.NandB.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.NandB.setObjectName("NandB")
        self.NandInB = QtWidgets.QCheckBox(self.frame_7)
        self.NandInB.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.NandInB.setText("")
        self.NandInB.setObjectName("NandInB")
        self.frame = QtWidgets.QFrame(self.centralwidget)
        self.frame.setGeometry(QtCore.QRect(10, 130, 191, 241))
        self.frame.setAutoFillBackground(False)
        self.frame.setStyleSheet("background-color: lightblue")
        self.frame.setFrameShape(QtWidgets.QFrame.Panel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame.setLineWidth(2)
        self.frame.setObjectName("frame")
        self.label = QtWidgets.QLabel(self.frame)
        self.label.setGeometry(QtCore.QRect(20, 20, 150, 200))
        self.label.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.label.setLineWidth(2)
        self.label.setObjectName("label")
        self.label_8 = QtWidgets.QLabel(self.frame)
        self.label_8.setGeometry(QtCore.QRect(10, 10, 51, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_8.setFont(font)
        self.label_8.setObjectName("label_8")
        self.frame_2 = QtWidgets.QFrame(self.centralwidget)
        self.frame_2.setGeometry(QtCore.QRect(210, 130, 191, 241))
        self.frame_2.setAutoFillBackground(False)
        self.frame_2.setStyleSheet("background-color: lightblue")
        self.frame_2.setFrameShape(QtWidgets.QFrame.Panel)
        self.frame_2.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_2.setLineWidth(2)
        self.frame_2.setObjectName("frame_2")
        self.label_2 = QtWidgets.QLabel(self.frame_2)
        self.label_2.setGeometry(QtCore.QRect(20, 20, 150, 200))
        self.label_2.setObjectName("label_2")
        self.label_9 = QtWidgets.QLabel(self.frame_2)
        self.label_9.setGeometry(QtCore.QRect(10, 10, 51, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_9.setFont(font)
        self.label_9.setObjectName("label_9")
        self.frame_3 = QtWidgets.QFrame(self.centralwidget)
        self.frame_3.setGeometry(QtCore.QRect(410, 130, 191, 241))
        self.frame_3.setAutoFillBackground(False)
        self.frame_3.setStyleSheet("background-color: lightblue")
        self.frame_3.setFrameShape(QtWidgets.QFrame.Panel)
        self.frame_3.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_3.setLineWidth(2)
        self.frame_3.setObjectName("frame_3")
        self.label_3 = QtWidgets.QLabel(self.frame_3)
        self.label_3.setGeometry(QtCore.QRect(20, 20, 150, 200))
        self.label_3.setObjectName("label_3")
        self.label_10 = QtWidgets.QLabel(self.frame_3)
        self.label_10.setGeometry(QtCore.QRect(10, 10, 51, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_10.setFont(font)
        self.label_10.setObjectName("label_10")
        self.frame_4 = QtWidgets.QFrame(self.centralwidget)
        self.frame_4.setGeometry(QtCore.QRect(610, 130, 191, 241))
        self.frame_4.setAutoFillBackground(False)
        self.frame_4.setStyleSheet("background-color: lightblue")
        self.frame_4.setFrameShape(QtWidgets.QFrame.Panel)
        self.frame_4.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_4.setLineWidth(2)
        self.frame_4.setObjectName("frame_4")
        self.label_4 = QtWidgets.QLabel(self.frame_4)
        self.label_4.setGeometry(QtCore.QRect(20, 20, 150, 200))
        self.label_4.setObjectName("label_4")
        self.label_11 = QtWidgets.QLabel(self.frame_4)
        self.label_11.setGeometry(QtCore.QRect(10, 10, 51, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_11.setFont(font)
        self.label_11.setObjectName("label_11")
        self.frame_5 = QtWidgets.QFrame(self.centralwidget)
        self.frame_5.setGeometry(QtCore.QRect(810, 130, 191, 241))
        self.frame_5.setAutoFillBackground(False)
        self.frame_5.setStyleSheet("background-color: lightblue")
        self.frame_5.setFrameShape(QtWidgets.QFrame.Panel)
        self.frame_5.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_5.setLineWidth(2)
        self.frame_5.setObjectName("frame_5")
        self.label_5 = QtWidgets.QLabel(self.frame_5)
        self.label_5.setGeometry(QtCore.QRect(20, 20, 150, 200))
        self.label_5.setObjectName("label_5")
        self.label_12 = QtWidgets.QLabel(self.frame_5)
        self.label_12.setGeometry(QtCore.QRect(10, 10, 51, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_12.setFont(font)
        self.label_12.setObjectName("label_12")
        self.frame_8 = QtWidgets.QFrame(self.centralwidget)
        self.frame_8.setGeometry(QtCore.QRect(70, 10, 72, 111))
        self.frame_8.setAutoFillBackground(False)
        self.frame_8.setStyleSheet("background-color: lightblue")
        self.frame_8.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_8.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_8.setLineWidth(2)
        self.frame_8.setObjectName("frame_8")
        self.NandOut = QtWidgets.QLCDNumber(self.frame_8)
        self.NandOut.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.NandOut.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.NandOut.setDigitCount(1)
        self.NandOut.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.NandOut.setObjectName("NandOut")
        self.frame_9 = QtWidgets.QFrame(self.centralwidget)
        self.frame_9.setGeometry(QtCore.QRect(270, 10, 72, 111))
        self.frame_9.setAutoFillBackground(False)
        self.frame_9.setStyleSheet("background-color: lightblue")
        self.frame_9.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_9.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_9.setLineWidth(2)
        self.frame_9.setObjectName("frame_9")
        self.NotOut = QtWidgets.QLCDNumber(self.frame_9)
        self.NotOut.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.NotOut.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.NotOut.setDigitCount(1)
        self.NotOut.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.NotOut.setObjectName("NotOut")
        self.frame_10 = QtWidgets.QFrame(self.centralwidget)
        self.frame_10.setGeometry(QtCore.QRect(470, 10, 72, 111))
        self.frame_10.setAutoFillBackground(False)
        self.frame_10.setStyleSheet("background-color: lightblue")
        self.frame_10.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_10.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_10.setLineWidth(2)
        self.frame_10.setObjectName("frame_10")
        self.AndOut = QtWidgets.QLCDNumber(self.frame_10)
        self.AndOut.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.AndOut.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.AndOut.setDigitCount(1)
        self.AndOut.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.AndOut.setObjectName("AndOut")
        self.frame_11 = QtWidgets.QFrame(self.centralwidget)
        self.frame_11.setGeometry(QtCore.QRect(670, 10, 72, 111))
        self.frame_11.setAutoFillBackground(False)
        self.frame_11.setStyleSheet("background-color: lightblue")
        self.frame_11.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_11.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_11.setLineWidth(2)
        self.frame_11.setObjectName("frame_11")
        self.OrOut = QtWidgets.QLCDNumber(self.frame_11)
        self.OrOut.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.OrOut.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.OrOut.setDigitCount(1)
        self.OrOut.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.OrOut.setObjectName("OrOut")
        self.frame_12 = QtWidgets.QFrame(self.centralwidget)
        self.frame_12.setGeometry(QtCore.QRect(870, 10, 72, 111))
        self.frame_12.setAutoFillBackground(False)
        self.frame_12.setStyleSheet("background-color: lightblue")
        self.frame_12.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_12.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_12.setLineWidth(2)
        self.frame_12.setObjectName("frame_12")
        self.XorOut = QtWidgets.QLCDNumber(self.frame_12)
        self.XorOut.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.XorOut.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.XorOut.setDigitCount(1)
        self.XorOut.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.XorOut.setObjectName("XorOut")
        self.line = QtWidgets.QFrame(self.centralwidget)
        self.line.setGeometry(QtCore.QRect(103, 120, 3, 30))
        self.line.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line.setLineWidth(2)
        self.line.setFrameShape(QtWidgets.QFrame.VLine)
        self.line.setObjectName("line")
        self.line_2 = QtWidgets.QFrame(self.centralwidget)
        self.line_2.setGeometry(QtCore.QRect(303, 120, 3, 30))
        self.line_2.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_2.setLineWidth(2)
        self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_2.setObjectName("line_2")
        self.line_3 = QtWidgets.QFrame(self.centralwidget)
        self.line_3.setGeometry(QtCore.QRect(503, 120, 3, 48))
        self.line_3.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_3.setLineWidth(2)
        self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_3.setObjectName("line_3")
        self.line_4 = QtWidgets.QFrame(self.centralwidget)
        self.line_4.setGeometry(QtCore.QRect(704, 120, 3, 30))
        self.line_4.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_4.setLineWidth(2)
        self.line_4.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_4.setObjectName("line_4")
        self.line_5 = QtWidgets.QFrame(self.centralwidget)
        self.line_5.setGeometry(QtCore.QRect(904, 120, 3, 35))
        self.line_5.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_5.setLineWidth(2)
        self.line_5.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_5.setObjectName("line_5")
        self.line_6 = QtWidgets.QFrame(self.centralwidget)
        self.line_6.setGeometry(QtCore.QRect(60, 350, 3, 50))
        self.line_6.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_6.setLineWidth(2)
        self.line_6.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_6.setObjectName("line_6")
        self.line_7 = QtWidgets.QFrame(self.centralwidget)
        self.line_7.setGeometry(QtCore.QRect(150, 350, 3, 50))
        self.line_7.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_7.setLineWidth(2)
        self.line_7.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_7.setObjectName("line_7")
        self.line_8 = QtWidgets.QFrame(self.centralwidget)
        self.line_8.setGeometry(QtCore.QRect(303, 350, 3, 50))
        self.line_8.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_8.setLineWidth(2)
        self.line_8.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_8.setObjectName("line_8")
        self.line_9 = QtWidgets.QFrame(self.centralwidget)
        self.line_9.setGeometry(QtCore.QRect(465, 350, 3, 50))
        self.line_9.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_9.setLineWidth(2)
        self.line_9.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_9.setObjectName("line_9")
        self.line_10 = QtWidgets.QFrame(self.centralwidget)
        self.line_10.setGeometry(QtCore.QRect(545, 350, 3, 50))
        self.line_10.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_10.setLineWidth(2)
        self.line_10.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_10.setObjectName("line_10")
        self.line_11 = QtWidgets.QFrame(self.centralwidget)
        self.line_11.setGeometry(QtCore.QRect(655, 330, 20, 71))
        self.line_11.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_11.setLineWidth(2)
        self.line_11.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_11.setObjectName("line_11")
        self.line_12 = QtWidgets.QFrame(self.centralwidget)
        self.line_12.setGeometry(QtCore.QRect(735, 330, 20, 71))
        self.line_12.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_12.setLineWidth(2)
        self.line_12.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_12.setObjectName("line_12")
        self.line_13 = QtWidgets.QFrame(self.centralwidget)
        self.line_13.setGeometry(QtCore.QRect(845, 330, 20, 71))
        self.line_13.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_13.setLineWidth(2)
        self.line_13.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_13.setObjectName("line_13")
        self.line_14 = QtWidgets.QFrame(self.centralwidget)
        self.line_14.setGeometry(QtCore.QRect(945, 330, 20, 71))
        self.line_14.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line_14.setLineWidth(2)
        self.line_14.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_14.setObjectName("line_14")
        self.frame_13 = QtWidgets.QFrame(self.centralwidget)
        self.frame_13.setGeometry(QtCore.QRect(510, 400, 72, 135))
        self.frame_13.setAutoFillBackground(False)
        self.frame_13.setStyleSheet("background-color: lightblue")
        self.frame_13.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_13.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_13.setLineWidth(2)
        self.frame_13.setObjectName("frame_13")
        self.AndB = QtWidgets.QLCDNumber(self.frame_13)
        self.AndB.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.AndB.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.AndB.setDigitCount(1)
        self.AndB.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.AndB.setObjectName("AndB")
        self.AndInB = QtWidgets.QCheckBox(self.frame_13)
        self.AndInB.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.AndInB.setText("")
        self.AndInB.setObjectName("AndInB")
        self.frame_14 = QtWidgets.QFrame(self.centralwidget)
        self.frame_14.setGeometry(QtCore.QRect(430, 400, 72, 135))
        self.frame_14.setAutoFillBackground(False)
        self.frame_14.setStyleSheet("background-color: lightblue")
        self.frame_14.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_14.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_14.setLineWidth(2)
        self.frame_14.setObjectName("frame_14")
        self.AndA = QtWidgets.QLCDNumber(self.frame_14)
        self.AndA.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.AndA.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.AndA.setDigitCount(1)
        self.AndA.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.AndA.setObjectName("AndA")
        self.AndInA = QtWidgets.QCheckBox(self.frame_14)
        self.AndInA.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.AndInA.setText("")
        self.AndInA.setObjectName("AndInA")
        self.frame_15 = QtWidgets.QFrame(self.centralwidget)
        self.frame_15.setGeometry(QtCore.QRect(265, 400, 72, 135))
        self.frame_15.setAutoFillBackground(False)
        self.frame_15.setStyleSheet("background-color: lightblue")
        self.frame_15.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_15.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_15.setLineWidth(2)
        self.frame_15.setObjectName("frame_15")
        self.NotA = QtWidgets.QLCDNumber(self.frame_15)
        self.NotA.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.NotA.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.NotA.setDigitCount(1)
        self.NotA.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.NotA.setObjectName("NotA")
        self.NotInA = QtWidgets.QCheckBox(self.frame_15)
        self.NotInA.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.NotInA.setText("")
        self.NotInA.setObjectName("NotInA")
        self.frame_16 = QtWidgets.QFrame(self.centralwidget)
        self.frame_16.setGeometry(QtCore.QRect(630, 400, 72, 135))
        self.frame_16.setAutoFillBackground(False)
        self.frame_16.setStyleSheet("background-color: lightblue")
        self.frame_16.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_16.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_16.setLineWidth(2)
        self.frame_16.setObjectName("frame_16")
        self.OrA = QtWidgets.QLCDNumber(self.frame_16)
        self.OrA.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.OrA.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.OrA.setDigitCount(1)
        self.OrA.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.OrA.setObjectName("OrA")
        self.OrInA = QtWidgets.QCheckBox(self.frame_16)
        self.OrInA.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.OrInA.setText("")
        self.OrInA.setObjectName("OrInA")
        self.frame_17 = QtWidgets.QFrame(self.centralwidget)
        self.frame_17.setGeometry(QtCore.QRect(710, 400, 72, 135))
        self.frame_17.setAutoFillBackground(False)
        self.frame_17.setStyleSheet("background-color: lightblue")
        self.frame_17.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_17.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_17.setLineWidth(2)
        self.frame_17.setObjectName("frame_17")
        self.OrB = QtWidgets.QLCDNumber(self.frame_17)
        self.OrB.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.OrB.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.OrB.setDigitCount(1)
        self.OrB.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.OrB.setObjectName("OrB")
        self.OrInB = QtWidgets.QCheckBox(self.frame_17)
        self.OrInB.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.OrInB.setText("")
        self.OrInB.setObjectName("OrInB")
        self.frame_18 = QtWidgets.QFrame(self.centralwidget)
        self.frame_18.setGeometry(QtCore.QRect(820, 400, 72, 135))
        self.frame_18.setAutoFillBackground(False)
        self.frame_18.setStyleSheet("background-color: lightblue")
        self.frame_18.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_18.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_18.setLineWidth(2)
        self.frame_18.setObjectName("frame_18")
        self.XorA = QtWidgets.QLCDNumber(self.frame_18)
        self.XorA.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.XorA.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.XorA.setDigitCount(1)
        self.XorA.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.XorA.setObjectName("XorA")
        self.XorInA = QtWidgets.QCheckBox(self.frame_18)
        self.XorInA.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.XorInA.setText("")
        self.XorInA.setObjectName("XorInA")
        self.frame_19 = QtWidgets.QFrame(self.centralwidget)
        self.frame_19.setGeometry(QtCore.QRect(920, 400, 72, 135))
        self.frame_19.setAutoFillBackground(False)
        self.frame_19.setStyleSheet("background-color: lightblue")
        self.frame_19.setFrameShape(QtWidgets.QFrame.Box)
        self.frame_19.setFrameShadow(QtWidgets.QFrame.Plain)
        self.frame_19.setLineWidth(2)
        self.frame_19.setObjectName("frame_19")
        self.XorB = QtWidgets.QLCDNumber(self.frame_19)
        self.XorB.setGeometry(QtCore.QRect(7, 5, 60, 101))
        self.XorB.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.XorB.setDigitCount(1)
        self.XorB.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
        self.XorB.setObjectName("XorB")
        self.XorInB = QtWidgets.QCheckBox(self.frame_19)
        self.XorInB.setGeometry(QtCore.QRect(30, 110, 16, 17))
        self.XorInB.setText("")
        self.XorInB.setObjectName("XorInB")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1011, 21))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        # Nand Signals
        self.NandOut.display(1) # Initialize to 1 because A and B are 0
        self.NandInA.stateChanged.connect(self.nandAUpdate)
        self.NandInB.stateChanged.connect(self.nandBUpdate)

        # Not Signals
        self.NotOut.display(1) # Initialize to 1 because A is 0
        self.NotInA.stateChanged.connect(self.notUpdate)

        # And Signals
        self.AndInA.stateChanged.connect(self.andAUpdate)
        self.AndInB.stateChanged.connect(self.andBUpdate)

        # Or Signals
        self.OrInA.stateChanged.connect(self.orAUpdate)
        self.OrInB.stateChanged.connect(self.orBUpdate)

        # Xor Signals
        self.XorInA.stateChanged.connect(self.xorAUpdate)
        self.XorInB.stateChanged.connect(self.xorBUpdate)

    # Nand I/O
    def nandDisplayUpdate(self):
        if self.NandA.value() == 1 and self.NandB.value() == 1:
            self.NandOut.display(0)
        else:
            self.NandOut.display(1)

    def nandAUpdate(self):
        if self.NandInA.isChecked():
            self.NandA.display(1)
        else:
            self.NandA.display(0)
        self.nandDisplayUpdate()
        
    def nandBUpdate(self):
        if self.NandInB.isChecked():
            self.NandB.display(1)
        else:
            self.NandB.display(0)
        self.nandDisplayUpdate()

    # Not I/O
    def notUpdate(self):
        if self.NotInA.isChecked():
            self.NotA.display(1)
            self.NotOut.display(0)
        else:
            self.NotA.display(0)
            self.NotOut.display(1)

    # And I/O
    def andDisplayUpdate(self):
        if self.AndA.value() == 1 and self.AndB.value() == 1:
            self.AndOut.display(1)
        else:
            self.AndOut.display(0)

    def andAUpdate(self):
        if self.AndInA.isChecked():
            self.AndA.display(1)
        else:
            self.AndA.display(0)
        self.andDisplayUpdate()

    def andBUpdate(self):
        if self.AndInB.isChecked():
            self.AndB.display(1)
        else:
            self.AndB.display(0)
        self.andDisplayUpdate()

    # Or I/O
    def orDisplayUpdate(self):
        if self.OrA.value() == 0 and self.OrB.value() == 0:
            self.OrOut.display(0)
        else:
            self.OrOut.display(1)

    def orAUpdate(self):
        if self.OrInA.isChecked():
            self.OrA.display(1)
        else:
            self.OrA.display(0)
        self.orDisplayUpdate()

    def orBUpdate(self):
        if self.OrInB.isChecked():
            self.OrB.display(1)
        else:
            self.OrB.display(0)
        self.orDisplayUpdate()

    # Xor I/O
    def xorDisplayUpdate(self):
        if self.XorA.value() == 1 and self.XorB.value() == 1:
            self.XorOut.display(0)
        elif self.XorA.value() == 0 and self.XorB.value() == 0:
            self.XorOut.display(0)
        else:
            self.XorOut.display(1)

    def xorAUpdate(self):
        if self.XorInA.isChecked():
            self.XorA.display(1)
        else:
            self.XorA.display(0)
        self.xorDisplayUpdate()

    def xorBUpdate(self):
        if self.XorInB.isChecked():
            self.XorB.display(1)
        else:
            self.XorB.display(0)
        self.xorDisplayUpdate()

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "Logic Gates Simulator - Rafael Almazar"))
        self.label.setText(_translate("MainWindow", "<html><head/><body><p><img src=\":/Nand-Gate/Nand-Gate.png\"/></p></body></html>"))
        self.label_8.setText(_translate("MainWindow", "NAND"))
        self.label_2.setText(_translate("MainWindow", "<html><head/><body><p><img src=\":/Not-Gate/Not-Gate.png\"/></p></body></html>"))
        self.label_9.setText(_translate("MainWindow", "NOT"))
        self.label_3.setText(_translate("MainWindow", "<html><head/><body><p><img src=\":/And-Gate/And-Gate.png\"/></p></body></html>"))
        self.label_10.setText(_translate("MainWindow", "AND"))
        self.label_4.setText(_translate("MainWindow", "<html><head/><body><p><img src=\":/Or-Gate/Or-Gate.png\"/></p></body></html>"))
        self.label_11.setText(_translate("MainWindow", "OR"))
        self.label_5.setText(_translate("MainWindow", "<html><head/><body><p><img src=\":/Xor-Gate/Xor-Gate.png\"/></p></body></html>"))
        self.label_12.setText(_translate("MainWindow", "XOR"))

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())