Memory unit having arithmetic and logic functions, in particular for graphic processing

Abstract: A memory circuit including memory elements (2) on which the data read, write, and store operations can be arbitrarily performed, the memory elements (2) having a dyadic/arithmetic operation function. In a read/modify/write mode to be executed during a memory cycle and in an interval in which data from the memory elements (2) and data from external devices exist, an operation is executed between the external data and the data in the memory elements (2) and the operation result is stored during a write cycle, thereby achieving a higher-speed operation.

Description: The present invention relates to a data processor with a memory of the kind referred to in the preamble portion of patent claim 1. Such a data processor is known from US-A-39 84 670. The prior art technique will be described by referring to graphic processing depicted as an example in Figs. 1-2. For example, the system of Fig. 1 comprises a graphic area M1 having a one-to-one correspondence with a cathode ray tube (CRT) screen, a store area M2 storing graphic data to be combined, and a modify section FC for combining the data in the graphic area M1 with the data in the store area M2. In Fig. 2, a processing flowchart includes a processing step S1 for reading data from the graphic area M1, a processing step S2 for reading data from the store area M2, a processing step S3 for combining the data read from the graphic area M1 and the data read from the store area M2, and a processing step for writing the composite data generated in the step S3 in the graphic area M1. In the graphic processing example, the processing step S3 of Fig. 2 performs a logical OR operation only to combine the data of the graphic area M1 with that of the store are M2. On the other hand, the graphic area M1 to be subjected to the graphic processing must have a large memory capacity ranging from 100 kilobytes to several megabytes in ordinary cases. Consequently, in a series of graphic processing shown in Fig. 2, the number of processing iterations to be executed is on the order of 10⁶ or greater even if the processing is conducted on each byte at a time. Similarly referring to Figs. 2-3, a graphic processing will be described in which the areas M1 and M2 store multivalued data such as color data for which a pixel is represented by use of a plurality of bits. Referring now Fig. 3, a graphic processing arrangement comprises a memory area M1 storing the original multivalued graphic data and a memory area M2 containing multivalued graphic data to be combined. For the processing of multivalued graphic data shown in Fig. 3, an addition is adopted as the operation to ordinarily generate a composit graphic data. As a result, the values of data in the overlapped portion become larger, and hence a thick picture is displayed as indicated by the crosshatch. In this case, the memory area must have a large memory capacity. The number of iterations of processing from the step S1 to the step S4 becomes on the order of 10⁶ or greater as depicted in Fig. 2. Due to the large iteration count, most portion of graphic data processing time is occupied by the processing time to be elapsed to process the loop of Fig. 2. In the graphic data processing, therefore, the period of time utilized for the memory access becomes greater than the time elapsed for the data processing. Among the steps S1-S4 of Fig. 2, three steps S1, S2, and S4 are associated with the memory access. As described above, in such a processing as an graphic data processing in which a memory having a large capacity is accessed, even if the operation speed is improved, the memory access time becomes a bottleneck of the processing, which restricts the processing speed and does not allow to improve the effective processing speed of the graphic data processing system. In the prior art examples, the following disadvantages take place. (1) In the graphic processing as shown by use of the flowchart of Fig. 2, most portion of processing is occupied by the steps S1, S2, and S4 which use the bus for memory read/write operations, consequently, the bus utilization ratio is increased and a higher load is imposed on the bus. (2) The graphic processing time is further increased, for example, because the bus has a low transfer speed or the overhead becomes greater due to the operation such as the bus control to dedicatedly allocate the bus to the CRT display operation and to the memory access. (3) Moreover, although the flowchart of Fig. 2 includes only four static processing steps, a quite large volume of data must be processed as described before. That is, the number of dynamic processing steps which may elapse the effective processing time becomes very large, and hence a considerably long processing time is necessary. Consequently, it is desired to implement a graphic processing by use of a lower number of processing steps. A memory circuit for executing the processing described above is found in the Japanese Patent Unexamined Publication No. 55-129387, for example. US-A 39 84 670 discloses a LSI device comprising a memory, an arithmetic logic unit, an output register and circuit means for status signals of the device. On such a device according operations can be performed, namely writing or storing data in the memory, arithmetic operations in the arithmetic logic unit and to deliver status data of the device. From US 39 76 982 an image manipulation apparatus is known, comprising memory means, means for extracting selectively addressed sequences from the memory, an information source, a logic means and control means, on which apparatus the operations of writing or storing, of reading and processing of particular information in the memory, of logically combining source and memory information can be performed. SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a data processor with a memory using the same which enables a higher-speed execution of dyadic and arithmetic operations on graphic data and to provide a data processor with a memory circuit which enables easily to implement a priority processing to be effected when graphic are overlapped. This object is accomplished by a data processor as claimed in claim 1. Dependent claims are directed to features of embodiments of the invention as claimed in claim 1. In accordance with the present invention there is provided a unit of memory elements which enables arbitrary operations to read, write and store data, characterized by including a control circuit which can operate in an ordinary write mode for storing in the memory element unit a first data supplied externally based on the first data and a second data in the memory element unit, a logic operation mode for storing an operation result obtained from a logic operation executed between the first and second data, and an arithmetic operation mode for storing in the memory element unit a result data obtained from an arithmetic operation executed between the first data and the second data. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a schematic diagram for explaining an operation to generate a composite graphic image in a graphic data processing system. Fig. 2 is a flowchart of processing applied to the prior art technique to generate a composite graphic data. Fig. 3 is a schematic block diagram for explaining a multivalued graphic data processing. Fig. 4 is a timing chart illustrating the ordinary operation of a memory. Fig. 5 is a block diagram illustrating a memory circuit of an embodiment of the present invention. Fig. 6 is a table for explaining the operation modes of a control circuit. Fig. 7 is a schematic diagram illustrating an example of the control circuit configuration. Fig. 8 is a circuit block diagram depicting an example of a 4-bit operational memory configuration. Figs. 9a to 9c are diagrams for explaining an application example of an embodiment. Fig. 10 is a schematic diagram for explaining a processing to delete multivalued graphic data. DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring the accompanying drawings, the following paragraphs describe embodiments of the present invention in detail. Fig. 4 is a timing chart of a DRAM. First, the operation to access the memory will be briefly described in conjunction with Fig. 4. In this timing chart, ADR is an address signal supplied from an external device and WR indicates a write request signal. These two signals (ADR and WR) are fed from a microprocessor, for example. In addition, RAS is a row address strobe signal, CAS is a column address strobe signal, A indicates an address signal representing a column or row address generated in the timesharing fashion, WE stands for a write enable signal, and Z is a data item supplied from an external device (microprocessor). Excepting the Z signal, they are control signals generated by a DRAM controller, for example. The memory access outlined in Fig. 4 can be sammarized as follows. (i) As shown in Fig. 4, a memory access in a read/write cycle generally commences with a read cycle (I ○) and ends with a write cycle ( ) due to a write enable signal, WE. (ii) Between the read cycle (I ○) and the write cycle ( ), there appears an interval ( ) in which a read data D o and an external data Z (to be written) exist simultaneously. (iii) This interval ( ) is referred to as the operation enabled interval. As described above, the store data Do and the external write data Z exist simultaneously in the interval . As a consequence, the store data Do and the external Z can be subjected to an operation during a memory cycle in this interval by use of the memory circuit having an operation function, thereby enabling the operation result to be written in the memory circuit. Next, another embodiment will be described in which processing to generate a composite graphic data represented as the multivalued data of Fig. 3 is executed. Fig. 5 is a circuit block diagram of a memory circuit applied to a case in which the multivalued data is processed. The configuration of Fig. 5 is adopted because the processing to generate a composite graphic data from the multivalued data indispensably necessitates the arithmetic operation, not the simple logic operation. In the following paragraphs, although the arithmetic operation is described, the circuit configuration includes the sections associated with the logic operation because the logic operation is also used for the multivalued graphic data processing. The circuit arrangement of Fig. 5 includes a control circuit 1', memory elements 2, a DRAM controller 3, external control signals CNT and Cr, a data Y supplied from an external device, a write data Z to the memory elements 2, a read data Do from the memory elements 2, and signals A, WE, CAS, RAS, ADR, and WR. In the embodiment as shown in Fig: 5, the control circuit 1' performs an operation on the read data Do and the external data Y according to the external control signals CNT and Cr; and the operation result, write data Z is written in the memory elements 2. Fig. 6 is a table illustrating the control operation modes of the control circuit 1'. When the external control signals CNT and Cr are set to ⊘, the control circuit 1' operates in a mode where the external data Y is used as a control signal to determine whether or not the read data Do is subjected to an inversion before it is outputted; when the signals CNT and Cr are set to 0 and 1, respectively, the control circuit 1' operates in a mode where the external data Y is outputted without change; and when the CNT signal is set to 1, the control circuit 1' operates in a mode where the read data Do, the external data Y, and the external control signal Cr are arithmetically added. Fig. 7 is a concrete circuit diagram of a circuit implementing the control operation modes. In this circuit arrangement, the arithmetic operation is achieved by use of the ENOR gates G1 and G2, and the condition that the external control signals CNT and Cr are ⊘ and 1, respectively is detected by the gates G6 to G8, and the output from the ENOR gate or the external data Y is selected by use of a selector constituted from the gates G3 to G5. This circuit configuration further includes a NAND gate G9 for outputting a generate signal associated with the carry lookahead function provided to minimize the propagation delay of the carry and an AND gate G10 for generating a propagate signal similarly associated with the carry lookahead function. The logical expressions of the output signals Z, P, and G from the control circuit 1' are as listed in Fig. 21, where the carry lookahead signals P and G each are set to fixed values ( P = 0, G = 1) if the external control signal CNT is ⊘. Fig. 8 is the configuration of a four-bit operation memory utilizing four memory circuits of the embodiment. For the simplification of explanation, only the sections primarily associated with the arithmetic operation mode are depicted in Fig. 8. The circuit diagram includes the memory circuits 11-14 shown in Fig. 5, gates G11 to G28 constituting a carry lookahead circuit for achieving a carry operation, and a register F for storing the result of a carry caused by an arithmetic operation. The memory circuits 11 and 14 are associated with the least- and most-significant bits, respectively. Although not shown in this circuit configuration to simplify the circuit arrangement, the register F is connected to an external circuit which sets the content to ⊘ or 1. The logical expression of the carry result, namely, the output from the gate G29 is as follows. G4 + G3·P4 + G2·P3·P4 + G1·P2·P3·P4 + Cr·P1·P2·P3·P4 When the external control signal CNT is ⊘, Pi and Gi are set to 1 and ⊘, respectively (where, i indicates an integer ranging from one to four) , and hence the logical expression includes only the signal Cr, which means that the value of the register F is not changed by a write operation. Since the intermediate carry signals Gr2 to Gr4 are also set to the value of the signal Cr, three operation states are not changed by a write operation when the external control signal CNT is ⊘. If the external control signal CNT is 1, the carry control signals P1 to P4 and G1 to G4 of the memory circuits 11 - 14, respectively function as the carry lookahead signals, so an ordinary addition can be conducted. As shown in Fig. 6, although the control circuit has a small number of operation modes, the operation functions can be increased by selecting the logic value ⊘, the logic value 1, the write data D to a microprocessor or the like, and the inverted data D of the write data D as the inputs of the external control signal Cr and the external data Y. Figs. 9a to 9c illustrate an example in which above-mentioned circuits are combined. Fig. 9a is a concrete representation of a circuit for the least-significant bit, whereas Fig. 9b is a table outlining the operation functions of the circuit of Fig. 9a. In the following paragraphs, the circuit operation will be described only in the arithmetic operation mode with the external control signal CNT set to 1. Gates G29 - G33 constitute a selector (SEL3) for the external control signal Cr, while gates G34 - G37 configure a selector (SEL4) for the external data Y. The circuit arrangement of Fig. 9a comprises select control signals S⊘ and S1 for selecting the external control signal Cr and select control signals S2 and S3 for selecting the external data Y. Fig. 9c depicts a circuit for the most-significant bit. This circuit is different from that of Fig. 9a in that the selector for the signal Cr is constituted from the gates G38 - G44 so that a carry signal Cri-1 from the lower-order bit is inputted to the external control signal Cr when the external control signal CNT is 1. The selector for the external data Y is of the same configuration of that of Fig. 9c. In the circuit configuration of Fig. 9c, the memory circuit arrangement enables to achieve 16 kinds of logical operations and six kinds of arithmetic operations by executing a memory write access. For example, the processing to overlap multivalued graphic data as shown in Fig. 3 is carried out as follows. First, the select signals S0 to S3 are set to 0, 0, 0, and 1, respectively and the write data Z is specified for an arithmetic operation of Do Plus 1. A data item is read from the multivalued graphic data memory M2 and the obtained data item is written in the destination multivalued graphic data area M1, which causes each data to be added and the multivalued graphic data items are overlapped at a higher speed. Similarly, if the select signals S⊘ to S3 are set to 1 and the write data Z is specified for a subtraction of Do Minus Di, the unnecessary portion (such as the noise) of the multivalued graphic data can be deleted as depicted in Fig. 10. Like the case of the overlap processing, this processing can be implemented only by executing a read operation on the data memory M3 containing the data from which the unnecessary portion is subtracted and by repeating a write operation thereafter on the destination data memory M3', which enables a higher-speed graphic processing. According to the present invention, (1) The multivalued graphic data processing is effected by repeating a memory access two times, and hence the processing such as the graphic data overlap processing and subtraction can be achieved at a higher speed; (2) Since the data operation conducted between memory units is implemented on the memory side, the multivalued graphic processing can be implemented not only in a device such as a microprocessor which has an operation function but also in a device such as a direct memory access (DMA) controller which has not an operation function; and (3) The carry processing is conducted when a memory write access is executed by use of the circuit configuration as shown in Fig. 8, so the multiple-precision arithmetic operation can be implemented only by using a memory write operation, thereby enabling a multiple-precision arithmetic operation to be achieved at a higher speed. As can be understood from the foregoing description, the present invention leads to an advantage that the dyadic operation and the arithmetic operation can be performed on the graphic data at a higher speed. In accordance with the present invention, more-over, the priority processing to be utilized when graphic images overlap and the processing for the color data can be readily implemented.

