eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

38
Addis Ababa Institute of Technology (AAIT) Department of Electrical and Computer Engineering ECEG-3201 Digital Logic Design

Upload: nibretu-alemneh

Post on 16-Jul-2015

112 views

Category:

Documents


2 download

TRANSCRIPT

Addis Ababa Institute of Technology (AAIT) Department of Electrical and

Computer Engineering

ECEG-3201 Digital Logic Design

AAIT, Department of Electrical and Computer

Engineering

Nebyu Yonas Sutri 2

Learning Outcomes

At the end of the lecture, students should get

familiarized with;

Registers.

Counters.

3 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Registers

A flip-flop stores one bit of information. When a set of

n flip-flops are used to store n bits of information,

such as an n-bit number, we refer to these flip-flops

as a register.

Register is a digital circuit with two basic functions;

data storage and data movement.

A common clock is used for each flip-flop in a register.

A register that provides the ability to shift its contents

is called a shift register.

4 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Registers

Transmitting n bits of information at once using n

separate wires is called parallel transfer.

But it is also possible to transfer all bits using a single

wire, by performing the transfer one bit at a time, in n

consecutive clock cycles. We refer to this scheme as

serial transfer.

5 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Shift Registers A shift register is a sequential logic device made up of

flip-flops that allows parallel or serial loading and

serial or parallel outputs as well as shifting bit by bit.

A shift register is an n-bit register with a provision for

shifting its stored data by one bit position at each tick

of the clock.

There are different types of shift registers.

Serial in Serial Out

Serial in Parallel Out

Parallel in Serial Out

Parallel in Parallel Out

6 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Shift Registers

This sequential device loads the data present on its

inputs and then moves or “shifts” it to its output once

every clock cycle, hence the name “Shift register”.

Common tasks of shift registers:

Serial/Parallel data conversion

UART (universal asynchronous receiver/transmitter)

Time delay

Ring counter

Twisted-ring counter or Johnson counter

Memory device

7 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Characteristics of Shift Registers

Number of bits (4-bit, 8-bit, etc.)

Loading

Serial

Parallel (asynchronous or synchronous)

Common modes of operation.

Parallel load

Shift right-serial load

Shift left-serial load

Hold

Clear

Recirculating or non-recirculating

8 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial/Parallel Data Conversion

1 0 1 0 1 1 1 1 Serial in Serial out

Shift registers can be used to convert from serial-

to-parallel or the reverse from parallel-to-serial.

1 0 1 0 1 1 1 1 Serial in

Parallel out

1 0 1 0 1 1 1 1 Serial out

Parallel in

1 0 1 0 1 1 1 1

Parallel in

Parallel out

9 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Serial Out Shift Registers

Serial-In Serial-Out (SISO) - the data is shifted

serially “IN” and “OUT” of the register, one bit at a

time in either a left or right direction under clock

control.

10 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Serial Out Shift Registers

11 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Serial Out Shift Registers

Clk pulse

no.

FF0 FF1 FF2 FF3

0 0 0 0 0

1 0 0 0 0

2 1 0 0 0

3 0 1 0 0

4 1 0 1 0

5 0 1 0 1

6 0 0 1 0

7 0 0 0 1

8 0 0 0 0

Data IN = 1010

Data OUT =00001010

12 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Parallel Out Shift Registers

13 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Parallel Out Shift Registers

14 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel In Serial Out Shift Registers

Clk pulse

no.

FF0 FF1 FF2 FF3

0 0 0 0 0

1 1 0 1 0

2 0 1 0 1

3 0 0 1 0

4 0 0 0 1

5 0 0 0 0

Data IN = 1010

15 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel In Parallel Out Shift Registers

16 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel In Parallel Out Shift Registers

Clk pulse

no.

FF0 FF1 FF2 FF3

0 0 0 0 0

1 1 0 1 0

2 0 1 0 1

3 0 0 1 0

4 0 0 0 1

5 0 0 0 0

Data IN = 1010

17 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Universal Shift Register

Universal Shift Register is a register that has both

serial and parallel input and output capability.

Today, there are many high speed bi-directional

“universal” type Shift Registers available such as the

TTL 74LS194, 74LS195,74HC194 or the CMOS 4035

which are available as 4-bit multi-function devices that

can be used in either serial-to-serial, left shifting, right

shifting, serial-to-parallel, parallel-to-serial, or as a

parallel-to-parallel multifunction data register, hence

the name “Universal”.

18 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Universal Shift Register

Universal shift registers are very useful digital

devices. They are frequently used in arithmetic

operations to shift data to the left or right for

multiplication or division.

19 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Shift Register based Counters

A shift register counter is basically a shift

register with the serial output connected to the

serial input to produce a special sequence.

There are two basic types of counters which are

based on shift registers

Ring counters

Johnson counters

20 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Ring Counters In a ring counter the output of the most

significant stage is fed back to the input of the

least significant stage.

E.g. 4 bit ring counter

21 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 bit Ring Counters

It got only 4 distinct states, hence mod-4 counter. Only

4 of the maximum 16 states are used, making ring

counters very inefficient in terms of state usage.

But the major advantage of a ring counter over a

binary counter is that it is self-decoding. No extra

decoding circuit is needed to determine what state the

counter is in.

22 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

5 bit Ring Counters

23 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

10 bit Ring Counters

24 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Johnson Counters

Johnson counters are a variation of standard

ring counters, with the inverted output of the

last stage fed back to the input of the first

stage.

They are also known as twisted ring counters.

An n-stage Johnson counter yields a count

sequence of length 2n modulus, so it may be

considered to be a mod-2n counter.

E.g. 4 bit and 5 bit Johnson counters

25 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 bit Johnson Counter

26 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 bit Johnson Counter

27 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

5 bit Johnson Counter

28 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

5 bit Johnson Counter

29 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Counters

There are two basic types of counters

Asynchronous counters

Synchronous counters

30 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Asynchronous counters

Counters that do not have a fixed time relationship

with each other and generally do not count at the

same time.

An asynchronous counter is one in which the

flip-flops within it do not change states at exactly

the same time because they do not have a

common clock pulse.

Also known as ripple counters.

31 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

2-Bit Asynchronous Binary Counter

32 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit Asynchronous Binary Counter

33 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4-Bit Asynchronous Binary Counter

34 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Synchronous Counter

The counter have a fixed time relationship with

each other and generally count at the same time.

A synchronous counter is one which all the

flip-flops are connected to the same clock.

35 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

2-Bit Synchronous Counter

36 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit Synchronous Counter

37 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4-Bit Synchronous Counter

38 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Reading assignment.

Read about synchronous counters design, on

Fundamentals of digital logic with verilog design,

Section 8.7, page 495-505.

What to Do this Week?