A buffering method and a buffer
The present invention relates to a method according to the preamble of the appended claim 1 for carrying out buffering in a digital telecommunication system, and a buffer according to the preamble of the appended claim 2.
It is often desirable that the buffering of both asynchronous signals and bit and byte synchronous signals should be carried out by the same circuit. This is especially true in a case where data is transferred from earlier plesiochronous systems to more recent synchronous systems such as the SDH system. For instance, CCITT (recommendation G.709) defines several different mapping modes (asynchronous, bit synchronous and byte synchronous) for a 2048 bit/s signal in the frame structure of the SDH system, depending on the type of the incoming 2048 kbit/s signal [i.e. do the bits arrive for instance asynchronously, or is there, in addition to the clock signal, for instance byte synchronization data (indicating which 8 bits are included in the same byte), frame synchronization data or multiframe synchronization data included] . Asynchronous, bit synchronous and byte synchronous signals are defined in CCITT recommendations G.703 and G.704.
As regards bit and byte synchronous signals, the synchronization is passed through a buffer typically so that together with every data bit, a separate synchronization bit is transferred.
The object of the present invention is to pro** **:de a solution which allows a combined bit and byte buf:....r to be implemented in the simplest possible manner. This object is achieved with the method and the buffer of the invention, the method being characterized
by what is described in the characterizing part of the appended claim 1, and the buffer being characterized by what is described in the characterizing part of the appended claim 2. The idea of the invention is to implement the buffer in a certain length with respect to the frame and byte lengths of the data to be transferred and to utilize this length in passing through a synchronization signal by forming a memory location for the synchronization signal bit adjacent to only one data bit. This allows the synchronization signal to be passed in the simplest possible manner through the buffer correctly, i.e. in such a way that the synchronization bit remains in its proper place all the time that the buffer is being read. It is thus possible to pass through the same buffer both an asynchronous signal bit by bit (no separate synchronization signal) or for instance a byte synchronous signal, it being thus possible to pass the synchronization through the buffer by means of an auxiliary memory location that is only one bit in breadth.
Due to the solution of the invention, the number of components decreases or silicon area is saved in those ASICs (Application Specific Integrated Circuit) where bufferings are implemented, because separate bit- and byte-based buffers are no longer needed but can be combined to form a single bit-format buffer.
In the following, the invention and its preferred embodiments are described in more detail with reference to the illustrative examples according to the appended drawings, in which
Figure 1A illustrates the principal features of the bit buffer of the invention,
Figure IB illustrates the interdependence between the frame structure of the data coming into the buffer and the buffer, and
Figure 2 shows a more detailed structural alternative of the bit buffer of the invention.
Figure 1 shows the principle of the elastic bit buffer of the invention in simplified form. The core of the buffer consists of a buffer memory 13 which functions as a temporary data storage and with which is associated in a manner known per se (a) a write counter 11, which controls the writing into the buffer memory by giving write addresses to the write input of the buffer memory and (b) a read counter 12, which controls the reading from the buffer memory by giving read addresses to the read input of the buffer memory. The write counter steps in synchronism with a write clock WR_CLK and the read counter in synchronism with a read clock RD_CLK.
In accordance with the invention, the buffer memory consists of M pieces of one-bit data memory locations 14, which are numbered from zero to (M-l), and of one memory location 15 which is arranged for the synchronization bit and which is adjacent to one data memory location 14. The buffer memory length M is connected with a frame 16 (Figure IB) of an incoming signal in such a way that the frame length in bits corresponds to the multiple of the buffer memory length.
In addition, the buffer memory length M must be divisible by the byte length (which is typically eight). The frame length F and the buffer memory length M correlate thus with each other in the following way:
F=KxM=LxB, in which B is the byte length (=8), K is an integer number (K=l,2,3... ), L is also an integer number
(the number of time slots in the frame) and L/K is an integer number.
For instance, in the case of 2048 kbit/s basic multiplex system, F=256 (32 8-bit time slots), in which case the buffer length M can be for instance M=64, i.e. a quarter of the frame length.
In accordance with the invention, adjacent to one data memory location 14 (in the same address as the data memory location) there is a similar memory location 15 for the synchronization bit. The synchronization is passed through the buffer by writing a synchronization bit SB to said adjacent memory location 15. In this exemplary case, the synchronization bit is written to the memory location adjacent to the data memory location in address zero, but the synchronization memory location can in principle be situated in any address 0...(M-1) (adjacent to the data memory location situated in said address).
Figure 2 shows a more detailed embodiment of the buffer of the invention. Data memory locations consist in this case of M pieces of D-flip-flops 21, to data inputs D of which is connected incoming data R_DATA. In the figure, the data memory locations are separated from each other by references M(0)...M(M-l) referring to their respective addresses. Besides being connected to the clock input of a write counter 22, the write clock signal WR_CLK is connected to the clock inputs of D-flip-flops 24 and 25 and to the clock inputs of the data memory locations 21. A signal WR_EN enabling writing is connected to enable inputs EN of the write counter 22, of the D-flip-flop 25 and of a decoder 23. The synchronization signal WR_S, which is passed through the buffer, is connected to the synchronization input LD of the write counter and to the data input D of the D-flip-flop 25. The pulse of the synchronization signal
constitutes a synchronization bit, which appears in the output of the D-flip-flop 25 at the same time as the write counter output has the value zero.
The output Q of the write counter 22 is connected to the decoder 23, which codes from the counter value an enable signal for each data memory location, this signal enabling writing to said memory location if the enable signal coming to the decoder is active. Besides being connected to the enable input EN of a data memory location 21/M(0) in the address zero, the enable signal acquired from the decoder output zero is connected to the enable input EN of a separate synchronization memory location 24 implemented by one D-flip-flop. In this case, the data memory location 21/M(0) and the synchronization memory location 24 are thus adjacent to each other in the address zero.
The output Q of each data memory location 21 is connected to a corresponding input of a data multiplexer 26, i.e. the output of the memory location zero (M(0)) is connected to the input zero of the data multiplexer, the input of the memory location one (M(l)) is connected to the input one of the multiplexer, etc. , and the output of the data memory location (M(M-l)) in the address M-l is connected to the input (M-l) of the multiplexer.
As regards the output Q of the synchronization memory location 24, it is connected to the first data input (input zero) of the multiplexer 26. To the other data inputs (inputs l-(M-l)) of the multiplexer is connected a fixed value F (zero, for instance), and to the selection input SEL of the multiplexer is connected the output Q of a read counter 28. A synchronization signal RD_S is thus acquired from the output of the multiplexer 27.
The write counter 22 steps in synchronism with the write clock signal R_CLK continuously from zero to value (M-l), thus counting incoming bits. Controlled by the decoder, the data bits are written into the data memory locations 21 in succession in such a way that the first bit is written in the address zero, the second bit in the address one etc., and after M bits, the whole procedure is restarted by writing again in the address zero (from which the previous value has by then been read out). During one frame of the incoming signal, the write counter rotates K (for instance 4) revolutions (K=F/M), the synchronization bit SB being thus written into the associated memory location 24 in every K:th revolution when it is assumed that the synchronization bit appears once in the frame.
The read counter steps in a similar manner in synchronism with the read clock signal RD_CLK. When the read counter has the value zero, the synchronization bit is selected to the output of the multiplexer 27, and with the other values of the counter, a predetermined fixed value F is selected to the output.
The output signal of each data memory 0...(M-l) is selected one after another to the output of the data multiplexer 26, whereby a data signal passed through the buffer is acquired from the output of the data multiplexer (this signal being indicated by reference RD_DATA), and the synchronization signal RD_S passed through the buffer is acquired from the output of the multiplexer 27. Even though the invention has been described above with reference to the examples of the accompanying drawings, it will be apparent that the invention is not so restricted but can be varied within the scope of the inventive concept presented above and in the appended claims. The more detailed embodiment of the buffer can
be modified for instance with respect to the memory locations by implementing them for instance by either RAM blocks or latches instead of D-flip-flops. Also the form of the synchronization data passed through the buffer can vary: it is possible to use for instance a frame sync signal as the syncronization signal coming into the buffer and to equip the stages following the buffer with counters that count to B (to eight), whereby the byte sync can be determined.