Feed Headline Animator

Buffering in computer

Buffering:-
Buffer is a special kind of memory location, where data is stored temporary. Buffer is used with put devices and also with output devices.
An input buffer holds the data received from an input device before going for processing, while an output buffer holds the data received from the main memory before it is send to the output device.

Buffer is used to compensate the difference between high speed processor and low speed I/O devices.

Why Buffer is used:-

To read data directory from input devices decrease the efficiency of C.P.U.

Similarly when processor sends data to output device directly, it is a chance of loss of data because of its low speed. Therefore memory areas are needed which hold the data before processed. These memory locations are called buffers.

By using buffers C.P.U was used efficiently as well as I/O device were kept busy all the time. The time was also saved up to a limit because when C.P.U is processing at the same time I/O devices are busy for reading and writing. Buffering technique is used to operate slower devices with faster C.P.U.

Buffering Techniques:-

The techniques that are used to increase the efficiency of a processor are called as buffering techniques. Following buffering techniques are used.

Type of buffer:-

1. Single buffering.
2. Double buffering.
3. Cyclic buffering.

1. Single Buffering:-

In the techniques only one buffer is used between input and C.P.U and C.P.U to output. The buffer accepts the data from an input device character by character and when the buffers were filled then it is transferred to the C.P.U. The C.P.U accepts the data as a whole and processes it, in the mean time the empty buffer again filled character by character. The processed data is transferred to output buffer and from this buffer it is again transferred to the output device.

2. Double Buffering:-

In this technique two or more then two buffers are used.

The data is transferred from input device to the first buffer when it is filled then it is moved to C.P.U and at the same time 2nd buffer is start filling and when is filled and transferred to C.P.U the first buffer is ready for again getting data. It increases the efficiency of C.P.U.

3. Cyclic buffering:-

In double buffering technique memory space is wasted, therefore another buffering technique called cyclic buffering is used. In this technique a long single buffer is establish in which data is input by buffer pointer and outputted through user pointer. The buffer pointer writes the inputted data character by character in the buffer and the user pointer remove the data from it. A character is placed at the end of line. If the data printed is faster then the processing then the buffer pointer might over take the processing pointer and over writing may take place. In case of over writing the previous data is missed but if processing pointer or user pointer is faster then the inputting data then the processing pointer may over take the buffer pointer. This problem can be solved by using halt line pointer.
Halt line pointer indicate that last character stored in buffer which is not read for processing.


Posted by: Wasim Javed

No comments:

Post a Comment