Communication between a computer and a peripheral device is usually done serially, while computation in the computer itself is usually performed with parallel logic circuitry. A shift register can be used to convert information from serial form to parallel form, and vice versa. Many different kinds of shift registers are available, depending upon the degree of sophistication required.
Counters – weight coding of binary numbers
In a sense, a shift register can be considered a counter based on the unary number system. Unfortunately, a unary counter would require a flip-flop for each number in the counting range. A binary weighted counter, however, requires only flip-flops to count to N. A simple binary weighted counter can be made using T flip-flops. The flip-flops are attached to each other in a way so that the output of one acts as the clock for the next, and so on. In this case, the position of the flip-flop in the chain determines its weight; i.e., for a binary counter, the”power of two” it corresponds to. A 3-bit (modulo 8) binary counter could be configured with T flip-flops as shown in Figure 1.4. A timing diagram corresponding to this circuit is shown in Figure 1.5.
Note that a set of lights attached to O0, O1, O2, would display the numbers of full clock pulses which had been completed, in binary (modulo 8), from the first pulse. As many T flip-flops as required could e combined to make a counter with a large number of digits.
Note that in this counter, each flip-flops changes state on the falling edge of the pulse from the previous flip-flop. Therefore there will e a slight time delay, due to the propagation delay of the flip-flops between the time one flip-flop changes state and the time the next one changes state, i.e., the change of state ripples through the counter, and these counters are therefore called ripple counters. As in the case of a ripple carry adder, the propagation delay can become significant for large counters.
It is possible to make, or buy in a single chip, counters which will count up, count down, and which can be preset to any desired number. Counters can also be constructed which count in BCD and base 12 or any other number base.
A count down counter can be made by connecting the Q output to the clock input in the previous counter. By the use of preset and clear inputs, and by gating the output of each T flip-flop with another logic level using AND gates (say logic 0 for counting down, logic 1 for counting up), then a presetable up-down binary counter can be constructed. Figure 1.6 shows an up-down counter, without preset or clear.