/// <summary> /// Method for create the 16 ram block and initialize with cero /// </summary> private void InitializeRam() { memoryRAM = new List <RAMBlock>(); for (int i = 0; i < NUMBLOCKS; i++) { RAMBlock block = new RAMBlock() { Address = Convert.ToString(i, 2).PadLeft(4, '0'), Value = 0 }; //log.Info(Convert.ToInt32(block.Address, 2)); //log.Info(block.Address); memoryRAM.Add(block); } }
/// <summary> /// Method for get the value for an specific memory addres /// </summary> /// <param name="addres"></param> /// <returns></returns> public string GetValue(string address) { string result; try { RAMBlock temp = memoryRAM.Where(x => x.Address == address).SingleOrDefault(); result = temp.Value.ToString(); } catch (Exception e) { log.Error("RAM, GetValue, Error No existe la dirección de Memoria " + e.Message.ToString()); result = Constants.NO_DATA; } return(result); }