Means to differentiate between commands and data on a communications link
TECHNICAL FIELD 
     This invention relates to a method and apparatus for distinguishing between commands and data on a communications link of a communications system. 
     PRIOR ART 
     In communication links, both data and command information are transmitted. The transmitter combines data and commands in some prescribed fashion and these must then be separated at the receiver. The problem is to find an efficient method for distinguishing between commands and data. 
     Prior art solves this problem in several ways. One common approach is bit stuffing (as in the International Standard Organization&#39;s HDLC standard, see for example, D. E. Carlson, Bit-oriented data link control procedures, IEEE Transactions on Communications, pp. 455-467, 1980), which applies to serial transmission of binary data. Here, a certain sequence is always interpreted as a delimiter. Since data can be arbitrary, whenever a binary data sequence identical to the delimiter sequence is to be transmitted, the transmitter modifies the sequence to avoid ambiguity. For example, if the sequence 111111 signifies a delimiter, then whenever we have to transmit a data sequence 11111, followed by any another sequence of bits, we stuff a 0 between the 5th and 6th bits. Thus, a data sequence 01111110 would be transmitted as 011111010 and a data sequence 01111100 would be transmitted as 011111000. The receiver then &#34;unstuffs&#34; the received sequence. In this example, when the receiver sees the sequence 11111 followed by a 0, it automatically discards the 0. When it sees the sequence 111111 before the unstuffing operation, it is interpreted as a delimiter. The problem with this approach is that the number of bits transmitted depends on the values of the data and cannot be predicted a priori. 
     Yet another approach is to encode k-bit data words into n-bit code words before transmission, where n&gt;k. This is a common technique used in the fiber-distributed data interface (FDDI), (F. E. Ross, FDDI-a tutorial, IEEE Communications Magazine, May 1986, pp.10-17), the Enterprise Systems Connection serial channel (ESCON) (C. J. Georgiou et al., The ESCON director: a dynamic switch for 200-Mbits/sec fiber-optic links, IBM Journal of Research and Development, 1992), and the fibre channel standard (FCS) (American National Standards Institute, Fibre Channel: Physical and Signaling Interface, Rev. 2.2, 1992). The above encoding technique provides not only a way to differentiate between commands and data but also provides a means to maintain DC balance and guarantees sufficient transitions to enable the receiver to maintain bit synchronization. Since there are 2 n-k  code words which do not have corresponding data words, these can be used as commands. This is the case with FDDI, ESCON and FCS. In many situations however, these 2 n-k  code words may not be available to be used as commands. Even if they are available, many of them if used, could result in DC imbalances as well as lack of transitions. 
     Another approach is to precede blocks of data with headers that contain command information see, for example, U.S. Pat. No. 4,594,708 to M. Servel et al. This approach is inefficient for small block sizes because of the fixed overhead per block. On the other hand, long data blocks may be undesirable due to buffer limitations or long error recovery times. Moreover, this approach does not allow interjection of commands in the middle of a long data block. 
     U.S. Pat. No. 4,512,026 to Vander Meiden discloses the use of a unique value as a delimiter between commands and data. Vander Meiden does not use encoding and prevents data words from having this unique delimiter value by the use of bit stuffing. 
     U.S. Pat. No. 4,606,056 to Perloff requires 2 bits in each word in order to differentiate between a command word and a data word. Thus, there is a fixed overhead per word, which is inefficient. 
     U.S. Pat. No. 4,860,286 to Forsberg et al. applies to multiplexed transmission on a serial link. N inputs are over sampled at a fixed rate producing 2 kN samples. Of these, kN samples are sent using positive logic, followed by a fixed-length sync word, followed by the remaining kN samples using negative logic. Since the data&#39;s polarity is periodic, frame boundaries can be detected. No block encoding is used. 
     U.S. Pat. No. 5,012,489 to Burton et al. uses many special characters as commands and does not use a unique code symbol to delimit between data and commands. 
     U.S. Pat. No. 5,060,229 to Tyrrell et al. describes the use of fixed-length frames and a fixed header at the beginning of the frame for commands. This approach is inefficient for small block sizes because of the fixed overhead per block. On the other hand, long data blocks may be undesirable due to buffer limitations or long error recovery times. Moreover, this approach does not allow interjection of commands in the middle of a long data block. 
     SUMMARY OF THE INVENTION 
     It is therefore an object of this invention to differentiate between commands and data while requiring minimum bandwidth, providing dc balance and sufficient bit transitions for the receiver to maintain bit synchronization, and not requiring bit stuffing. Furthermore, data may arrive at the transmitter in bursts with idle periods in between. After an idle period, the receiver must be able to determine when the link becomes active again. 
     Accordingly, this invention provides a method of transmitting a stream of information symbols so that data information symbols can be easily distinguished from command information symbols. 
     Information symbols in a set D, representing data or commands to be transmitted are first encoded into a larger set E of code symbols. An encoded information symbol may either be interpreted as a data symbol or a command symbol, depending on the context as explained below. 
     One code symbol, S, in E, which does not represent an information symbol in D, is used to delimit between commands and data. When the transmitter wishes to send a command, it first transmits the delimiter S, followed by the encoded command. When the transmitter wishes to send data, it first transmits the delimiter S, followed by a command representing Start-Of-Text, followed by the encoded data. At the receiver, whenever S is received, the receiver awaits the arrival of the first symbol that is not S. This non-S symbol is interpreted as representing a command. Whenever the Start-of-Text command is received, all succeeding symbols are interpreted as data until S is received again. This Start-Of-Text is also used to inform the receiver that the transmitter has transitioned from an idle state to a state where data is transmitted. After leaving its idle state, the transmitter automatically inserts a Start-of-Text after an S symbol before it begins transmitting data. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of the transmitter apparatus. 
     FIG. 2 illustrates the state diagram for the transmit state machine. 
     FIG. 3 is a block diagram of the receiver apparatus. 
     FIG. 4 illustrates the state diagram for the receive state machine. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     In the preferred embodiment, there is a transmitter and receiver which perform the following functions. 
     At the transmitter, a binary information word consisting of 8 bits is encoded into a code word of 10 bits using a block 8-10 code (for example, A. X. Widmer and P. A. Franaszek, A DC-balanced, partitioned-block 8B/10B transmission code, IBM Journal of Research and Development, vol. 27, no. 5, September 1983, pp. 410-451), which is hereby incorporated by reference. One 10-bit code word, S, that does not correspond to an 8-bit information word is used as a delimiter. 
     A block diagram of the transmitter apparatus is shown in FIG. 1. The transmitter takes its input from one of two buffers, a command buffer (101) or a data buffer (102), as determined by the send cmd/data signal (103). The 8-bit input (104) is first encoded into 10-bits by the 8-10 encoder (105). The 10-bit output (106) is then sent out by the transmitter (107), according to the sequence dictated by the transmit state machine (108). 
     The transmitter operates according to the state diagram shown in FIG. 2. The transmitter is first initialized to state 0 using the reset signal (109). In state 0, the transmitter continually transmits the code word S, i.e., the sequence SSSSSSS . . . When command words are to be sent, the transmitter transitions to state 1 where it issues command buffer reads (110), and transmits the encoded command words. When the transmit state machine receives a command buffer empty signal (111), it transitions to state 0 where at least one S word is transmitted before making another transition. 
     When data words are to be transmitted, the transmitter transitions to state 2, where it sends a 10-bit encoded word, ESOTX (encoded Start-of-Text), corresponding to a specific 8-bit command word, SOTX (Start-of-Text). It then transitions to state 3, where it issues data buffer reads (112) and transmits data continuously until it receives a data buffer empty signal (113). It then returns to state 0 where it transmits at least one S word before making another transition. 
     The TX --  STROBE signal (114) informs the transmitter that it should send the next 10-bit word to its output (115). 
     A block diagram of the receiver apparatus is shown in FIG. 3. The receiver (300) takes its input (301) and outputs 10-bit words (302) to the 10/8 decoder (303). The decoder outputs 8-bit words (304) which are stored in the data buffer (305) or the command buffer (306) as determined by the receive state machine (307) using the data buffer write (308) or command buffer write (309) signals. Each time a new 10-bit word is outputted by the receiver, it informs the receive state machine by means of the RX --  STROBE signal (310). Whenever an S word is received, the decoder notifies the state machine by means of the S signal (311). Whenever an ESOTX word is received, the decoder notifies the state machine by means of the SOTX signal (312). 
     The receive state machine operates according to the state diagram shown in FIG. 4. The receiver is initialized to state 0 by the reset signal (313) and remains there until an S word is received. It then transitions to state 1 and remains there as long as S words continue to be received. Upon receiving a word different from S and different from ESOTX, it transitions to state 2 where the word is treated as a command. Successive words are treated as command words until the next S is received, where upon the receiver transitions back to state 0. In state 1, upon receiving a word different from S and equal to ESOTX, the ESOTX is discarded and the receiver transitions to state 3. In state 3, subsequent words are treated as data until another S is received upon which the receiver transitions back to state 0. 
     The transmitter and receiver can be implemented in hardware using standard chip-sets such as TAXI (manufactured by Advanced Micro Devices) or HOTROD (manufactured by Gazelle) for the encoding and decoding, along with standard programmable logic for the state machines. 
     In this preferred embodiment, D is the set of all 8-bit words and E is the set of all 10-bit words. With the Widmer/Franaszek code, the data word 01011100 is encoded as 0011100101. The code word 0011111010 has no corresponding data word and hence can be used as the delimiter S. Start-of-Text, for example, may be 00111010 and its encoded version, ESOTX is 0101101001, A few sample sequences are shown below. The data words d1 d2 d3 . . . d20 (encoded as e1 e2 e3 . . . e20) may be transmitted in the following equivalent ways. 
     (1) S S S S ESOTX e1 e2 e3 . . . e20 S S S, 
     (2) S ESOTX e1 e2 e3 e4 S S S ESOTX e5 e6 e7 . . . e20 S. 
     The command words d1 d2 (encoded as e1 e2) may be transmitted in the following equivalent ways: 
     (1) S e1 e2, 
     (2) S e1 S e2. 
     The command word d (encoded as e) followed by data words d1 d2 . . . d20 (encoded as e1 e2 . . . e20) can be transmitted as S e S ESOTX e1 e2 . . . e20.