
   public static String int_to_hex(int input_integer)
    {
      String hex_string;
      hex_string=Integer.toHexString(input_integer);
      while(hex_string.length()<8)
       {
         hex_string = "0" + hex_string;
       }
    
      return hex_string;
     }


    System.out.println("STATISTICS");
    System.out.println("Misses:");
    System.out.println("Total: " + total_misses + " DataReads: " + readmisses + " DataWrites: " + writemisses);
    System.out.println("Miss rate:");
    System.out.println("Total: " + totalmr + " DataReads: " + readmr + " DataWrites: " + writemr);
    System.out.println("Number of Dirty Blocks Evicted from the Cache: " + numevicts);
    System.out.println("CACHE CONTENTS");
    System.out.println();
    System.out.println("Set   V   Tag      D     Word0     Word1     Word2     Word3     Word4     Word5     Word6     Word7");
    System.out.println(set + "  "+ v + "  " + int_to_hex(tag) + "  " + d + "  " + int_to_hex(word0) + "  " + int_to_hex(word1) + "  "  + int_to_hex(word2) + "  " + int_to_hex(word3) + "  " + int_to_hex(word4) + "  " +  int_to_hex(word5) + "  " + int_to_hex(word6) + "  " + int_to_hex(word7));
    System.out.println();
    System.out.println("MAIN MEMORY:");
    System.out.println("Address   Words");
    System.out.println(int_to_hex(address) + "  " + int_to_hex(memword0) + "  " + int_to_hex(memword1) + "  "  + int_to_hex(memword2) + "  " + int_to_hex(memword3) + "  " + int_to_hex(memword4) + "  " +  int_to_hex(memword5) + "  " + int_to_hex(memword6) + "  " + int_to_hex(memword7));


