added SR latch
This commit is contained in:
		
							
								
								
									
										18
									
								
								bricks/memory/SRLatch.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								bricks/memory/SRLatch.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | datablock fxDTSBrickData(LogicGate_SRLatch_Data : LogicGate_DFlipFlop_Data) | ||||||
|  | { | ||||||
|  | 	subCategory = "Memory"; | ||||||
|  | 	uiName = "SR Latch"; | ||||||
|  | 	iconName = $LuaLogic::Path @ "icons/D FlipFlop"; | ||||||
|  | 	 | ||||||
|  | 	logicUIName = "SR Latch"; | ||||||
|  | 	logicUIDesc = "Q becomes 0 if R is on, else 1 when S is on"; | ||||||
|  | 	 | ||||||
|  | 	logicUpdate = "return function(gate) if gate.ports[1].state then gate.ports[3]:setstate(false) elseif gate.ports[2].state then gate.ports[3]:setstate(true) end end"; | ||||||
|  | 	 | ||||||
|  | 	logicPortUIName[0] = "R"; | ||||||
|  | 	logicPortCauseUpdate[0] = true; | ||||||
|  | 	logicPortUIName[1] = "S"; | ||||||
|  | 	logicPortCauseUpdate[1] = true; | ||||||
|  | 	logicPortUIName[2] = "Q"; | ||||||
|  | }; | ||||||
|  | lualogic_registergatedefinition("LogicGate_SRLatch_Data"); | ||||||
| @@ -38,6 +38,7 @@ exec($LuaLogic::Path @ "bricks/bus/8BitDFlipFlop.cs"); | |||||||
|  |  | ||||||
| //Memory | //Memory | ||||||
| exec($LuaLogic::Path @ "bricks/memory/DFlipFlop.cs"); | exec($LuaLogic::Path @ "bricks/memory/DFlipFlop.cs"); | ||||||
|  | exec($LuaLogic::Path @ "bricks/memory/SRLatch.cs"); | ||||||
| exec($LuaLogic::Path @ "bricks/memory/DFlipflopGridMemory2.cs"); | exec($LuaLogic::Path @ "bricks/memory/DFlipflopGridMemory2.cs"); | ||||||
|  |  | ||||||
| //Special | //Special | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Redo
					Redo