39
EE24C Digital Electronics Projects Counters and Registers

EE24C Digital Electronics Projects

  • Upload
    erol

  • View
    56

  • Download
    1

Embed Size (px)

DESCRIPTION

EE24C Digital Electronics Projects. Counters and Registers. Definitions. A synchronous circuit is a sequential circuit whose input/output changes are synchronized by a reference signal called clock signal. Basic synchronous circuits include: - PowerPoint PPT Presentation

Citation preview

Page 1: EE24C Digital Electronics Projects

EE24C Digital Electronics Projects

Counters and Registers

Page 2: EE24C Digital Electronics Projects

Definitions• A synchronous circuit is a sequential

circuit whose input/output changes are synchronized by a reference signal called clock signal.

• Basic synchronous circuits include:– Counters (sequential circuits configure in a

specific form in order to count clock ticks).– Registers (for elementary storage and shift

operations)– Random-Access Memories (RAMs) for

Read/write operations.

Page 3: EE24C Digital Electronics Projects

Basic Synchronous Circuits • Characteristics:

– Clocked by stable clock signal (crystal oscillator)

– Set of input and output data lines– Set of control signals– Can be described using FSMs– Can be implemented using basic

synchronous cells (DFFs and JKFFs).– Exist as MSI (medium scale integrated)

circuits.– Their designs often require the use of some

combinational elements.

Page 4: EE24C Digital Electronics Projects

Parallel Load Register• Characteristics:

– A n-bit parallel load register is an ordered set of n FFs that are used to store n-bit word.

– It has n-bit input and n-bit Output Data– A set of control signals: Load (LD), Clear

(CLR)

Page 5: EE24C Digital Electronics Projects

N-bit Parallel Register

Data input X

Data output Z

LD(Load)

CLK

CLR(Clear)

Inputs: X = (xn-1, xn-2,…x0), xi{0,1}

LD, CLR {0,1} Outputs: Z = (zn-1,…, z0) zi {0,1}

State: S = (Sn-1, …, S0), Si{0,1}

