Chapter 6 Registers and Counters

Slides:



Advertisements
Similar presentations
CSE 205: Digital Logic Design
Advertisements

Registers and Counters
CENG 241 Digital Design 1 Lecture 11
RIPPLE COUNTERS A register that goes through a prescribed sequence of states upon the application of input pulses is called a counter. The input pulses.
Registers and Counters
第10章 移位暫存器 10-1 移位暫存器的基本功能 10-2 串列輸入/輸出移位暫存器 10-3 其他移位暫存器的線路型態
Logic and Computer Design Fundamentals Registers and Counters
COE 202: Digital Logic Design Sequential Circuits Part 4 KFUPM Courtesy of Dr. Ahmad Almulhem.
Sequential Circuit Introduction to Counter
C HAPTER S IX R EGISTERS AND C OUNTERS 1. A clocked sequential circuit consists of a group of flip-flops and combinational gates connected to form a feedback.
A.Abhari CPS2131 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers:
Mantıksal Tasarım – BBM231 M. Önder Efe
Registers and Counters
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
Counters  A counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship.
Registers and Counters
Chapter 1_4 Part II Counters
Flip-Flop Applications Registers.  a register is a collection of flip-flops  basic function is to hold information  a shift register is a register.
EE345: Introduction to Microcontrollers Register and Counters Prof. Ahmad Abu-El-Haija.
CSI-2111 Computer Architecture Ipage Sequential circuits, 2nd part v Objectives: To recognize and know to use the principal types of sequential.
Registers & Counters M. Önder Efe
Registers(暫存器)與Counters(計數器):
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
Registers and Counters
Rabie A. Ramadan Lecture 3
Chapter 6 Registers and Counter
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:
Digital Design Lectures 11 & 12 Shift Registers and Counters.
7-6 단일 레지스터에서 Microoperation Multiplexer-Based Transfer  Register 가 서로 다른 시간에 둘 이상의 source 에서 data 를 받을 경우 If (K1=1) then (R0 ←R1) else if (K2=1) then.
1 Registers & Counters Logic and Digital System Design - CS 303 Erkay Savaş Sabancı University.
ENG241 Digital Design Week #8 Registers and Counters.
Registers and Counters Chapter 6. Digital Circuits 2 Clocked sequential circuits a group of flip-flops and combinational gates connected to form a feedback.
Chap 5. Registers and Counters. Chap Definition of Register and Counter l a clocked sequential circuit o consist of a group of flip-flops & combinational.
Chapter 1_4 Part III more on … Counters Chapter 1_4 Part III more on … Counters.
REGISTER A register is a group of flip-flops. Each flip- flop is capable of storing one bit of informa­ tion. An n-bit register consists of a group of.
Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.
Summary Counting in Binary
CHAPTER 6 Sequential Circuits’ Analysis CHAPTER 6 Sequential Circuits’ Analysis Sichuan University Software College.
Registers and Counters
C HAPTER S IX R EGISTERS AND C OUNTERS 1. A clocked sequential circuit consists of a group of flip-flops and combinational gates connected to form a feedback.
Digital Fundamentals Tenth Edition Floyd Chapter 9.
Digital Electronics.
COUNTERS Why do we need counters?
Counters.
Chap 5. Registers and Counters
DIGITAL COMPONENTS. MULTIPLEXERS A multiplexer is a combinational circuit that receives binary information from one of 2 n input data lines and directs.
Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi.
Counters and registers Eng.Maha Alqubali. Registers Registers are groups of flip-flops, where each flip- flop is capable of storing one bit of information.
Logic Design (CE1111 ) Lecture 6 (Chapter 6) Registers &Counters Prepared by Dr. Lamiaa Elshenawy 1.
1 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers: parallel and.
1 CHAPTER 12 REGISTERS AND COUNTERS This chapter in the book includes: Objectives Study Guide 12.1Registers and Register Transfers 12.2Shift Registers.
Digital Design: With an Introduction to the Verilog HDL, 5e M. Morris Mano Michael D. Ciletti Copyright ©2013 by Pearson Education, Inc. All rights reserved.
FLIP FLOPS Binary unit capable of storing one bit – 0 or 1
FIGURE 6.1 Four‐bit register
EKT 221 – Counters.
EKT 221 : Digital 2 COUNTERS.
Registers and Counters
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
COE 202: Digital Logic Design Sequential Circuits Part 4
29-Nov-18 Counters Chapter 5 (Sections ).
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Computer Architecture and Organization: L02: Logic design Review
6. Registers and Counters
Switching Theory and Logic Design Chapter 5:
Digital Logic Department of CNET Chapter-6
Digital Logic Department of CNET Chapter-6
Outline Registers Counters 5/11/2019.
Digital Electronics and Logic Design
Presentation transcript:

