static void EscribirCacheCorrespondenciaDirecta(int i, int v) {

        int Etiqueta = Integer.parseInt(Integer.toBinaryString(0x1000 | i).substring(1).substring(0, 3));
        int Palabra = Integer.parseInt(Integer.toBinaryString(0x1000 | i).substring(1).substring(9, 12), 2);
        int Linea = Integer.parseInt(Integer.toBinaryString(0x1000 | i).substring(1).substring(3, 9), 2);

        int Bloque = i / 8;
        int firstLine = Bloque * 8;

        if (CacheMemoryD[Linea].isValid()) {
            if (Etiqueta == CacheMemoryD[Linea].getEtiqueta()) {
                CacheMemoryD[Linea].setModify(true);
                CacheMemoryD[Linea].getPalabra()[Palabra] = v;
                Time += 0.01;
            } else {
                if (CacheMemoryD[Linea].isModify()) {
                    int count = 0;

                    //int BloqueC = Integer.parseInt(Integer.toBinaryString(0x1000 | CacheMemoryD[Linea].getEtiqueta()).substring(1).substring(9, 12).concat(Integer.toBinaryString(0x1000 | Linea).substring(1).substring(6, 12)));
                    //int firstLineM = BloqueC * 8;
                    String SBloque = Integer.toString(CacheMemoryD[Linea].getEtiqueta()) + Integer.toBinaryString(Linea);
                    int firstLineM = Integer.parseInt(SBloque, 2) * 8;

                    for (int j = firstLineM; j < firstLineM + 8; j++) {
                        RAM[j] = CacheMemoryD[Linea].getPalabra()[count];
                        count++;
                    }

                    count = 0;
                    for (int j = firstLine; j < firstLine + 8; j++) {
                        CacheMemoryD[Linea].getPalabra()[count] = RAM[j];
                        count++;
                    }

                    Time += 0.66 + 0.66 + 0.01;
                    CacheMemoryD[Linea].setModify(true);
                } else {

                    int count = 0;
                    for (int j = firstLine; j < firstLine + 8; j++) {
                        CacheMemoryD[Linea].getPalabra()[count] = RAM[j];
                        count++;
                    }

                    Time += 0.1 + 0.01;
                    CacheMemoryD[Linea].setModify(true);
                }
                CacheMemoryD[Linea].setEtiqueta(Etiqueta);
                CacheMemoryD[Linea].getPalabra()[Palabra] = v;
            }
        } else {
            int count = 0;

            for (int j = firstLine; j < firstLine + 8; j++) {
                CacheMemoryD[Linea].getPalabra()[count] = RAM[j];
                count++;
            }
            CacheMemoryD[Linea].setEtiqueta(Etiqueta);
            CacheMemoryD[Linea].setValid(true);
            CacheMemoryD[Linea].setModify(true);
            CacheMemoryD[Linea].getPalabra()[Palabra] = v;
            Time += 0.01 + 0.1;
        }

    }