Claims: A data processor with a memory on which can be performed: a write mode, in which first data (Y) from a data input line are stored in memory elements (2); a logic operation mode, in which a logical operation is performed on said first data (Y) from said data input line and second data (Do), which are stored in said memory elements (2), and in which logic operation mode the result of said logical operation (Z) is stored in said memory elements (2); and an arithmetic operation mode, in which an arithmetic operation is performed on said first data (Y) and said second data (Do), and in which arithmetic operation mode the result of said arithmetic operation (Z) is stored in said memory elements (2), characterized by a selector means (SEL4) for selecting said first data (Y) from input data (Di) according to first and second select signals (S2, S3), comprising three AND gates (G34-G36) and an OR gate (G37), which OR gate receives the output signals of said AND gates and outputs said first data (Y), wherein a first of said AND gates (G36) receives the inverted input data ( Di ) and first and second select signals (S2, S3), a second of said AND gates (G35) receives said input data (Di), said second select signal (S3) and said inverted first select signal ( S2 ) and a third of said AND gates (G34) receives said first select signal (S2) and said inverted second select signal ( S3 ), a selector means (SEL3) for selecting a control signal (Cr) from said input data (Di)and control data (CNT) according to third and fourth select signals (Sø, S1), comprising three AND gates (G30-G32) and an OR gate (G33), which OR gate receives the output signals of said three AND gates and outputs said control signal (Cr), wherein a first of said AND gates (G32) receives the inverted input data ( Di ), said third select signal (Sø) and said fourth select signal (S1), which is gated with the inverted control data ( CNT ), a second of said AND gates (G31) receives said input data (Di), said inverted third select signal (So) and said fourth select signal (S1), which is gated with the inverted control data ( CNT ), a third of said AND gates (G30) receives said third select signal (Sø) and said inverted fourth signal, which is gated with the inverted control data ( CNT ), said control data determining said logic operation or said arithmetic operation, a control circuit (1'), which performs said writing operation, said logic operation and said arithmetic operation on said first data (Y) and said second data (Do) according to said control data (CNT) and said control signal (Cr), yielding said result (Z). A data processor with a memory according to claim 1, wherein said first data (Y) and said second data (Do) are subjected to an exclusive OR operation as a logic operation in said logic operation mode. A data processor with a memory according to claim 1, wherein one of said selector means (SEL3) has an additional input (Cri-1) for selecting a control signal (Cr) according to a carry signal from external devices. A data processor with a memory according to claim 3, wherein said carry input signal (Cr) is identical to the control signal for discriminating said write mode from said logic operation mode.

Inventors: AOTSU HIROAKI, IKEGAMI MITSURU, KIMURA KOICHI, KUWABARA TADASHI, OGURA TOSHIHIKO, AOTSU, HIROAKI, IKEGAMI, MITSURU, KIMURA, KOICHI, KUWABARA, TADASHI, OGURA, TOSHIHIKO
Applicants: HITACHI LTD, HITACHI, LTD.
Application year: 1985
Main classification: G06F7
IPC codes: G09G5, G06T1, G06F7