Chapter 6 Registers and Counters Digital System 數位系統 Chapter 6 Registers and Counters Ping-Liang Lai (賴秉樑)  

Outline of Chapter 6 6.1 Registers 6.2 Shift Registers 6.3 Ripple Counters 6.4 Synchronous Counters 6.5 Other Counters 6.6 HDL for Registers and Counters

6.1 Registers (暫存器) Clocked sequential circuits Register (暫存器) A group of flip-flops and combinational gates. Connected to form a feedback path. Flip-flops + Combinational gates (essential) (optional) Register (暫存器) A group of flip-flops. Gates that determine how the information is transferred into the register. Counter (計數器) A register that goes through a predetermined sequence of states.

6-1 Registers A n-bit register n flip-flops capable of storing n bits of binary information. 4-bit register is shown in Fig. 6.1. Clear =0 (active low); Ax = 0 Clock= ↑; Ax=Ix Normal Operation; Clear =1 Fig. 6.1 Four-bit register

4-bit Register with Parallel Load 1/0 0/1 1/0 load' load 0/1 1/0 1: Parallel load 0: No change Fig. 6.2 Four-bit register with parallel load

Fig. 6.3 Four-bit shift register 6-2 Shift Registers Shift register (移位暫存器) A register capable of shifting its binary information in one or both directions. Simplest shift register 1 1 1 1 1 1 1 Fig. 6.3 Four-bit shift register

Data Transfer Serial transfer (串列轉移) vs. Parallel transfer (並列轉移) Information is transferred one bit at a time. Shifts the bits out of the source register into the destination register. Parallel transfer All the bits of the register are transferred at the same time.

Fig. 6.4 Serial transfer from register A to register B Example: Serial transfer from reg A to reg B Synchronous Fig. 6.4 Serial transfer from register A to register B

Serial Transfer (2/2) Example: Serial transfer from reg A to reg B.

Serial Addition using D Flip-Flops 被加數 1 0101 0010 加數 1 1 1 1 1 0011 ?001 Fig. 6.5 Serial adder (串列加法器)

Serial Adder using JK FFs (1/2) Serial adder using JK flip-flops

Serial Adder using JK FFs (2/2) Circuit diagram JQ = xy KQ = xy = (x+y) S = x  y  Q Ci Fig. 6.6 Second form of serial adder

Universal Shift Register Three types of shift register Unidirectional shift register (單向移位暫存器,如左移或右移暫存器) A register capable of shifting in one direction. Bidirectional shift register (雙向移位暫存器,如左/右移暫存器) A register can shift in both directions. Universal shift register (通用移位暫存器) Has both direction shifts & parallel load/out capabilities.

Universal Shift Register (1/4) Capability of a universal shift register: A clear control to clear the register to 0 (一個清除控制將暫存器清除為 0); A clock input to synchronize the operations (一個時脈輸入使所有操作同步化); A shift-right control to enable the shift right operation and the serial input and output lines associated w/ the shift right (一個右移控制用以啟動向右移位操作,以及串列輸入及輸出線配合成可向右移位); A shift-left control to enable the shift left operation and the serial input and output lines associated w/ the shift left (一個左移控制用以啟動向左移位操作,以及串列輸入及輸出線配合成可向左移位); A parallel-load control to enable a parallel transfer and the n parallel input lines associated w/ the parallel transfer (一個並列載入控制,以啟動並列轉移,及有n 條輸入線配合提供並列轉移); n parallel output lines (n 條的並列輸出線); A control state that leaves the information in the register unchanged in the presence of the clock (在時脈不斷供應下,有一個控制狀態可使暫存器內的資訊維持不變)。

Universal Shift Register (2/4) Example: 4-bit universal shift register Fig. 6.7 Four-bit universal shift register

Universal Shift Register (3/4) Function Table Clear S1 S0 A3+ A2+ A1+ A0+ (operation) × 1 A3 A2 A1 A0 No change sri Shift right sli Shift left I3 I2 I1 I0 Parallel load

Universal Shift Register (4/4) Fig. 6.7 Four-bit universal shift register

6-3 Ripple Counters Counter (計數器) A register that goes through a prescribed sequence of states. Upon the application of input pulses Input pulses: may be clock pulses or originate from some external source. The sequence of states: may follow the binary number sequence ( Binary counter) or any other sequence of states. A n-bit binary counter → n FFs → count from 0 to 2n-1.

Categories of counters Ripple counters (漣波計數器) The flip-flop output transition serves as a source for triggering other flip-flop.  no common clock pulse (not synchronous). Synchronous counters (同步計數器) The CLK inputs of all flip-flops receive a common clock.

Example: 4-bit binary ripple counter Binary count sequence: 4-bit

Fig. 6.8 Four-bit binary ripple counter 1 Ripper propagation Ripper propagation Fig. 6.8 Four-bit binary ripple counter

