All pastes #419806 Raw Edit

Miscellany

public lua v1 · immutable
·published 2007-04-01 17:21 UTC
rendered paste body
GateActions["wom"] = {	group = "Memory",	name = "Write Only Memory",	inputs = { "Clk", "AddrWrite", "Data" }	output = function( gate, Clk, AddrWrite, Data )		AddrWrite = math.floor(tonumber(AddrWrite))		if ( Clk > 0 ) then			if ( AddrWrite >= 0 ) and ( AddrWrite < 4 ) then				gate.LatchStore[AddrWrite] = Data			end		end	end,	reset = function( gate )		gate.LatchStore = {}		for i = 0, 3 do			gate.LatchStore[i] = 0		end	end,	label = function()		return "Write Only Memory - 4 store"    end}