Abstract:
An information processing apparatus capable of varying the number of wait states for access to the memory according to the access time. An interchangeable external memory unit stores data on the number of wait states for access, and the apparatus reads the data and accordingly controls the number of wait states, thus realizing an optimum process speed.

Description:
This application is a continuation of application Ser. No. 08/048,939, filed Apr. 20, 1993, now abandoned, which was a continuation of application Ser. No. 07/485,474, filed Feb. 27, 1990, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to an information processing apparatus with an interchangeable external memory such as a read only memory (&#34;ROM&#34;) card. 
     2. Related Background Art 
     With conventional information processing apparatus, the number of wait states of the central processing unit (&#34;CPU&#34;), which accesses an interchangeable external memory, is either fixed by hardware incorporated in the apparatus or controlled by hardware provided in the external memory. 
     However, such conventional structure has been associated with the following drawbacks: 
     (1) When the number of wait states for access to the external memory by the CPU is fixed by hardware incorporated in the apparatus, increased processing speed cannot be obtained even with an external memory having higher access speed (which is capable of functioning with a fewer number of wait states) because the number of wait states is fixed in the hardware of the apparatus. 
     (2) When the number of wait states for access to the external memory by the CPU is controlled by hardware of the external memory, each external memory has to be provided with hardware for controlling the number of wait states. 
     Also, a signal line is required for controlling the number of wait states when interfacing with the external memory. 
     SUMMARY OF THE INVENTION 
     In consideration of the foregoing, an object of the present invention is to provide an apparatus capable of varying the number of wait states for access to an external memory by the CPU. 
     Another object of the present invention is to provide an apparatus capable of effecting a process depending on the access time of the memory. 
     The foregoing objects can be attained, according to an embodiment of the present invention, by an information processing apparatus comprising: 
     an interchangeable external memory for storing data therein and holding information on the number of wait states for access; 
     a processor for accessing said external memory and processing the data stored therein; 
     a reader for reading, from the external memory, the information on the number of wait states for access; 
     a setting device for setting the number of wait states for accessing the external memory by the processor, based on the information on the number of wait states for access read by the reader; and 
     a controller for controlling the access by the processor, according to the number of wait states set by the setting means. 
     In another embodiment of the present invention, the information processing apparatus comprises: 
     a plurality of interchangeable external memories for storing data, each holding information on the number of wait states for access; 
     a processor for accessing the plurality of external memories and processing the stored information therein; 
     a reader for reading the information on the number of wait states for access, from each of the plurality of external memories; 
     a setting device for setting the number of wait states for access to the external memories by the processor, based on the plurality of information on the number of wait states for access, read by the reader; and 
     a controller for controlling the access by the processor, according to the number of wait states set by the setting device. 
     In still another embodiment of the present invention, the information processing apparatus comprises: 
     an interchangeable external memory for storing data therein and holding a number of wait states for access; 
     a processor for accessing the external memory and processing the data stored therein; 
     a reader for reading, from the external memory, the number of wait states for access; 
     a setting device for setting the number of wait states for access to the external memory by the processor at the value read by the reader; and 
     a controller for controlling the access by the processor, according to the number of wait states set by the setting device. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of an information processing apparatus in accordance with an embodiment of the present invention; and 
     FIG. 2 is a flow chart of a process for setting the number of wait states. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Now the present invention will be clarified in more detail by an embodiment as shown in FIG. 1. 
     FIG. 1 shows a CPU 1 for controlling the entire apparatus; an address bus 2 for transferring an address signal indicating the object of control of the CPU 1; a data bus 3 for transferring data among different units of the apparatus; a ROM 4 for storing various programs and data, including a program for setting the number of wait states to be explained later, the ROM can be replaced by an equivalent device capable of storing programs and data; random-access memory 5 (&#34;RAM&#34; 5) used as a work area for the CPU 1; and interface circuit 6 composed ordinarily of a buffer circuit for an external memory; and an external memory 7 which can be a non-volatile memory such as a ROM or a non-volatile random-access memory (&#34;NVRAM&#34;) where access is made by the CPU 1 through the external memory interface circuit 6. 
     A programmable wait state number control circuit 8 controls the number of wait states for accessing the external memory 7 by the CPU 1, according to the number of wait states designated in the program of the CPU 1. A wait state number control signal 9 is provided by the control circuit 8 to the CPU 1. 
     FIG. 2 is a flow chart of a process for setting the number of wait states for access to the external memory. 
     Referring to FIG. 2, the following explains the sequence for setting the number of wait states for accessing the external memory 7. First, prior to accessing the external memory 7, step 10 sets the largest settable number of wait states in the programmable wait state number control circuit 8. Then, in step 11, the CPU 1 reads, through an external memory interface circuit 6, information on the number of wait states provided in advance by the external memory 7, such as a ROM or NVRAM. The information can be the number of wait states, or the access time of the external memory 7. Step 12 determines the number of wait states, based on the information from the number of wait states obtained in the step 11. The number is either obtained directly from the information, if the information represents the number of wait states, or calculated by the CPU 1 if the information indicates the access time of the external memory 7. Then step 13 sets the number of wait states, determined in the step 12, for the programmable control circuit 8. 
     Through the above-explained process, the number of wait states for accessing the external memory 7 by the CPU 1 through the interface circuit 6 is set in the programmable wait state number control circuit 8. Accordingly, access to the external memory 7 by the CPU 1 is thereafter made using this number of wait states. 
     The foregoing embodiment allows the CPU 1 to access the external memory 7 with the number of wait states derived from the access speed thereof, without hardware for controlling the number of wait states in the external memory. 
     In the foregoing embodiment, the external memory 7 is assumed to have only one number of wait states, but a plurality of memory means with different numbers of wait states may be present in the external memory 7. In such case, information on such different numbers of wait states are stored in advance by the memory means of the external memory 7, and step 11 in FIG. 2 reads the information respectively from the memory means of the external memory 7 and selects the largest number of wait states among the information obtained. Accordingly, access to the external memory 7 is made with the number of wait state matching the lowest access speed of the plurality of memory means present in the external memory 7. 
     As explained in the foregoing, the present invention obtains information on the number of wait states for accessing an interchangeable external memory by a CPU and controls the number of wait states for accessing external memory according to the information obtained. This allows access to the external memory where the number of wait states matches the access speed of the external memory, and performs this without extra hardware in the external memory for controlling the number of wait states.