Top Banner
Addis Ababa Institute of Technology (AAIT) Department of Electrical and Computer Engineering ECEG-3201 Digital Logic Design
38
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Computer Engineering

ECEG-3201 Digital Logic Design

Page 2: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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.

Page 3: Eceg 3201-dld-lec 11-registers_and_asynchoronous_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.

Page 4: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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.

Page 5: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 6: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 7: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 8: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 9: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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.

Page 10: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

10 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Serial Out Shift Registers

Page 11: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 12: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

12 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Parallel Out Shift Registers

Page 13: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

13 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Serial In Parallel Out Shift Registers

Page 14: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 15: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

15 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel In Parallel Out Shift Registers

Page 16: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 17: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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”.

Page 18: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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.

Page 19: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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

Page 20: Eceg 3201-dld-lec 11-registers_and_asynchoronous_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

Page 21: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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.

Page 22: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

22 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

5 bit Ring Counters

Page 23: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

23 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

10 bit Ring Counters

Page 24: Eceg 3201-dld-lec 11-registers_and_asynchoronous_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

Page 25: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

25 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 bit Johnson Counter

Page 26: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

26 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 bit Johnson Counter

Page 27: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

27 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

5 bit Johnson Counter

Page 28: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

28 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

5 bit Johnson Counter

Page 29: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

29 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Counters

There are two basic types of counters

Asynchronous counters

Synchronous counters

Page 30: Eceg 3201-dld-lec 11-registers_and_asynchoronous_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.

Page 31: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

31 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

2-Bit Asynchronous Binary Counter

Page 32: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

32 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit Asynchronous Binary Counter

Page 33: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

33 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4-Bit Asynchronous Binary Counter

Page 34: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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.

Page 35: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

35 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

2-Bit Synchronous Counter

Page 36: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

36 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit Synchronous Counter

Page 37: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

37 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4-Bit Synchronous Counter

Page 38: Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters

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?