BACKGROUND OF THE INVENTION
1. Field of the Invention
This invention relates to digital data processing systems, and particularly to such systems of the microprocessor size.
2. Description of the Prior Art
Within recent years the uses of data processing systems have expanded into a great variety of applications. With the number of uses increasing, the number and types of processing systems have also increased. Within the past decade, so-called minicomputers have begun to proliferate for use in tasks that do not require large scale processing systems. As with big systems, the minicomputers operate with changeable programs written in common programming languages such as Fortran and PL/1. The program flexibility of both the large and small computers is very useful in applications using continuously changing programs. The efficiency of such processing systems, however, is dependent greatly upon the efficiency of the Fortran program and of the Fortran compiler. For dedicated applications in which the programs remain constant, these systems are generally inefficient. It has been proven to be much more efficient to write dedicated control application programs in machine language on a smaller system designed for specialized applications.
A line of smaller data processing systems, termed microprocessors or microcomputers, has evolved to handle fixed-program applications. Since the program is fixed and not readily changed, it is stored in a read-only memory unit to protect against erasure or modification.
The advent of these microprocessors has been hastened by recent developments in integrated circuitry. A relatively large memory along with the data selection means for addressing the memory locations can now be formed on a single integrated circuit (IC) unit or chip. Arithmetic logic operators and data registers can also be formed on IC chips. Integrated circuitry has allowed microprocessors to be built smaller than previous minicomputers and as the length of the paths decreases, the processing speeds increase.
The architecture of prior microprocessors has tended to follow basic computer design, only on a smaller scale. Microprocessors have resembled small minicomputers. The reaction to the advent of integrated circuitry has been an attempt to combine as many elements as possible in a single IC chip. Some of the most recent microprocessors have been built completely on a single chip. The fabrication of such complicated IC chips, however, is very expensive.
While traditional computer architecture allows microprocessors to perform rapidly and accurately, it does not take full advantage of the capabilities of a small system. A simpler design may be able to accomplish the same results in a faster time. In addition, the cost of a microprocessor could be significantly decreased by making use of commercially available off-the-shelf IC packages instead of the complicated customized IC chips comprising the entire microprocessor.
Also, in accordance with traditional computer design, most prior microprocessors have a read/write memory for intermediate data storage in addition to the program storage read-only memory. These read/write memories outside the central processing unit reduce the processor speed because of the amount of time needed to address the memory and receive back the data.
SUMMARY OF THE INVENTION
The present invention presents a central processing unit (CPU) for a microprocessor with a relatively simple architecture enabling it to perform data processing operations faster than before possible. The control unit of the CPU can issue commands simultaneously to several controlled units, and a parallel bus architecture allows data to flow through several such units at the same time. The control unit has a read-only memory (ROM) with storage for, preferably, 256 micro control program instructions allowing for a macro instruction set of 68 commands which include a full range of arithmetic and logical operations. This macro instruction set is employed by the microprocessor user to prepare his dedicated program which is stored in a ROM external to the CPU.
A relatively large general register or "scratchpad" memory is also provided in the CPU. This scratchpad preferably has 256 eight-bit registers which provides adequate storage for most dedicated control applications within the CPU. This large scratchpad unit eliminates the need for read/write memories external of the CPU and thereby allows the processor operations to be accomplished much more quickly.
An advantage of all of the above is that a microprocessor using the present invention can be inexpensive and yet compact. It can be constructed with only 48 off-the-shelf integrated circuit chips at a minimal cost. The entire CPU can be assembled on a single printed circuit board measuring no more than eight inches square.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic of a microprocessor using a central processing unit embodying the present invention;
FIG. 2 is a detailed schematic of the central processing unit of FIG. 1; and
FIG. 3 is a detailed schematic of the control unit of FIG. 2.
DESCRIPTION OF THE PREFERRED EMBODIMENT
The Microprocessor
Referring more particularly to the drawings and initially to FIG. 1, there is shown the configuration of a microprocessor. The various elements of the microprocessor are shown as blocks, and the data flow between elements is indicated by single lines. The heavier lines represent a plurality of transmission paths, the number of which depends upon the number of data bits being transferred in parallel. Preferably, 8-bit data words are used with the present invention, so that the heavier lines in the drawing represent 8-bit data busses. The thin lines represent single or multiple control lines. All of the elements of the microprocessor are connected to the central processing unit (CPU) 10 which will be described in detail hereinafter. The other elements of the microprocessor include a read-only memory (ROM) 12 which is typically used for storage of the macro instruction program. As mentioned above, a read-only memory is used for the macro program storage instead of a read/write memory to protect the program against inadvertent erasure or modification. The ROM 12 may also contain data tables of various kinds. Optionally, a read/write memory 14 may be added to the microprocessor to provide additional storage for data.
The CPU 10 communicates with the ROM 12 via an address bus 16 and a memory bus 18. The CPU 10 sends an address corresponding to the current instruction to the ROM 12 on the address bus 16. The ROM 12 receives the address, retrieves the instruction from that address, and returns it to the CPU 10 via memory bus 18. When the ROM 12 is ready to transmit the instruction over the memory bus 18, it communicates its readiness by sending a signal over memory ready line 20. This sequence permits the CPU to be used with memories of any speed, that is, the memories need not be synchronized to the CPU clock. After receiving the memory ready signal on the memory ready line 20, the CPU 10 reads the instruction, interprets it, and executes it. In executing the instruction, the CPU 10 may require additional data from either the ROM 12 or the optional read/write memory 14. This data is retrieved by addressing the appropriate memory via address bus 16 and receiving the requested data on memory bus 18. Preferably, the address bus 16 has a 16-bit capacity. This permits access to up to 64K memory locations. The 16-bit address bus is represented in FIG. 1 by dual 8-bit, or heavier, lines.
Data can be stored in the read/write memory 14 using a similar sequence. The CPU 10 sends an address on the address bus 16 corresponding to the desired data storage location. A signal is also sent over the memory control line 22 to inform the memory 14 that the address is for data storage and not for data retrieval. At the same time, the data to be stored is placed on a data out bus 30. The memory 14 accepts the data and stores it in the proper location address. When the memory has completed the loading, it communicates its completion to the CPU by sending a signal over the memory ready line 20.
The CPU 10 communicates with one or more input/output (I/O) interfaces 28. The CPU 10 is connected to I/O interfaces 28 via the address bus 16, the data out bus 30, an input bus 32, and an I/O control line 34. The CPU communicates with the I/O interfaces by executing special I/O macro instructions received from the ROM 12. In order to execute these instructions, the CPU 10 places an address on the lower-half of the address bus 16. If the instruction is an output instruction, the CPU will also place data for output on the data out bus 30 and send a signal over the I/O control line 34. The I/O interface selected by the address responds to the address on the address bus 16 and the I/O control signal on line 34 by accepting the data on the data out bus 30. If the instruction is an input instruction, no signal is sent over I/O control line 34, and the I/O interface selected by the address will respond to the address on the address bus 16 by placing data for input on the input bus 32. The CPU 10 then accepts the data from the input bus 32.
The operations of the CPU are externally controlled through an interrupt line 24 and a run/halt line 28. If an interrupt signal is sent over the interrupt line 24, the CPU executes a jump to a subroutine stored in a predefined location in the micro control program memory. This feature facilitates rapid response to an external signal and provides for easy interface to real-time devices. If a halt signal is sent over the run/halt line 26, the CPU is placed in the halt state and no further instructions are executed until the halt signal on line 26 is removed.
Central Processing Unit
The CPU 10 of FIG. 1 is shown in more detail in FIG. 2, in which the various registers and other elements are depicted by blocks. As in FIG. 1, the heavier lines represent 8-bit data busses, and the thin lines represent single or multiple control lines. The operation of the CPU is controlled by a control unit 40. The control unit 40, which will be described in more detail later, receives and interprets the macro program instructions from ROM 12 and executes the instructions by transferring data in and out of the various registers and other elements. In order to accomplish this, the control unit 40 is directly connected by control lines and data busses to each of the registers an units of the CPU.
The CPU also has three single-word 8-bit operand registers designated the A operand register 42, the B operand register 44, and the C operand register 46. These registers are of the type known as parallel-in-parallel-out in that, upon receipt of a load signal from the control unit 40 over associated control lines, the eight-bit data word on bus 30 is loaded in parallel into the register on the next clock pulse .phi.c. Each operand register unit can be built from two 4-bit IC registers.
Operand register 42 is controlled by the control unit 40 by means of a single control line 48. Input data for storage from data out bus 30 is loaded into register 42 through connection 50 on a clock pulse .phi.c when line 48 carries a load signal. Register 42 supplies an 8-bit data word to one input of a multiplexor 52 over an 8-bit bus 54.
Similarly, the loading of operand register 46 is controlled by a single control line 56 from the control unit 40. It receives input data from data bus 30, at connection 57, and outputs data to the multiplexor 52 over bus 58. Bus 58 is also connected to the scratchpad 60, supplying the address for all scratchpad operations.
The loading of operand register 44 is controlled by load control line 62 from control unit 40. Operand register 44 receives data from the data out bus 30 via connection 64. Operand register 44 is also connected to an eight-bit bus 66 which allows the data in register 44 to be supplied as an 8-bit word to the B side of arithmetic logic unit 68.
A unique feature of this CPU is its large general register unit or "scratchpad" 60. In the preferred architecture of the CPU, the scratchpad 60 is a random access memory unit having 256 eight-bit registers. Such a unit can be constructed from eight interconnected 256 .times. 1 RAM's forming a 256 .times. 8 organization. The micro control program reserves three of these registers for use as an accumulator, a stack pointer, and a carry register. The remaining registers can be used by the macro programmer in various modes, including modes normally reserved for registers and modes normally restricted to main memories. The large scratchpad unit allows the functions of registers and a main memory to be combined and thus eliminates the need for a main random access storage subsystem. In many microprocessor applications, the amount of intermediate data storage required is quite moderate. For a large proportion of dedicated control applications, it has been found that 2048 bits of data storage are ample. Providing data storage capability within the CPU and eliminating the need for a random access memory outside the CPU presents possibilities for very efficient programming of the microprocessor resulting in faster processing times than before possible.
The scratchpad write/read functions are controlled by the control unit 40 through a single control line 70. Data can be written on the scratchpad 60 on a clock pulse .phi.c with the data being supplied through a connection 72 from data out bus 30 when the control unit 40 places a write signal on line 70. The scratchpad address is supplied through bus 58 from operand register 46. Data is outputted from the scratchpad 60 through bus 74 to the multiplexor 52.
An address counter 76 is included in the CPU for the storage of address information for its output on the address bus 16. Preferably, the address counter has a 16-bit capacity to enable the CPU to have access to up to 64K macro memory locations. Only the lower half of the address counter need be used to store I/O address, since this is sufficient capability to enable the CPU to have access to 256 I/O devices. The address counter can be constructed from four interconnected four-bit IC counters such as, for example, 9316 IC units manufactured by the Fairchild Semiconductor Division of the Fairchild Camera and Instrument Corporation and described and explained in the 1972 Fairchild Semiconductor TTL Data Book on pages 8-54 to -59. These are interconnected to define two eight-bit counters which comprise the lower and upper halves of the address counter 76. Each half of the counter may be set to an eight-bit count on command from the control unit 40. Also, on command from the control unit 40, the 16-bit counter may be incremented by one count on receipt of a clock pulse .phi.C. The operations of the address counter 76 are controlled by the control unit 40 by means of three control lines 78. The control unit 40 applies an enable signal on the first control line 78 to cause the upper half of the counter to be set to a count in accordance with the existing 8-bit data word on the data out bus 30. Likewise, the control unit 40 applies an enable signal on the second control line 78 to cause the lower half of the counter to be set to a count in accordance with the data word on bus 30. These count settings are accomplished by loading the selected half of the counter through connection 80. Also, the control unit 40 applies an enable signal on the third control line 78 to cause the entire 16-bit counter to be incremented by one count on receipt of a clock pulse. The address counter 76 outputs a 16-bit address over the address bus 16. The address bus 16 carries this address out of the CPU to memories 12 and 14 and the I/O interfaces 28 already described or to the multiplexor 52.
The multiplexor 52 is controlled by the control unit 40 over three control lines 82 to select which of the eight 8-bit data words applied to the multiplexor will be gated to the "A" side of the arithmetic logic unit 68. The multiplexor 52 receives data from eight sources: from the I/O interfaces 28 over input bus 32, from the ROM 12 or the optional read/write memory 14 over memory bus 18, from the control unit 40 over bus 84, from either half of the address counter 76 over the upper and lower halves of the address bus 16, from the A operand register 42 over bus 54, from the C operand register over bus 58, and from the scratchpad 60 over bus 74. The multiplexor selects from one of these eight inputs and passes the data therefrom onto bus 86 for input on the "A" side of the arithmetic logic unit 68. The multiplexor can be constructed, for example, from eight Fairchild 93151/54141 or 74151 units described on pages 8-265 to -271 of the aforementioned 1972 Fairchild Data Book.
The arithmetic logic unit (ALU) 68 performs the operations on the data. The ALU 68 has the capability of carrying out up to 32 possible operations on two operands including adding, substracting, incrementing, decrementing, logical AND, logical OR, exclusive OR, zero, FF (hexadecimal), or passing through either operand unchanged. The ALU can be constructed, for example, from Fairchild 9341/54181 or 74181 units described on pages 8-157 to -161 of the 1972 Fairchild Data Book. The operation of the ALU is controlled from the control unit 40 through five control lines 88. The two operands are input to the ALU by busses 86 and 66. Bus 86 feeds the "A" side of the ALU as selected by the multiplexor 52. Bus 66 feeds the "B" side of the ALU from the B operand register 44. The result is outputed on the "F" side of the ALU to data bus 90. Data bus 90 carries data to the control unit 40 and to the data out bus 30. The data out bus 30 transports the data to any of the other registers in the CPU or out of the CPU to memory or I/O.
The ALU 68 is connected to a single-bit carry register 92 via connecting lines 94. The carry register can be set or cleared depending upon the result of ALU arithmetic operations. The carry is also controlled through lines 96 by the control unit 40.
The three operand registers 42, 44, and 46, the scratchpad 60, and the address counter 76 are all capable of receiving input data placed on the data out bus 30 from the "F" side of the ALU 68. This parallel bus architecture allows the performance of many simultaneous operations. The control unit 40 dictates which units are to accept inputs from the data out bus. Since all units can accept input simultaneously, and since the control unit 40 can issue several simultaneous commands to different units over its various control lines, the microprogramming of the CPU can contain complex instructions to perform several simultaneous operations. For instance, the contents of the A operand register 42 can be gated through the multiplexor 52 and into the ALU 68 where it can be added to the contents of the B operand register 44 and the result from the ALU can be stored into one or more registers and the scratchpad 60 simultaneously via the data out bus 30 all within a single clock interval. In addition, during this clock interval, the carry can be set or cleared, and the address counter can be incremented. Thus, the CPU can accomplish operations with a minimum of microprogrammed instructions.
Control Unit
The control unit 40 of FIG. 2 is illustrated in greater detail in FIG. 3. The control unit regulates the operation of the CPU by issuing signals over the various control lines. These signals are generated in response to macro instructions by a micro control program stored in a ROM 100 within the control unit 40. The micro control program includes instructions which bring the macro program instructions into the CPU from the ROM 12, decode the macro instructions, and execute them by moving data over the various data paths of the CPU. Preferably, the control unit 40 includes a 256 .times. 32 ROM for micro control program storage. This provides sufficient storage for a 256-instruction micro control program with each instruction comprising a 32-bit word (b.sub.1 through b.sub.32).
Each 32-bit instruction contains both data and control bits. Three control bits are employed to control a multiplexor 102 via control lines 104. Another bit controls the interrupt flip-flop 105 over line 106. One bit is employed for I/O control via the I/O control line 34. One bit is employed for memory control via the memory control line 22. Eight bits are data carried by data bus 84 to the multiplexor 52. One bit controls the loading of the A operand register 42 via control line 48. Three bits are used to control the address counter 76 over the control lines 78. One bit control the loading of the C operand register 46 via control line 56. Three bits are used to control the multiplexor 52 over control lines 82. One bit controls the scratchpad 60 through line 70. Five bits are used to control the various arithmetic and logical operations of the ALU 68 over the control lines 88. Three bits communicate with the carry 92 over control lines 88. The final bit controls the loading of the B operand register 44 via line 62.
The ROM 100 is addressed by a program counter 108 via bus 110. The counter 108 has two modes of operation: incremental loading of the ROM 100, or loading a specific address location in accordance with data imputted from the ALU 68. The mode of operation of the program counter 108 is controlled by the signal sent by the multiplexor 102 over control line 112. In the incremental mode of operation, the program counter 108 is incrementally actuated by clock pulses .phi.c so as to count in an upward direction. In the specific-address mode of operation, the multiplexor 102 supplies a load signal on line 112. The program counter 108 receives this load signal at its loading control input L. At the next clock pulse .phi.c, the counter 108 is set to a count in accordance with the eight-bit data present on the data out bus 30 through bus 90. This count serves as an address for addressing a specific location in the ROM 100. The counter can be constructed, for example, from a single Fairchild 9316 already described.
The program counter 108 is usually operated in the incremental mode. After a micro control instruction has been executed, the program counter 108 at the next clock pulse .phi.c will load the next address into the ROM 100 so that the next micro instruction in sequence will be executed. However, if the last micro instruction is a jump instruction, the program counter 108 may go into the specific-address mode of operation and may not load the next address into the ROM 100, but instead load the ROM 100 with the address present on bus 90. These jump instructions depend upon certain machine status conditions, such as memory ready, run/halt, interrupt, or a carry. During the execution of a micro jump instruction, one of these machine status conditions will be examined. The ROM 100 controls the selection of the status condition to be examined by sending a coded three-bit signal over control lines 104 to the multiplexor 102. The multiplexor 102 responds to the signal on lines 104 by selecting one of the machine status condition inputs and passing the selected status condition onto line 112. The machine status inputs to the multiplexor 102 include the memory ready line 20, the interrupt line 24, the run/halt line 26, two lines 96 from the carry 92 which provide the carry bit and the inverted carry bit, and line 106 from the ROM 100. Since at least five machine status inputs are applied to the mutiplexor 102, three control lines 104 are needed to select one of the machine status inputs. The multiplexor 102 can be constructed, for example, from a single Fairchild 93151/54151 or T4151 unit already described. If a TRUE signal is received over the machine status line being examined, this signal is passed onto line 112 and a load signal is received at load control input L of the program counter 108.
For example, if the machine status condition to be examined is memory ready, the proper three-bit signal will be sent over control lines 104 so that the multiplexor 102 will pass the memory ready signal from the memory ready line 20 through the multiplexor 102 and onto line 112. This signal then controls the mode of operation of the program counter 108 through its input at the load control input L. If the memory ready signal is TRUE, the program counter 108 will be loaded from bus 90. Otherwise, the counter 108 will be incremented by one.
Any of the other machine status conditions, such as interrupt, run/halt, carry zero, or carry not zero, may be similarly selected to control the loading of the program counter 108. After sending the proper signal over control lines 104, a logical TRUE or FALSE condition may be gated through the multiplexor 102 to control the loading of the counter 108. This allows for unconditional loading or unconditional incrementing of the program counter 108, respectively.
The clock 114 provides the timing for the synchronous operations of the microprocessor. Preferably, the clock 114 comprises a single phase crystal-controlled oscillator running at 4.608 MHz. This frequency is a multiple of all common communication band rates and can thus provide, through frequency division by a counter, an extremely stable time base for any communications interface. As shown in FIG. 2, the clock output .phi.c is connected to each of the registers and counters of the CPU so that the function of each unit is synchronized to the clock cycle. For the sake of clarity, the complete connection of the clock phase line .phi.c between the control unit 40 and each register and counter has been ommitted.
Micro Control Program
This control unit ROM 100 contains a 256-instruction micro control program. This program controls the operation of the CPU by directing data over the various data paths through commands issued over the various control lines. Specifically, the control program directs the input of each macro instruction, the decoding of that instruction, and the execution of the instruction. The control program also monitors the run/halt and the interrupt lines.
The preferred micro control program is presented below. In the source code of the micro control program the following formats are used: aaaa: Instruction address mneumonic "aaaa" corresponds to this instruction jjjj; aaaa Execute jump instruction "jjjj" and if successful, jump to address "aaaa" rrr= Load into register or counter "rrr" =nnn The symbols "nnn" are a hexadecimal number and not a mneumonic.
The source code also uses the following mneumonics and symbols:
Arithmetic Logic Unit Operations
In the following operations, the letters "rrr" represent the multiplexor output corresponding to the register or counter selected by the multiplexor:
Binary numbers are represented herein in hexadecimal form, that is, each numerical digit represents a number between 0 and 15, or four binary bits. The symbols "A", "B", "C", "D", "E" and "F" are used in the numerals to represent the values of 10, 11, 12, 13, 14 and 15, respectively. Thus, the numeral "OF" represents the value 15, the numeral "10" represents the value 16, and the numeral "FF" represents the value 255.
The following listing presents the micro control program. For each of the 256 instructions, the instruction address is given, followed by the instruction in machine code as it is actually programmed into the control unit ROM, and the instruction in source code using the mnenomics given above.
Macro Instruction Set
The foregoing micro control program operates with the following macro instructions. A macro instruction set of 68 commands can be supported, including full arithmetic and logic capabilities, conditional jump instructions, a flexible subroutine facility, and special bit manipulation instructions. All of the arithmetic and logical instructions and many of the other instructions can be used with either immediate, register, or indirect operands.
Arithmetic and Logical Instructions
There are 18 arithmetic and logical instructions. In each of these instructions, a two-byte format is used. The first byte contains an operation code. The second byte contains data or a data address:
Add data (Op Code: 11110001). The data in the second byte of the instruction is added to the accumulator. If there is a carry out, the carry is set, otherwise it is cleared.
Add register (Op Code: 11100001). The contents of the register selected by the second byte of the instruction are added to the accumulator. If there is a carry out, the carry is set, otherwise the carry is cleared.
Add indirect (Op code: 11010001). The second byte of the instruction selects a register which addresses a register whose contents are added to the accumulator. If there is a carry out, the carry is set, otherwise it is cleared.
Subtract data (Op code: 11110000). The data in the second byte of the instruction is subtracted from the accumulator. If there is a borrow out, the carry is cleared, otherwise it is set.
Subtract register (Op code: 11100000). The contents of the register selected by the second byte of the instruction are subtracted from the accumulator. If there is a borrow out, the carry is cleared, otherwise it is set.
Subtract indirect (Op code: 11010000). The second byte of the instruction selects a register which addresses a register whose contents are subtracted from the accumulator. If there is a borrow out, the carry is cleared, otherwise it is set.
And data (Op code: 11110010). The data in the second byte of the instruction is logically and'd with the accumulator. The carry is unaffected.
And register (Op code: 11100010). The contents of the register selected by the second byte of the instruction are logically and'd with the accumulator. The carry is unaffected.
And indirect (Op code: 11010010). The second byte of the instruction selects a register which addresses a register whose contents are logically and'd with the accumulator. The carry is unaffected.
Inclusive or data (Op code: 1110011). The data in the second byte of the instruction is logically or'd with the accumulator. The carry is unaffected.
Inclusive or register (Op code: 11100011). The contents of the register selected by the second byte of the instruction are logically or'd with the accumulator. The carry is unaffected.
Inclusive or indirect (Op code: 11010011). The second byte of the instruction selects a register which addresses a register whose contents are logically or'ed with the accumulator. The carry is unaffected.
Exclusive or data (Op code: 11110100). The data in the second byte of the instruction is exclusive-or'd with the accumulator, that is, each result bit is a `1` if and only if the two corresponding operand bits differ. The carry is unaffected.
Exclusive or register (Op code: 11100100). The contents of the register selected by the second byte of the instruction are exclusive --or'd with the accumulator, that is, each bit is a `1` if and only if the two corresponding operand bits differ. The carry is unaffected.
Exclusive or indirect (Op code: 11010100). The second byte of the instruction selects a register which addresses a register whose contents are exclusive -- or'd with the accumulator, that is, each result bit is a `1` if and only if the two corresponding operand bits differ. The carry is unaffected.
Compare data (Op code: 11110101). The data in the second byte of the instruction is compared to the accumulator. If it matches, the carry is cleared, otherwise it is set. The accumulator is not affected.
Compare register (Op code: 11100101). The contents of the register selected by the second byte of the instruction are compared to the accumulator. If they match, the carry is cleared, otherwise it is set. The accumulator is not affected.
Compare indirect (Op code: 11010101). The second byte of the instruction selects a register which addresses a register whose contents are compared to the accumulator. If they match, the carry is cleared, otherwise it is set. The accumulator is not affected.
Accumulator and Carry Instructions
There are nine instructions for affecting the accumulator and the carry. In the following eight instructions, the one-byte format is used consisting solely of the operation code:
Increment accumulator (Op code: 11001001). The accumulator is incremented by 1. If there is a carry out the carry is set, otherwise it is cleared.
Decrement accumulator (Op code: 11001010). The accumulator is decremented by 1. If there is a borrow-out the carry is cleared, otherwise it is set.
Complement accumulator (Op code: 11001011). The accumulator is logically complemented. The carry is not affected.
Clear accumulator (Op code: 11000010). The accumulator is set to zero. The carry is unaffected.
Rotate left (Op code: 11000100). The accumulator and carry are rotated left one bit. The carry receives the old high-order bit of the accumulator. The low-order bit of the accumulator receives the old value of the carry.
Clear carry (Op code: 11000001). The carry is cleared.
Set carry (Op code: 11000011). The carry is set.
Complement carry (Op code: 11001101). The carry is complemented.
In the following instruction, a two-byte format is used. The first byte contains the operation code. The second byte contains the count:
Rotate left with count (Op code: 11001111). The accumulator is rotated left by the number of bits indicated in the count. The low order bit of the result is placed in the carry.
Load and Store Instructions
The following six load and store instructions use a two-byte format. The first byte contains an operation code. The second byte contains data or a data address:
Load data (Op code: 11111111). The data in the second byte of the instruction is loaded into the accumulator.
Load register (Op code: 11101111). The contents of the register selected by the second byte of the instruction are loaded into the accumulator.
Load indirect (Op code: 11011111). The second byte of the instruction selects a register which addresses a register whose contents are loaded into the accumulator.
Store register (Op code: 11111001). The accumulator is stored into the register selected by the second byte of the instruction.
Store indirect (Op code: 11101001). The accumulator is stored into the register addressed by the register selected by the second byte of the instruction.
Store doubly indirect (Op code: 11011001). The accumulator is stored into the register addressed by the register addressed by the register selected by the second byte of the instruction.
Register Instructions.
There are nine register intructions. The following six instructions use a two-byte format. The first byte contains an operation code. The second byte contains a register address:
Decrement register (Op code: 11110111). The register selected by the second byte of the instruction is decremented by 1. The carry is not affected.
Decrement indirect (Op code: 11100111). The register addressed by the register selected by the second byte of the instruction is decremented by 1. The carry is unaffected.
Decrement doubly indirect (Op code: 11010111). The register addressed by the register addressed by the register selected by the second byte of the instruction is decremented by 1. The carry is unaffected.
Increment register (Op code: 11110110). The register selected by the second byte of the instruction is incremented by 1. The carry is unaffected.
Increment indirect (Op code: 11100110). The register addressed by the register selected by the second byte of the instruction is incremented by one. The carry is unaffected.
Increment doubly indirect (Op code: 11010110). The register addressed by the register addressed by the register selected by the second byte of the instruction is incremented by 1. The carry is unaffected.
The following three register instructions use a three-byte format. The first byte contains an operation code. The second byte contains a register address. The third byte contains a mask:
Bit set (Op code: 11000101). The mask is logically or'd with the register addressed by the second byte of the instruction. The result is placed in the register.
Bit clear (Op code: 11000110). The mask is logically and'd with the register addressed by the second byte of the instruction. The result is placed in the register.
Bit test (Op code: 11001000). The mask is logically and'd with the register addressed by the second byte of the instruction. If the result is 0, the carry is cleared, otherwise it is set.
Loop Instructions
There are three loop instructions. Each of these instructions uses a three-byte format. The first byte contains an operation code. The second byte contains a register address. The third byte contains an offset which must be greater than or equal to -128 and less than or equal to +127.
Decrement and jump register (Op code: 11111000). The register selected by the second byte of the instruction is decremented by one. If the result is not zero, the offset in the third byte of the instruction is added to the program counter, i.e. control jumps backwards or forwards by the number of bytes specified in the offset. Negative offsets are represented in 2's complement form. An offset of zero is equivalent to no jump being taken. The carry is not affected.
Decrement and jump indirect (Op code: 11101000). The register addressed by the register selected by the second byte of the instruction is decremented by one. If the result is not zero, the offset is added to the program counter as in the decrement-and-jump-register instruction. The carry is not affected.
Decrement and jump doubly indirect (Op code: 11011000). The register addressed by the register addressed by the register selected by the second byte of the instruction is decremented by one. If the result is not zero, the offset is added to he program counter as in the decrement-and-jump-register instruction. The carry is not affected.
Move Instructions
There are three move instructions, each of which use a three-byte format. The first byte contains an operation code. The second byte contains a source address or data. The third byte contains a destination address:
Move data (Op code: 11111110). The data in the second byte of the instruction is stored into the register selected by the third byte of the instruction. The accumulator is unaffected.
Move register (Op code: 11101110). The contents of the register selected by the second byte of the instruction are stored into the register selected by the third byte of the instruction. The accumulator is unaffected.
Move indirect (Op code: 11011110). The contents of the register addressed by the register selected by the second byte of the instruction are stored into the register selected by the third byte of the instruction. The accumulator is unaffected.
Memory Reference Instructions
There are six memory reference instructions. Each instruction uses a two-byte format. The first byte contains an operation code. The second byte contains a register address:
Load memory register (Op code: 11111100). The memory location addressed by R and R+1 is loaded into the accumulator, where R is the register selected by the second byte of instruction, and R+1 is the following register. R contains the low-order half of the memory address, R+1 contains the high-order half.
Load memory indirect (Op code: 11101100). Same operation as load-memory-register, except that R is the register addressed by the register selected by the second byte of the instruction.
Load memory doubly indirect (Op code: 11011100). Same operation as load-memory-register, except that R is the register addressed by the register addressed by the register selected by the second byte of the instruction.
Store memory register (Op code: 11111101). The accumulator is stored in the memory location addressed by R and R+1, where R is the register selected by the second byte of the instruction and R+1 is the following register. R contains the low-order half of the memory address, and R+1 contains the high-order half.
Store memory indirect (Op code: 11101101). Same operation as store-memory-register except that R is the register addressed by the register selected by the second byte of the instruction.
Store memory doubly indirect (Op code: 11011101). Same operation as store-memory-register except that R is the register addressed by the register addressed by the register selected by the second byte of the instructions.
Jump Instructions
These are seven jump instructions. The following six instructions use a two-byte format. In the first byte, the upper three bits contain an operation code, and the lower five bits contain the upper five bits of a 13-bit address. The second byte contains the lower 8 bits of the address:
Jump unconditional (Op code: 000). The lower 13 bits of the program counter are loaded with the 13-bit address contained in the instruction, i.e. the next instruction will be fetched from the given address within the current 8K page.
Jump if accumulator zero (Op code: 101). If the accumulator is zero, a jump is taken as in the jump-unconditional instruction, otherwise no action is taken.
Jump if accumulator not zero (Op code: 100). If the accumulator is not zero, a jump is taken as in the jump-unconditional instruction, otherwise no action is taken.
Jump if carry zero (Op code: 010). If the carry is zero, a jump is taken as in the jump-unconditional instruction, otherwise no action is taken.
Jump if carry not zero (Op code: 011). If the carry is not zero, a jump is taken as in the jump-unconditional instruction, otherwise no action is taken.
Jump to subroutine (Op code: 001). The low-order half of the old program counter is stored in the register addressed by the stack pointer. The high-order five bits are stored in the following register. The stack pointer is incremented by two. The program counter is loaded with the 13 bit address in the instruction.
The following jump instruction uses a three-byte format. The first byte contains the operation code. The second and third bytes contain a 16-bit address:
Jump unconditional extended (Op Code: 11000111). The program counter is loaded with the 16-bit address contained in the instructions, i.e., the next instruction will be fetched from the given address. This instruction is used to transfer control between different 8K pages of memory.
Input/Output Instructions
In the following six I/O instructions, a two-byte format is used. The first byte contains an operation code. The second byte contains an address:
Input direct (Op code: 11111010). The data at the input port selected by the second byte of the instruction is read to the accumulator.
Input register (Op code: 11101010). The data at the input port addressed by the register selected by the second byte of the instruction is read into the accumulator.
Input indirect (Op code: 11011010). The data at the input port addressed by the register addressed by the register selected by the second byte of the instruction is read into the accumulator.
Output direct (Op code: 11111011). The accumulator is written to the output port selected by the second byte of the instruction.
Output register (Op code: 11101011). The accumulator is written to the output port addressed by the register selected by the second byte of the instruction.
Output indirect (Op code: 11011011). The accumulator is written to the output port addressed by the register addressed by the register selected by the second byte of the instruction.
Other Instructions
Finally, there are three other instructions. Each of these instructions uses a one-byte format containing solely the operation code:
Return from subroutine (Op code: 11001100). The stack pointer is decremented by two. The low-order half of the program counter is loaded from the register addressed by the stack pointer. The high-order half of the program counter is loaded from the following register.
Jump through accumulator (Op code: 11001110). The accumulator is added to the program counter. The accumulator and carry are not affected.
No operation (Op code: 11000000).
CONCLUSION
It can be seen from the foregoing that the relative simplicity of the architecture of the present invention permits very fast processing times. Another advantage of the invention is its low cost. The entire CPU including the control unit can be constructed from the 48 off-the-shelf integrated circuit packages. The CPU is also compact. The units can be arranged to fit on a single printed circuit board measuring no more than eight inches square.
The microprocessor described herein is designed to operate with 8-bit binary data words. This has been found to be the preferred word length for applications requiring fast combined arithmetic and logical capabilities such as traffic monitoring and signal control. However, in a more sophisticated arithmetic applications such as machine tool control, a longer data word such as 16 bits or 32 bits may be desired. It is understood that one skilled in the computer design art could build a 16-bit or 32-bit microprocessor using the architecture of the present invention based upon the disclosure given herein.
Other modifications and variations in the specific apparatus herein shown and described will be apparent to those skilled in the art all within the intended scope and spirit of the invention. While the invention has been shown and described with respect to a specific embodiment thereof, this is intended for the purpose of illustration rather than limitation. Accordingly, the invention is not to be limited to the specific embodiment herein shown and described nor in any other way that is inconsistent with the extent to which the progress in the art has been advanced by the invention.