public Memory(int size, int instructionsStartAddress, int dataStartAddress, int accessTime) {
		if (size < 128 || size > 4194304)
			throw new IllegalArgumentException("Memory size must be greater than 128B and less than 4MB");
		
		if (!Helpers.isPowerOf2(size))
			throw new IllegalArgumentException("Memory size (" + size + ") must be a power of 2");
		
		if (instructionsStartAddress < dataStartAddress && dataStartAddress < size 
				&& instructionsStartAddress % 2 == 0 && dataStartAddress % 2 == 0) {
			this.instructionsStartAddress = instructionsStartAddress;
			this.dataStartAddress = dataStartAddress;
			this.size = size;
			this.accessTime = accessTime;
		} else 
			throw new IllegalArgumentException("Invalid memory configuration");
		
		clear();
	}