Abstract:
An algorithm for ordering selects for a plurality of channels to be multiplexed into a frame is provided. The channel select position counter for each of the channels to be multiplexed are initialized. The first and succeeding channel selects are chosen based on the lowest price (highest cost) ready channel, with the price of a channel being equal to the value of the channel select position counter divided by the number of selects for that channel in the frame, and the readiness of the channel being indicated either by an indicator, or by the relative value of the position counter to the initial value of the position counter. Where channel prices are equal, the select is chosen on the secondary basis of channel rate, with the highest rate channel contributing first. After a select is made, the position counter of the selected channel is increased by the total number of selects in the frame. Then, the position counters of all of the channels, including the selected channel are decremented by a value corresponding to the number of selects for that channel in the frame. After such updating, another selection for the frame may be made based on the lowest priced ready channel. The provided algorithm guarantees that no channel will ever have an excursion of more than one bit available for placement in the frame.

Description:
BACKGROUND 
     This application is related to concurrently filed application Ser. No. 07/259,803 entitled &#34;Framing Algorithm for Bit Interleaved Time Division Multiplexer&#34;, which is hereby incorporated by reference herein and which is assigned to the assignee herein. This application is also related to concurrently filed application Ser. No. 07/259,856 entitled &#34;Algorithm for Selecting Channels for Multiplexer Frame&#34;, which is assigned to the assignee herein. 
     The present invention relates to time-division-multiplexed (TDM) telecommunication systems. More particularly, the invention relates to methods for inserting channel selects into a frame wherein the excursions of the channels are minimized. 
     In multiplexing information from various channels of varying speeds, it is necessary to buffer information from each channel as the receiver of the multiplexer can only attend to one channel at a time. Each channel typically has its own buffer, and the input by the channel into the buffer relative to the output of the buffer to the receiver is typically asynchronous. It is clearly important that the buffers do not become empty of full at any instant as the empty or full condition would indicate duplication or loss of data respectively. 
     As indicated in Ser. No. 07/259,803, a framing algorithm may be utilized to set the frame length as well as the number of selects from each channel into the frame. It is then necessary to create a time sequence table with entries which define the order in which the receiver responds to the channels. Each entry in the table represents one bit (or in byte systems--one byte) time of the receiver. Each &#34;channel&#34; must have at least one entry in the frame (even if the entry represents a subsidiary frame such as a secondary or tertiary frame), and the frame is repeated at a rate which is the greatest common divisor of the channel rates. In general, some channels have a large number of entries in the table while other channels may have only a few or even a single entry. It is then desirable to space the entries for each channel such that they are an equal distance apart; i.e. to minimize the accumulated deviation (excursion) from the ideal space for the channel selects in the frame. 
     Two methods for limiting excursion are known in the art. A first method, the &#34;priority method&#34; is to order the channels according to their speed and to start with the fastest channel and place the fastest channel selects as closely as possible to their ideal position. Then, the procedure is repeated for the next highest channel. If the ideal select slot is taken by the previous channel, then the nearest vacant slot is sought. The procedure continues until all of the channel selects are placed in the frame. The obvious disadvantage of the &#34;priority method&#34; scheme is that the slower channels are often moved relatively far away from their ideal slots. A further disadvantage is that considerable iterative effort is required to find and fill vacant slots. 
     A second method for limiting excursion is described in detail in commonly owned U.S. Pat. No. 4,727,536. In that patent, a real time allocation process is described where the channels are arranged in descending order of channel rates and starting with the fastest channel, the channels are scanned to determine whether they are ready to contribute a bit to the aggregate. Initially, all the channels are considered ready to contribute. After its first contribution to the frame, the readiness of a channel is determined by the position of a counter associated with the channel. The counter is initially set equal to the frame length. Then, each time a bit is inserted into the frame from the highest rate channel which is ready, the position counter of each channel is adjusted by subtracting the number of selects for that channel from the count, and the position counter of the contributing channel is adjusted by adding the frame length value to the counter value. When the position counter reaches zero or goes negative, the channel is marked to be ready to contribute. The procedure of choosing the fastest channel which is ready to contribute continues until the frame is complete such that all the channels have contributed their proportional number of bits. 
     Although the method of U.S. Pat. No. 4,727,536 is non-iterative and hence efficient, it has some drawbacks in terms of excursion. Unwanted excursion occurs because the method prioritises the channels and tends to be more responsive to the faster channels. In the case of a large number of channels, the non-iterative method can introduce significant excursion to low order channels. 
     SUMMARY OF THE INVENTION 
     It is therefore an object of the invention to provide an efficient framing algorithm which minimizes channel excursion. 
     It is a further object of the invention to provide a real-time, efficient framing algorithm which assigns cost (or price) functions to channels and which minimizes cost. 
     In accord with the objects of the invention, an algorithm for ordering selects for a plurality of channels into a frame is provided. The algorithm requires the initializing of a channel ready indicator and a channel select position counter in each of the channels to be multiplexed. The first and succeeding channel selects are chosen based on which ready channel has the lowest &#34;price&#34; (i.e. highest &#34;cost&#34;) with the selection of the lowest price (highest cost) channel thereby minimizing total cost. The &#34;price&#34; of a channel is defined by the value of the channel select position counter divided by the number of selects from that channel to the frame, and the &#34;cost&#34; is the inverse thereof (for simplicity, the discussion hereinafter will refer to price only). After a select is made, the position counters of all of the channels (including the selected channel) are decremented by a value coresponding to the number of selects for that channel in the frame, and the position counter of the selected channel only is increased by the total number of selects in the frame. After such updating, and the recalculating of prices, another selection for the frame may be made based on the relative prices of the ready channels. 
     Because the price of each channel is not necessarily an integer value such as in copending Ser. No. 07/259,856, but rather is a fraction based on how far (in terms of selects) a particular channel is from receiving another bit, channels of different rates will rarely have equal prices. Where channels have equal prices, either channel may be chosen. However, preferably, the channels are also ordered by rate (i.e. equivalently by the number of selects of the channel in the frame), and where prices are equal, a select is made of the channel having the highest rate. The provided algorithm guarantees minimum excursion such that no channel will ever have more than one bit available for placement in the frame (i.e. zero bits of excursion). The advantage of such a guarantee is the knowledge that in operation, a multiplexer will not cause an overflow of a channel buffer due to a large excursion. In fact, the minimum excursion provided by the algorithm permits the reduction in the size of the channel buffers. 
     Other objects and advantages of the invention will become evident upon reference to the detailed description in conjunction with the provided figures. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1A (including FIG. 1Aa) is a flow chart illustrating the select determination method of the invention; 
     FIG. 1B (including FIG. 1Ba) is a flow chart illustrating an alternative embodiment of the method invention; 
     FIG. 2a1 is a chart of frame selects generated by the preferred method invention; 
     FIG. 2a2 is a chart of channel parameters of the hypothetical channels from which the selects are generated; 
     FIGS. 2b-2m are charts of the computations performed in generating a hypothetical frame according to the preferred method invention. 
     FIG. 3a1 is a chart of frame selects generated according to a prior art technique; 
     FIG. 3a2 is a chart of channel parameters of the hypothetical channels from which selects are generated; and 
     FIGS. 3b-3m are charts of the computations performed in generating a hypothetical frame according to a prior art technique. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Turning to FIGS. 1A and 1Aa, a flow chart of the preferred method of generating selects for a frame is provided. In the preferred embodiment, at 30a the channels are ordered by rate order (as seen in FIG. 2a1) and a table is generated having as fields: the channel number, the number of selects for the channel in the frame; the channel select position counter; and the channel price. The frame select position counter of each channel is then initialized at 34a (and written into the table) to be equal to the aggregate rate divided by the frame rate. In other words, the position counters of the channels are set to a value equal to the total number of selects in the frame. With the select position counters initialized, at 36a, the prices of the channels are determined (price of channel i=frame select position counter value for channel i divided by the number of selects of channel i in the frame). Then, at 37a, the top of the table (i.e. the first entry--the data channel with the highest rate) is indexed. At 38a, if the channel is ready to contribute a bit (i.e. its select position counter value is less than o equal to the total number of selects in the frame), the price of the indexed channel is compared to the price of the lowest price previously indexed ready channel. If the indexed channel has a lower price than the previously indexed channels, its price is stored along with an indication of channel number. Otherwise, the method continues at 40a with a determination of whether all channels have been scanned. If all channels have not been scanned, the next channel entry is indexed at 42a and if the channel is ready, a price comparison is made at 38a. The loop is continued until all channels have been scanned. Then, at 44a a select is chosen from the channel (as stored in 38a) having the lowest price (i.e. the greatest cost in terms of excursion), and the frame select position counter associated with that channel is incremented by a value equal to the number of selects in the frame. Where a plurality of channels all have the same lowest price, a select is preferably made of the channel having the highest rate. While such a constraint is not necessary to follow the invention, the result naturally follows from the preferred embodiment of steps 30a and 38a where the channels are rate ordered and where the price of a slower ready channel is not stored unless its price is less than that of the previously scanned ready channels. 
     Once a select has been made and the selected channel&#39;s position counter has been incremented, the frame select position counters of all of the channels must be updated. Thus, starting with the highest rate channel addressed at 46a, and in a loop to be described hereinafter, the position counter of each channel is updated. At 48a, a value equal to the number of selects of the particular channel in the frame (which is equal to the channel rate divided by the frame rate), is subtracted from the frame select position counter of the particular channel. Then, a determination is made at 60a as to whether all channels have been updated. If not, the next entry in the table is indexed at 61a and the program returns to step 48a for the current channel being updated. If all channels have been updated, a determination is made at 62a as to whether the frame has been completed. If so, the program ends. If not, the program continues at step 37a where the highest rate channel is indexed to start a determination of the next select for the frame. 
     Turning to FIGS. 1B and 1Ba, a flow chart of an alternative method of generating selects for a frame is provided. At 30b the channels are ordered by rate order (as seen in FIG. 2a1), and a table is generated with the following fields: the channel number, the number of selects for the channel in the frame; the channel select position counter; the channel price; and a channel ready counter. At 32b, the channel ready counter (indicative of the availability of a channel to contribute data) of each channel is initialized to a value of one. The frame select position counter of each channel is then initialized at 34b to be equal to the number of selects in the frame. With the ready counters set and the select position counters initialized, at 36b, the prices of the channels are determined, and at 37b, the first entry in the table is indexed. At 38b the price of the indexed channel is compared to the price of the lowest price previously indexed ready channel. If the indexed channel has a lower price than the previously indexed channels which were ready (i.e. ready counter value of one), its price is stored along with an indication of channel number. Otherwise, the method continues at 40b with a determination of whether all channels have been scanned. If all channels have not been scanned, the next channel entry is indexed at 42b and if it is ready, a price comparison is made at 38b. The loop is continued until all channels have been scanned. Then, at 44b a select is chosen from the ready channel (as stored in 38b) having the lowest price (i.e. the greatest cost in terms of excursion), and the ready counter value of the selected channel is decremented. Where a plurality of channels all have the same lowest price, a select is preferably made of the channel having the highest rate. While such a constraint is not necessary to follow the invention, the result naturally follows from the preferred embodiment of steps 30b and 38b where the channels are rate ordered and where the price of a slower channel is not stored unless its price is less than that of the previously scanned ready channels. 
     Once a select has been made at 44b, the frame select position counters and ready counters of the channels must all be updated. Thus, starting with the highest rate channel addressed at 46b, and in a loop to be described hereinafter, the parameters of each succeeding channel are updated. At 48b, a value equal to the number of selects of the particular channel in the frame (which is equal to the channel rate divided by the frame rate), is subtracted from the frame select position counter of the particular channel. At 52b a determination is made as to whether the frame position counter is positive. If the frame position counter is positive, the program continues at step 58b, where the next channel is indexed. However, if the position counter has gone to zero or negative, the ready counter of the channel is incremented at 54b, and a value equal to the number of selects in the frame is added to the frame select position counter at 56b. Then a determination is made at 60b as to whether all channels have been updated. If not, the next entry in the table in indexed at 61b, and the program returns to step 48b for the current channel being updated. If all channels have been updated, a determination is made at 62b as to whether the frame has been completed. If so, the program ends. If not, the program continues at step 37b where the highest rate channel is indexed to start a determination of the next select for the frame. 
     Turning to FIGS. 2b-2m, a hypothetical frame built according to the teachings of the invention and particularly in accord with the FIG. 1B embodiment is seen. Nine channels are provided and are to be multiplexed into a frame having a total of two hundred and forty selects. As indicated, channel five is the highest rate channel and is to be selected seventy-eight times every frame, while channel four is to be selected forty-five times. Channels three, one, and two are of equal rates and are to be selected twenty-three times each, while channels six through nine are to be selected twelve times each. 
     Using the excursion algorithm of FIG. 1B, selects are chosen for placement into a frame depending upon the price of the channel, and secondarily upon the channel rate. In FIGS. 2b-2m (as well as FIGS. 3b-3m), the status of a ready counter set to one is indicated by an underline of the frame select position counter value. No underline indicates that the ready counter is at zero (i.e. the channel will not be ready to contribute information), while a double or triple underline is indicative that the ready counter value is two or three and is ready to contribute two or three bits respectively (only seen in FIGS. 3b-3m). The pattern of generated selects is seen in FIG. 2a1. Visually, the generation of the selects may be seen by locating at each select position which channel has an underlined position counter value at that position but no underline at the next position (or double underlined at the select position and single underlined at the next position for FIGS. 3). Of course, the exception to this rule is where a select is made of a channel, and immediately following the select the ready counter of that channel is increased due to the position counter having goe to zero. 
     Starting at the top of FIG. 2b, and following the first ten selects horizontally, the method outlined in FIG. 1 provides selects of the following channels in the following order: 5, 4, 3, 1, 5, 2, 4, 5, 6, 7. Continuing through the next ten selects, it will be seen that despite channels three, one and two being ready at the thirteenth select, channel eight is chosen because its price is eight (96/12) while the price of channels one, two, and three is almost ten (227/23). Similarly, at the fifteenth select, channel nine is chosen because it has a lower price than the other ready channels. At the eighteenth select, channel one with a price of a little less than four (89/23) is chosen over channel four having a price of four and one-third (195/45), while at the twentieth select, channel four is chosen with a price of two and one-third (105/45) over channel five having a price of a little more than two and one-half (198/78). 
     Scanning through FIGS. 2b-2m, it can be seen that the ready counter of any channel is limited to a value of at most one (i.e. no excursion) as the provided technique successfully minimizes excursion. Indeed, it is believed that regardless of the number and relative rates of the chosen channels, the provided technique always minimizes excursion. 
     Turning to FIGS. 3b-3m, the status of the ready counters for the same nine channels used in FIGS. 2 (compare FIGS. 2a2 and 3a2) is shown where the framing method of U.S. Pat. No. 4,727,536 is utilized. As indicated, only channel nine ever has a ready counter exceeding a value of one. However, channel nine carries a one bit excursion from selects twenty-one through forty (See FIG. 3c), forty-one through fifty-three (See FIG. 3d), sixty-one through seventy-four (See FIG. 3e), and eighty-one through one hundred (See FIG. 3f), a two bit excursion from selects one hundred-one through one hundred fourteen, a one bit excursion from selects one hundred fifteen through one hundred twenty (See FIG. 3g), a two bit excursion from selects one hudnred twenty-one through one hundred thirty-three, a one bit excursion from selects one hundred thirty-four through one hundred thirty-six (See FIG. 3h), one hundred forty-one through one hundred fifty-seven (See FIG. 3i), one hundred sixty-one through hundred seventy-five (See FIG. 3j), one hundred eighty-one through one hundred ninety-seven (See FIG. 3k), and two hundred-one through two hundred eighteen (See FIG. 3l). 
     In comparing the selects of the instant invention as shown in FIGS. 2b-2m to the selects of the art as shown in FIGS. 3b-3m, it becomes clear that the provided method of the instant invention limits the excursion seen by the channels. Indeed, where many more channels are to be multiplexed with larger frames, it is not uncommon in the art to have excursions of four, five, or even more bits. However, with the instant invention, the channel excursions never even reach one bit. This is so, because by structuring the algorithm to select the channel having the lowest price (highest cost), without any other constraints, the excursion is minimized. 
     There has been described and illustrated herein a method for choosing channel selects for a frame of a multiplexer. While particular embodiments of the invention have been described, it is not intended that the invention be limited thereby, as it is intended that the invention be broad in scope and that the specifications be read likewise. Thus, while one embodiment of the preferred invention was described with channel ready counters which are incremented as the excursion increases, those skilled in the art will appreciate that the ready counters could be arranged to decrement when excursion increases. Or, because the value of the ready counter is always zero or one, a one bit indicator can be used to indicate the readiness of the channel. Similarly, while the preferred embodiment described channel select position counters which are decremented after each select and incremented upon their values reaching zero, the position counters can be incremented after each select and decremented after reaching a threshold relating to the number of selects in the frame. In fact, instead of using a position counter and then dividing the position counter by the number of selects for the particular channel in the frame, a &#34;price indicator&#34; can be used which combines the two functions. What is critical is that the price of each channel be updated after each select in a manner relating to their relative channel rates, such that the lowest priced ready ready channel may be selected. 
     Those skilled in the art will also understand that the &#34;price&#34; of a channel is inversely related to the &#34;cost&#34; of the channel such that the lowest priced channel is the highest cost channel. Thus, a determination of highest cost is completely equivalent to a determination of lowest price, and the two should be considered one and the same. Further, while the invention was described in terms of bit multiplexing, it will be appreciated that the provided algorithm is appropriate to byte multiplexing. In fact, the advantage of the invention is greater where bytes are multiplexed due to the relatively larger buffer size for bytes as opposed to bits. Finally, those skilled in the art should appreciate that the terminology used in describing the invention (e.g. &#34;channels&#34;, &#34;selects&#34;, &#34;counters&#34;, &#34;frame&#34;, &#34;price&#34;, &#34;cost&#34;, etc.) is intended to be broad and non-limiting so as to encompass what is readily understood by those skilled in the art. Therefore, it will be apparent to those skilled in the art that other changes and modifications may be made to the invention as described in the specificaion without departing from the spirit and scope of the invention as so claimed.