public void addInstructionToCache(int address, Cache c, boolean isInst) {
		boolean found = false;
		int direct_mapped_index;
		int m_set_associative = (address / c.lineSize)
				% (c.lines / c.associativity);
		if (c.type.equals("fully associative")) {
			free: for (int i = 0; i < c.data.length; i++) {
				if (c.data[i] == -1) {
					c.data[i] = (address / c.getLineSize()) * c.getLineSize();
					c.isInstruction[i] = true;
					found = true;
					break free;
				}

			}
			if (!found) {
				int x = randNum(0, c.data.length - 1);
				c.data[x] = (address / c.getLineSize()) * c.getLineSize();
				c.isInstruction[x] = isInst;
			}

		} else if (c.type.equals("direct mapped")) {
			direct_mapped_index = (address / c.lineSize) % c.lines;
			c.data[direct_mapped_index] = (address / c.lineSize) * c.lineSize;
		}
		// else m-set associative
		else {
			for (int i = 0; i < c.associativity; i++) {
				if (c.data[(i * (c.lines / c.associativity))
						+ m_set_associative] == -1) {
					found = true;
					c.data[i] = (address / c.lineSize) * c.lineSize;
				}
			}
			if (!found) {
				int x = randNum(0, c.associativity);
				c.data[(x * (c.lines / c.associativity)) + m_set_associative] = (address * c.lineSize)
						/ c.lineSize;
			}
		}

	}