The inverters and resistors are used to implement a correct connection of a dip switch. The nor gate system is the basic SR-latch which forms the base for any d-flipflop. A SR-latch is used to store 1 bit of data. When you toggle the top switch the LED goes on but when you switch off the switch the LED remains on until you use the bottom switch to reset the system.