counters dr. rebhi s. baraka [email protected] logic design (csci 2301) department of computer...

30
Counters Dr. Rebhi S. Baraka [email protected] Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University of Gaza

Upload: benjamin-russell

Post on 16-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Counters

Dr. Rebhi S. [email protected]

Logic Design (CSCI 2301)Department of Computer Science

Faculty of Information TechnologyThe Islamic University of Gaza

Page 2: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Outline

• Asynchronous Counter Operation • Synchronous Counter Operation • Up/Down Synchronous Counters• Design of Synchronous Counters• Counter Application

Page 3: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Asynchronous Counter Operation

• A 2-Bit Asynchronous Binary Counter– FF0 is triggered by the clock; at the positive going

edge of.– FF1 is triggered by the Q0 output of FF0; at the

positive going transition.

Page 4: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Timing diagram for the 2-bit counter.

Page 5: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

• A 3-Bit Asynchronous Binary Counter– FF0 is triggered by the clock; at the positive going

edge of.– FF1 is triggered by the Q0 output of FF0; at the

positive going transition.– FF2 is triggered by the Q1 output of FF1; at the

positive going transition.

Page 6: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

3-bit asynchronous binary counter and its timing diagram for one cycle .

Page 7: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

• A 4-Bit Asynchronous Binary Counter– FF0 is triggered by the clock; at the positive going

edge of.– FF1 is triggered by the Q0 output of FF0; at the

positive going transition.– FF2 is triggered by the Q1 output of FF1; at the

positive going transition.– FF3 is triggered by the Q2 output of FF2; at the

positive going transition.

Page 8: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Four-bit asynchronous binary counter and its timing diagram .

Page 9: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Asynchronous Decade Counters• These counters have 10 states in their sequence.• A decade counter of states from 0000 to 1001 is called

a BCD decade counter.• Since the counter would have 16 states, it is forces to

recycle before going through all of its possible state.• The BCD decade counter is recycled to 0000 after the

1001 state.– This is done as shown in the next slide by decoding count

1010 with an NAND gate and– connecting the output of the NAND gate to the clear

inputs of the flip-flops.• What is Partial decoding?

– Two unique states (in this case) are sufficient to decode the count of ten .

Page 10: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

An asynchronously clocked decade counter with asynchronous recycling .

Page 11: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

• 2-Bit Synchronous Binary Counter– Both flip-flops are triggered by the clock.– FF0 is in the toggle mode.– The J and K inputs of FF1 are having 00 or 11

depending on Q0

Synchronous Counter Operation

Page 12: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Timing diagram for the 2-bit synchronous counter.

Page 13: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Timing details for the 2-bit synchronous counter operation (the propagation delays of both flip-flops are assumed to be equal).

Page 14: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

3-bit synchronous binary counter

Page 15: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

4-bit synchronous binary counter

Page 16: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Synchronous BCD decade counter

•J0 = K0 = 1•J1 = K1 = Q0Q3

•J2 = K2 = Q0Q1

•J3 = K3 = Q0Q1Q2 + Q0Q3

Page 17: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Timing diagram for the BCD decade counter (Q0 is the LSB) .

Page 18: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Up/Down Synchronous Counters

• Called also bidirectional counter• It is capable of progressing in either direction

up or down in a certain sequence• We study 3-bit up/down synchronous

counter

Page 19: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

3-bit up/down synchronous counter

J0 = K0 = 1

J1 = K1 = Q0·UP + Q0·DOWN

J2 = K2 = Q0Q1·UP + Q0·Q1·DOWN

Page 20: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

A basic 3-bit up/down synchronous counter .

Page 21: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University
Page 22: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Design of Sequential Circuit• A sequential circuit (state machine) consists of

a combinational logic section and a memory section (flip-flops).

Page 23: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

• The information in the memory and the inputs to them combinational logic are required for the operation of the circuit.

• Not all sequential circuits are required to have inputs and outputs.

• All sequential circuits have excitation variables and state variables.

Design of Sequential Circuit

Page 24: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Design Procedure for Sequential Circuits as Applied to Counters• Steps:

– State diagram– Next-State Table– Transition Table– Karnaugh Maps– Input Logic– Implementation

Page 25: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

State Diagram

State diagram for a 3-bit Gray code counter.

Page 26: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Examples of the mapping procedure for the counter sequence represented .

Next-State Table

Page 27: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Karnaugh maps for present-state J and K inputs.

Page 28: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Three-bit Gray code counter.

Page 29: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

Example: Designing a counter with the irregular binary sequence 1-> 2 -> 5 -> 7

We work this example entirely on the black board.

Page 30: Counters Dr. Rebhi S. Baraka rbaraka@iugaza.edu Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University

End of the slides

These slides are based on Digital Fundamentals 9th ed. By Thomas Floyd