Fig. 6.9 State diagram of a decimal BCD counter BCD Ripple Counter Fig. 6.9 State diagram of a decimal BCD counter

BCD Ripple Counter Q8 Q4 Q2 Q1 1 Fig. 6.10 BCD ripple counter

Fig. 6.11 Block diagram of a three-decade decimal BCD counter Three-decade BCD counter Fig. 6.11 Block diagram of a three-decade decimal BCD counter

6-4 Synchronous Counters Review of counters Ripple counters (漣波計數器) The flip-flop output transition serves as a source for triggering other flip-flop.  No common clock pulse (not synchronous). Synchronous counters (同步計數器) The CLK inputs of all flip-flops receive a common clock.

6-4 Synchronous Counters Sync counter (同步計數器) A common clock triggers all flip-flops simultaneously. Design procedure Apply the same procedure of sync seq ckts. Sync counter is simpler than general sync seq ckts. T and JK FFs T=0 or J=K=0, no change; T=1 or J=K=1, complement.

Sync Counters using JK FFs 4-bit binary counter A3 A2 A1 A0 1 C_en A0 C_en A0 A1 C_en A0 A1 A2 Fig. 6.12 Four-bit synchronous binary counter

4-bit Up/Down Binary Counter Function No change 1 Down Count Up Count down up A3 A2 A1 A0 1 down A'0 up A0 down A'0 A'1 up A0 A1 down A'0 A'1 A'2 up A0 A1 A2 Fig. 6.13 Four-bit up-down binary counter

BCD Counters Simplified functions

Fig. 6.14 Four-bit binary counter with parallel load

count load' load c_en c_en A0 async Fig. 6.14 Four-bit binary counter with parallel load (cont.)

Generate any count sequence E.g.: BCD counter  Counter with parallel load Fig. 6.15 Two ways to achieve a BCD counter using a counter with parallel load

6-5 Other Counters Counters Divide-by-N counter (modulo-N counter) Can be designed to generate any desired sequence of states. Divide-by-N counter (modulo-N counter) A counter that goes through a repeated sequence of N states. The sequence may follow the binary count or may be any other arbitrary sequence.

n flip-flops  2n binary states Unused states States that are not used in specifying the FSM. May be treated as don’t-care conditions or may be assigned specific next states. Self-correcting counter (自我校正計數器) Ensure that when a ckt enter one of its unused states, it eventually goes into one of the valid states after one or more clock pulses so it can resume normal operation.  Analyze the ckt to determine the next state from an unused state after it is designed.

An example Two unused states: 011 & 111 The simplified flip-flop input equations: JA = B, KA = B JB = C, KB = 1 JC = B, KC = 1

Fig. 6.16 Counter with unsigned states The logic diagram & state diagram of the ckt The simplified flip-flop input equations: JA = B, KA = B JB = C, KB = 1 JC = B, KC = 1 Fig. 6.16 Counter with unsigned states

Ring counter (環型計數器) A circular shift register with only one flip-flop being set at any particular time, all others are cleared (initial value = 1 0 0 … 0 ). The single bit is shifted from one flip-flop to the next to produce the sequence of timing signals.

A 4-bit ring counter A3 A2 A1 A0 1 Fig. 6.17 Generation of timing signals

Fig. 6.17 Generation of timing signals Application of counters Counters may be used to generate timing signals to control the sequence of operations in a digital system. Approaches for generation of 2n timing signals 1. A shift register with 2n flip-flops 2. An n-bit binary counter together with an n-to-2n-line decoder Fig. 6.17 Generation of timing signals

Fig. 6.17 Generation of timing signals

Johnson Counter (詹森計數器) Ring counter vs. Switch-tail ring counter Ring counter A k-bit ring counter circulates a single bit among the flip-flops to provide k distinguishable states. Switch-tail ring counter (切換-尾端環型計數器) It is a circular shift register with the complement output of the last flip-flop connected to the input of the first flip-flop. A k-bit switch-tail ring counter will go through a sequence of 2k distinguishable states. (initial value = 0 0 … 0).

Fig. 6.18 Construction of a Johnson counter An example: Switch-tail ring counter Fig. 6.18 Construction of a Johnson counter

Johnson counter (詹森計數器) A k-bit switch-tail ring counter + 2k decoding gates Provide outputs for 2k timing signals E.g.: 4-bit Johnson counter The decoding follows a regular pattern 2 inputs per decoding gate

Summary Disadvantage of the switch-tail ring counter Summary If it finds itself in an unused state, it will persist to circulate in the invalid states and never find its way to a valid state. One correcting procedure: DC = (A + C) B Summary Johnson counters can be constructed for any number of timing sequences Number of flip-flops = 1/2 (the number of timing signals). Number of decoding gates = number of timing signals 2-input per gate.