Function: State Transition and Output functions

)()(

1 CLR if 0.....0

0 CLR and 0 LD if )(

0 CLR and 1 LD if )(

*)1(

tStZ

tS

tX

NSStS

Figure: N-bit parallel register.

Page 6: EE24C Digital Electronics Projects

How can we design a n-bit register from the specification given previously?

a. By analyzing the specification, it appears that DFFs can be used in order to implement the Load operation.

b. The outputs of the register change according to the values of the two control signals LD and CLR Use of a MUX

c. We must avoid the condition LD = CLR=1.

Page 7: EE24C Digital Electronics Projects

4-Bit parallel Register:

Parallel load registers exist in different MSI flavors.

Page 8: EE24C Digital Electronics Projects

Multibit registers and latches

• 74x175

Page 9: EE24C Digital Electronics Projects

8-bit (octal) register

• 74x374– 3-state

output

Active on a high level.

Page 10: EE24C Digital Electronics Projects

Other octal registers• 74x273

– asynchronous clear

• 74x377– clock enable

Page 11: EE24C Digital Electronics Projects

Octal latch• 74x373

– Output enable– Latch-enable input “C” or “G”

• Register vs. latch, what’s the difference?– Register: edge-triggered behavior– Latch: output follows input when G is asserted

Page 12: EE24C Digital Electronics Projects

Shift Registers• There are many situations in digital

systems design where it’s useful to be able to shift the contents of a register to the left or the right.

• A right-shift operation changes the register states as follows:– (0, zn-1, zn-2, ……..z1) (zn-1, zn-2, ………..z1,

z0),

• A left shift performs the transformation:– (zn-2, ………..z1, z0,0) (zn-1, zn-2, ………..z1,

z0)

Page 13: EE24C Digital Electronics Projects

• A shift register is an n-bit register with a provision for shifting its stored data by one bit position at each clock ticks.

• We have different configurations:– Serial-in/Serial-out shift register– Serial-in/Parallel-out shift register (for serial-

to-parallel conversion)– Parallel-in/Serial-out shift register (for

parallel-to-serial conversion)

Page 14: EE24C Digital Electronics Projects

• A register organized to allow left- or right-shift operations of this kind is called a shift register. The following shows a block diagram of a universal registers with load and shift features.

Page 15: EE24C Digital Electronics Projects

• The high-level specification of the universal register is given as follows

Page 16: EE24C Digital Electronics Projects

• More details about the control signals:

Page 17: EE24C Digital Electronics Projects

• The following figure shows a 4-bit bidirectional shift register

Page 18: EE24C Digital Electronics Projects

• Serial-in, serial-out

Page 19: EE24C Digital Electronics Projects

Serial-to-parallel conversion• Use a serial-

in, parallel-out shift register

Page 20: EE24C Digital Electronics Projects

Parallel-to-serial conversion

• Use parallel-in, serial-out shift register

mux

Page 21: EE24C Digital Electronics Projects

Do both

• Parallel-in, parallel-out shift register

Page 22: EE24C Digital Electronics Projects

“Universal” shift

register74x194

• Shift left• Shift

right• Load• Hold

Page 23: EE24C Digital Electronics Projects

One stage of ’194

Page 24: EE24C Digital Electronics Projects

Counters• A counter is a simple sequential machine designed

to cycle through a predetermined sequence of p distinct states S0, S1,…..Sp-1 in response to pulses on an input line. The p states usually represent k consecutive numbers; the state transitions can be thus described by the expression Si+1 Si + 1 (modulo k). (Si = s(t) and Si+1 = s(t+1)

• Each input pulse increments the state by 1; the machine can therefore be viewed as counting the input pulses.

• Counters come in many different varieties depending on the number codes used, the modulus p, and the timing mode (synchronous or asynchronous)

Page 25: EE24C Digital Electronics Projects

State diagram of a modulo-p counter:

 

Page 26: EE24C Digital Electronics Projects

Counter specification:

Page 27: EE24C Digital Electronics Projects

Type of counter (up or down):

The simplest counters can be obtained by minor modifications of an ordinary register or a shift register. The next figure shows a modulo-16 binary counter composed of four JK flip-flops. This circuit counts the pulses on the count enable line. Note that the output of each flip-flop may alter the state of its right neighbour, so that the "carry" signal ripple through the counter from left to right. This type of counter is therefore called ripple counter (asynchronous) counter.

Page 28: EE24C Digital Electronics Projects

Figure: A modulo-16 ripple counter: (a) logic diagram; (b) symbol.

Page 29: EE24C Digital Electronics Projects

A counter is basically a serial-input parallel-output device. As in the case of shift registers, it can be useful to have a parallel load capability. Another refinement that is occasionally useful is to permit the counter to be decremented as well as incremented (Up-Down counter).

Counters are also available whose modulus can be altered by means of modulus-select control lines; such counters are frequently termed programmable.

Page 30: EE24C Digital Electronics Projects

The specification of a binary counter with parallel in puts is given as follows:

Page 31: EE24C Digital Electronics Projects

An illustration of a modulo-16 binary counter of this type is given in the figure below.

A modulo-16 binary counter with parallel input.

Page 32: EE24C Digital Electronics Projects

74x163 MSI 4-bit counter

A parallel-load up/down counter

Page 33: EE24C Digital Electronics Projects

Counter operation• Free-running 16• Count if ENP and

ENT both asserted.• Load if LD is asserted

(overrides counting).• Clear if CLR is asserted (overrides

loading and counting).• All operations take place on rising CLK

edge.• RCO is asserted if ENT is asserted and

Count = 15.

Page 34: EE24C Digital Electronics Projects

Free-running 4-bit ’163 counter

• “divide-by-16” counter

Page 35: EE24C Digital Electronics Projects

Modified counting sequence

• Load 0101 (5) after Count = 15• 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 6, …• “divide-by-11” counter

Page 36: EE24C Digital Electronics Projects

Another way

• Clear after Count = 1010 (10)• 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, …• “modulo-11” or “divide-by-11” counter

trick to save gate inputs

Page 37: EE24C Digital Electronics Projects

Counting from 3 to 12

Page 38: EE24C Digital Electronics Projects

Cascading counters• RCO (ripple carry out) is asserted in

state 15, if ENT is asserted.

Page 39: EE24C Digital Electronics Projects

Decoding binary-counter states