@Override
  public void Notify(BitWord bit_word, OutputId sender, InputId receiver,
                     Object arg) {
    switch (sender) {
      case MemoryInternal:
        if (!(arg instanceof Memory.MemoryStateUpdate)) {
          throw new IllegalArgumentException(
              "Expected MemoryStateUpdate from memory.");
        }
        Memory.MemoryStateUpdate m_update = (Memory.MemoryStateUpdate)(arg);
        view_.UpdateMemory(m_update.address, m_update.value);
        break;
      case GprInternal:
        if (!(arg instanceof RegisterFile.RegisterStateUpdate)) {
          throw new IllegalArgumentException(
              "Expected RegisterStateUpdate from gpr.");
        }
        RegisterFile.RegisterStateUpdate gpr_update =
            (RegisterFile.RegisterStateUpdate)(arg);
        view_.UpdateGpr(gpr_update.register_number, gpr_update.value.ToInt());
        break;
      case Ir:
        view_.UpdateSpr("IR", bit_word.ToInt());
        break;
      case Mar:
        view_.UpdateSpr("MAR", bit_word.ToInt());
        break;
      case Mdr:
        view_.UpdateSpr("MDR", bit_word.ToInt());
        break;
      case Pc:
        view_.UpdateSpr("PC", bit_word.ToInt());
        view_.SetCurrentMemoryLine(bit_word.ToInt());
        break;
      case Psr:
        view_.UpdateSpr("PSR", bit_word.ToInt());
        break;
      default:
        throw new IllegalArgumentException(
            "Unexpected notification from: " + sender);
    }
  }