Data storing device having a plurality of registers allotted for one address

Abstract: A data storing device has at least first to third registers (R1, R1' and R2). When the first register (R1) is accessed, the second register (R1') is set into an accessible state in a preset cycle succeeding to a cycle in which the first register (R1) is accessed. The same address as that of the second register (R1') is assigned to the third register (R2) and access to the third register (R2) is inhibited in a preset cycle in which the second register (R1') is accessed. An access control circuit (14, 15, 16, 17) controls permission/inhibition of access to the second and third registers (R1' and R2).

Description: This invention relates to a data storing device used as an I/O (input/output) register of a single-chip microcomputer, for example, and more particularly to a data storing device having a plurality of registers allotted for one address. In general, in the I/O registers of a single-chip microcomputer, one address is assigned to each register and only one register corresponding to a designated address can be accessed. In Fig. 1, the construction of an extracted portion of the above I/O register section and the peripheral circuit thereof is shown. A 16-bit address signal AD is input to an address decoder section 12 via an address bus 11. The address signal AD is decoded by the address decoder section 12 which in turn outputs a decoder signal ADOn (n = 1, 2, 3, ---). 8-bit data stored in a register Rn (n = 1, 2, 3, ---) corresponding to an address An (n = 1, 2, 3, ---) designated by the signal ADOn is output in synchronism with the rise (or fall) of an R/W (read/write) control signal S and then transferred along a data bus 13. However, with the above construction, when an attempt is made to increase the number of I/O registers to expand the register area, it is required to make various modifications for the address area. For example, when address areas allotted for the RAM and ROM are provided to follow an address area allotted for the I/O register, the address areas for the RAM and ROM must be modified in order to expand the register area. Otherwise, it becomes necessary to provide an additional register area in an address area arranged after the address area for the RAM or ROM. In the former case, a large-scale modification is necessary and the specification must be greatly modified. Further, in the latter case, the modification scale can be made small, but the I/O register area is not continuous and becomes hard to deal with. Microprocessors and Microsystems Vol. 9, No. 1 January/February 1985 p. 21-23 shows a data storing device with memory duplication and a flip-flop for selecting one of two banks of memory, according to the output of an address decoder, such that the same address space can be used to access twice as much memory. Accordingly, an object of this invention is to provide a data storing device which may permit the register area to be easily expanded even in a limited address area. The invention provides a data storing device as set out in claim 1. In this invention, in order to effectively use a limited address area, two (second and third) data holding means are allotted for one address. The two (second and third) data holding means cannot be accessed only by selecting the address assigned to them and are selected according to a logical product of the selected address of the present cycle and an address selected in a cycle immediately preceding the present cycle. Therefore, even if the addresses assigned to the two (second and third) data holding means are the same, only one of the data holding means can be selected in one cycle. Thus, it becomes possible to allot two data holding means for one address. Therefore, a data storing device in which the register area can be expanded in a limited address area can be provided. This invention can be more fully understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 is a circuit diagram showing the construction of the I/O register section of a single-chip microcomputer and a peripheral circuit thereof used as an example of the conventional data storing device; Fig. 2 is a circuit diagram showing the construction of the I/O register section of a single-chip microcomputer and a peripheral circuit thereof, for illustrating a data storing device according to one embodiment of this invention; and Fig. 3 is a timing chart for illustrating the operation of the circuit shown in Fig. 2. Fig. 2 is a circuit diagram showing the construction of the I/O register section of a single-chip microcomputer and a peripheral circuit thereof used as an example of a data storing device according to one embodiment of this invention. The circuit has a register section which is expanded to 16-bit construction by adding registers R1', R2' and R3' of 8-bit construction to the 8-bit register section shown in Fig. 1. However, since the 8-bit data bus 13 is used, two accessing operations are effected for each access to the 16-bit construction. Addresses A2, A3 and A4 are respectively assigned to the added registers R1', R2' and R3' and the addresses for the other registers R1, R2, R3, --- are kept unchanged. As a result, the addresses A2, A3 and A4 of the added registers R1', R2' and R3' are each assigned to two different registers. An address decoder section 12 is supplied with a 16-bit address signal AD via an address bus 11 and a decoder signal ADOn (n = 1, 2, 3, ---) is derived from the address decoder section 12. The signal ADO1 is supplied to the register R1 to which the address A1 is assigned, and the signals ADO2 to ADO4 are respectively supplied to one-side input terminals of AND gates 15 and one-side input terminals of AND gates 16. Further, the signals ADO1 to ADO4 are supplied to an access control section 14 and the signals ADO5, --- are supplied to the registers R5, ---to which the addresses A5, --- are assigned. A control signal AC2 output from the access control section 14 is supplied to the other input terminals of the AND gates 16 and an input terminal of an inverter 17. A control signal AC1 (which is an inverted signal of the control signal AC2) output from the inverter 17 is supplied to the other input terminals of the AND gates 15. The output signals of the AND gates 15 are supplied to the registers R2 to R4 to which the addresses A2 to A4 are respectively assigned and the output signals of the AND gates 16 are supplied to the registers R1' to R3' to which the addresses A2 to A4 are respectively assigned. An R/W (read/write) control signal S is supplied to the registers Rn (n = 1, 2, 3, ---) and the registers R1' to R3' so as to control the data readout and write-in operations. Data stored in the registers Rn (n = 1, 2, 3, ---) and the registers R1' to R3' is transferred via the 8-bit data bus 13. With the above construction, the registers R1' and R2, registers R2' and R3, and registers R3' and R4 which will be respectively designated by the addresses A2, A3 and A4 each assigned to two registers are selected by the logical products of the decoder signals ADO2 to ADO4 output from the address decoder section 12 and the control signal AC1 or AC2 output from the access control section 14. When the signal ADOn for specifying the address An (n = 1, 2, 3, ---) becomes effective (or is set to an "H" level), the access control section 14 first sets the control signal AC1 to an "H" level and sets the control signal AC2 to an "L" level, and then, sets the control signal AC2 to the "H" level and sets the control signal AC1 to the "L" level in the succeeding cycle. When the control signals AC1 and AC2 are respectively set at the "H" and "L" levels and if the address An (n = 1, 2, 3, ---) is selected, the decoder signal ADOn (n = 1, 2, 3, ---) is supplied to the register Rn (n = 1, 2, 3, ---) designated by the corresponding address. At this time, since the control signal AC2 is set at the "L" level, the output signals of the AND gates 16 are all set to the "L" level and the decoder signals ADO2 to ADO4 are inhibited from being supplied to the registers R1' to R3'. In the succeeding cycle set after the address updating operation is effected, if the address control section 14 detects that one of the decoder signals ADO2 to ADO4 becomes effective (or is set to the "H" level), the control signal AC2 is set to the "H" level and the control signal AC1 is set to the "L" level. Thus, the expanded registers R1' to R3' are accessed. At this time, since the output signals of the AND gates 15 are set at the "L" level, the registers R2 to R4 are prevented from being accessed. Next, the operation of reading out data from the registers shown in Fig. 2 is explained with reference to the timing chart shown in Fig. 3. An address PC (program counter) is an address area in which the program of a CPU (not shown) is stored and is designated by an address other than that for the register area. The control signals AC1 and AC2 are controlled by the access control section 14 so as to be respectively kept at the "H" and "L" levels in a cycle succeeding to that of an address (PC+m) (m = 0, 1, 2, 3). For example, one of the addresses A1 to A4 is input in the cycle 21, one of the registers R1 to R4 is accessed by the input address. In the cycle 22 succeeding the cycle in which one of the addresses A1 to A4 is input, the control signal AC2 is always effective (or is kept at the "H" level). Therefore, if one of the addresses A2 to A4 is input in the cycle 22, one of the registers R1' to R3' is accessed by the input address. Therefore, when the register R2 is accessed as a 16-bit register (that is, R2 and R2'), the address A3 is designated immediately after the address A2 is designated. Further, since the CPU generally executes the next instruction after the access to the register is completed, the address corresponds to a location in which the instruction code is stored and is different from that for the I/O register. In other words, the signal AC1 is always kept effective (or is kept at the "H" level) in the initial state in which the register is accessed. Thus, in a case where the added register is accessed as a 16-bit register, successive accesses are effected, and in a case where only the register having no added register is accessed as an 8-bit register, the access may be made for each byte. In general, an 8-bit single-chip microcomputer which has 16-bit registers has a double-byte instruction. Therefore, in the access operation in which an 8-bit register is dealt with as a 16-bit register, a double-byte instruction can be used for effecting the successive accesses. When the register is accessed as a 8-bit register, the access is made by use of a single-byte instruction (for accessing for each byte). With the above construction, since a plurality of registers can be allotted for one address, an address space can be effectively used. In the prior art, when registers are additionally provided, it is necessary to assign new addresses to the added registers and identify the addresses, but in this invention, new addresses are not necessary. Further, even if the address area is limited, it is not necessary to change the addresses which have been set before the registers or the like are additionally provided. In particular, when the register area is expanded, for example, when an 8-bit I/O register is expanded to a 16-bit I/O register by use of an 8-bit microcomputer and it has a function of successively accessing the expanded register as an instruction, the specification which can be easily understood by the user can be obtained. In the above embodiment, the I/O register is explained as an example, but this invention can be applied to general registers or other various types of registers. As described above, according to this invention, there can be provided a data storing device in which a plurality of registers are allotted to one address and the register area can be expanded within a limited address area since registers of a number larger than the number of addresses can be used.

Claims: A data storing device having a plurality of data holding means to which respective addresses are assigned and permitting data to be read out from the data holding means designated by a selected address, wherein said plurality of data holding means includes first data holding means (R1) for holding data; second data holding means (R1') set to be in an accessible state only in a cycle immediately succeeding a cycle in which said first data holding means (R1) is accessed; and third data holding means (R2) having the same address as that of said second data holding means (R1') allotted thereto and set to be in an access inhibition state only in said cycle in which said second data holding means (R1') is in an accessible state; and said data storing device includes access control means (14,15,16,17) controlling permission/inhibition of access to said second and thirs data holding means (R1' and R2) to select one of said second and third data holding means (R1' and R2), to which the same address is assigned, to be accessible. A data storing device according to claim 1, characterized in that a first address (A1) is assigned to said first data holding means (R1) and a second address (A2) which is higher than the first address (A1) by one is assigned to said second and third data holding means (R1' and R2). A data storing device according to claim 1, characterized in that said first, second and third data holding means (R1, R1' and R2) are used as I/O registers of a single-chip microcomputer and formed in the same chip. A data storing device according to claim 1, characterized by further comprising decoder means (12) for receiving an address signal (AD) and decoding the address signal (AD) to select said first to third data holding means (R1, R1' and R2). A data storing device according to claim 4, characterized in that said access control means includes an access control section (14) for receiving an output of said decoder means (12); and logic gate means (15, 16, 17) for selecting one of said second and third data holding means (R1' and R2) according to an output of said decoder means (12) and an output of said access control section (14). A data storing device according to claim 5, characterized in that said logic gate means includes a first AND gate (16) for receiving an output of said decoder means (12) at one input terminal and receiving an output signal (AC2) of said access control section (14) at the other input terminal and supplying an output to said second data holding means (R1'); and a second AND gate (15) for receiving an output of said decoder means (12) at one input terminal and receiving an inverted signal (AC1) of the output signal (AC2) of said access control section (14) at the other input terminal and supplying an output to said third data holding means (R2).

Inventors: YOSHIDA KAZUYOSHI, YOSHIDA, KAZUYOSHI, Yoshida, Kazuyoshi, c/o Intellectual Pty Division
Applicants: TOSHIBA KK, TOSHIBA MICRO ELECTRONICS, KABUSHIKI KAISHA TOSHIBA, TOSHIBA MICRO-ELECTRONICS CORPORATION
Application year: 1991
Main classification: G06F12
IPC codes: G06F12, G06F15