You are on page 1of 27

Registers

Registers
Registers hold larger quantities of data than individual flip-flops. Registers are central to the design of modern processors. There are many different kinds of registers. Well show some applications of these special registers. Flip-flops are limited because they can store only one bit. We had to use two flip-flops for our two-bit counter examples. Most computers work with integers and single-precision floating-point numbers that are 32-bits long. A register is an extension of a flip-flop that can store multiple bits. Registers are commonly used as temporary storage in a processor. They are faster and more convenient than main memory. More registers can help speed up complex calculations.

Registers 1.2

Basic registers are easy to build. We can store multiple bits just by putting a bunch of flip-flops together! A 4-bit register internal implementation is below. This register uses D flip-flops, so its easy to store data without worrying about flip-flop input equations. All the flip-flops share a common CLK and CLR signal.

Registers 1.3

Shift Register Applications


Shift Registers are an important Flip-Flop configuration with a wide range of applications, including:

Computer and Data Communications Serial and Parallel Communications Multi-bit number storage Sequencing Basic arithmetic such as scaling (a serial shift to the left or right will change the value of a binary number a power of 2) Logical operations

Shift registers
shifts its output once every clock cycle. A shift register
Q0(t+1) = Q1(t+1) = Q2(t+1) = Q3(t+1) = SI Q0(t) Q1(t) Q2(t)

SI is an input that supplies a new bit to shift into the register. For example, if on some positive clock edge we have:
SI = 1 Q0-Q3 = 0110

then the next state will be:


Q0-Q3 = 1011 The current Q3 (0 in this example) will be lost on the next cycle.

Shift direction
Q0(t+1) = Q1(t+1) = Q2(t+1) = Q3(t+1) = SI Q0(t) Q1(t) Q2(t)

The circuit and example make it look like the register shifts right.
Present Q0-Q3 ABCD SI X Next Q0-Q3 XABC

But it really depends on your interpretation of the bits. If you consider Q3 to be the most significant bit instead, then the register is shifting in the opposite direction!
Present Q3-Q0 DCBA SI X Next Q3-Q0 CBAX
6 Registers 1.6

Registers

Shift registers with parallel load


We can add a parallel load, just like we did for regular registers. When LD = 0, the flip-flop inputs will be SIQ0Q1Q2, so the register shifts on the next positive clock edge. When LD = 1, the flip-flop inputs are D0-D3, and a new value is loaded into the shift register, on the next positive clock edge.

Registers

Basic Shift Register Shift register consist of arrangements of flip-flop and are important in applications involving the storage and transfer of data in a digital system. Serial in/serial out shift registers Serial in/parallel out shift registers Parallel in/serial out shift registers Parallel in/parallel out shift registers Bidirectional shift registers

Registers 1.8

Parallel versus Serial


Serial communications: provides a binary number as a sequence of binary digits, one after another, through one data line.

Parallel communications: provides a binary number as binary digits through multiple data lines at the same time.

Shift Registers
Shift Registers are devices that store and move data bits in serial (to the left or the right),

..or in parallel,

..or a combination of serial and parallel.

Registers 1.11

Configuration

In Shift Registers, the binary digit transfers (shifts) from the output of one flip-flop to the input of the next individual Flip-Flop at every clock edge. Once the binary digits are shifted in, the individual Flip-Flops will each retain a bit, and the whole configuration will retain a binary number.

Construction
Shift registers are constructed from flip-flops due to their characteristics:
Edge-triggered devices Output state retention

Each Flip-Flop in a shift register can retain one binary digit.


For instance, if a 5-bit binary number needs to be stored and shifted, 5 flip-flops are required.

Each binary digit transfer operation requires a clock edge.


Asynchronous inputs are useful in resetting the whole configuration.

Shift Register Construction


Shift registers are comprised of D Flip-Flops that share a common clock input.

D Q Q

D Q Q

D Q Q

Combinations of Data Transfer Methods


SISO: Serial In, Serial Out
10110 10110 10110

SIPO: Serial In, Parallel Out 10110


10110

PISO: Parallel In, Serial Out

10110

10110

PIPO: Parallel In, Parallel Out


10110 How many clock edges are required for each operation?

SISO Flip-Flop Shift Register


a Serial In Serial Out shift register has a single input and a single output

Input

D Q Q

D Q Q

D Q Q

Output

4-bit version

One-bit at a time on a single line

Registers 1.17

Four Bits (1010) being entered serially into the register

Registers 1.18

Four Bits (1010) being serially shifted out of the register and replaced by all zeros

Registers 1.19

SIPO Flip-Flop Shift Register


a Serial In Parallel Out shift register has a single input and access to all outputs

Output

Output

Output

Input

D Q Q

D Q Q

D Q Q

Registers 1.20

PISO Flip-Flop Shift Register


a Parallel In Serial Out shift register requires additional gates, and the parallel input must revert to logic low.

Input

Input

Input
Output
D Q Q

D Q Q

D Q Q

PIPO Flip-Flop Shift Register


a Parallel In Parallel Out register has the simplest configuration. It represents a memory device.

Input
D Q Q

Input
D Q Q

Input
D Q Q

Output

Output

Output

Universal Shift Registers


Universal Shift Registers can be configured to operate in a variety of modes. For instance, they can be configured to have either Serial or Parallel Input/Output. Internally use steering gates to determine:
Serial input/output direction Parallel input (load) Hold

Universal Shift Registers


Look up the 74LS194 and describe its function by looking at the schematic. Fill in the table. S0 S1 Mode

0
0 1 1

0
1 0 1

24 Registers 1.24

Application: Parallel transferring the contents of a Register to another register.

Describe where this circuit combination may be used.

JK Shift Registers
J-K Shift registers are seldom used, as two inputs (J,K) are required to load the first flip-flop (note all others receive only set or reset inputs).

Input Input

Output

Registers summary
A register is a special state machine that stores multiple bits of data. Several variations are possible: Parallel loading to store data into the register. Shifting the register contents either left or right. Counters are considered a type of register too! One application of shift registers is converting between serial and parallel data. Most programs need more storage space than registers provide. Well introduce RAM to address this problem. Registers are a central part of modern processors, as we will see in coming weeks.

Registers 1.27

You might also like