Registers and Counters

Slides:



Advertisements
Similar presentations
Lecture 23: Registers and Counters (2)
Advertisements

Registers and Counters
ECE 331 – Digital System Design Flip-Flops and Registers (Lecture #18) The slides included herein were taken from the materials accompanying Fundamentals.
11/16/2004EE 42 fall 2004 lecture 331 Lecture #33: Some example circuits Last lecture: –Edge triggers –Registers This lecture: –Example circuits –shift.
Logic and Computer Design Fundamentals Registers and Counters
ENGIN112 L26: Shift Registers November 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 26 Shift Registers.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 8, 2007.
KU College of Engineering Elec 204: Digital Systems Design
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:
Registers and Counters
Counters and Registers
Unit 12 Registers and Counters Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Chapter 1_4 Part II Counters
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
EE345: Introduction to Microcontrollers Register and Counters Prof. Ahmad Abu-El-Haija.
Registers and Counters
Registers CPE 49 RMUTI KOTAT.
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 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 17 Dr. Shi Dept. of Electrical and Computer Engineering.
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.
ENG241 Digital Design Week #8 Registers and Counters.
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.
Abdullah Said Alkalbani University of Buraimi
CHAPTER 6 Sequential Circuits’ Analysis CHAPTER 6 Sequential Circuits’ Analysis Sichuan University Software College.
Registers and Counters
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 11, 2010.
Basic Counters: Part I Section 7-6 (pp ).
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
Chap 5. Registers and Counters
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Dr. Shi Dept. of Electrical and Computer Engineering.
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.
FLIP FLOPS Binary unit capable of storing one bit – 0 or 1
Week #7 Sequential Circuits (Part B)
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
EKT 221 – Counters.
Prof. Hsien-Hsin Sean Lee
EKT 221 : Digital 2 COUNTERS.
SLIDES FOR CHAPTER 12 REGISTERS AND COUNTERS
DIGITAL 2 : EKT 221 RTL : Microoperations on a Single Register
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Digital System Design Review.
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
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
29-Nov-18 Counters Chapter 5 (Sections ).
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
VHDL (VHSIC Hardware Description Language)
Registers and Register Transfers
Computer Architecture and Organization: L02: Logic design Review
CSE 370 – Winter Sequential Logic-2 - 1
6. Registers and Counters
Figure 8.1. The general form of a sequential circuit.
Switching Theory and Logic Design Chapter 5:
Digital Logic Department of CNET Chapter-6
Digital Logic Department of CNET Chapter-6
14 Digital Systems.
Outline Registers Counters 5/11/2019.
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
Presentation transcript:

Registers and Counters Digital Design Registers and Counters School of Engineering

Week #8 Topics Definition of Register and Counter Registers, Shift Registers Ripple Counters Synchronous Binary Counters BCD Counters Fall 2012 ENG241/Digital Design School of Engineering

Resources Chapter #7, Mano Sections 7.1 Registers and Load Enable 7.6 Shift Registers 7.6 Ripple Counters 7.6 Synchronous Binary Counters Fall 2012 ENG241/Digital Design School of Engineering

Definitions Register – a set of flip-flops Counter May include extensive logic to control state transition register also refers to fast memory for storing data in a computer Counter Register that goes through sequence of states as it is clocked We designed a simple counter in the previous Lecture Fall 2012 ENG241/Digital Design

Simple Register (No External Gates) Functionality Store D (D0,D1,D2,D3) On pos-edge of Clock Clear signal normally high Power-up reset Fall 2012 ENG241/Digital Design

Clocking The transfer of new info into a register is referred to as loading the register. Typically don’t want to load every clock Can gate the clock!! But skew problem! (Timing issues) Fall 2012 ENG241/Digital Design

Alternative No clock gating If load ‘H’, then D is gated through Otherwise, Q is fed back Keep same value No clock gating Why add all this logic? Because D FF doesn’t have “no change” behavior Fall 2012 ENG241/Digital Design

Shift Registers A register capable of shifting its stored bits laterally in one or both directions is called a shift register. The logical configuration of a shift register consists of a chain of flip-flops in cascade, with the output of one flip-flop connected to the input of the next flip-flop. All flip-flops receive a common clock pulse, which activates the shift from each stage to the next. Fall 2012 ENG241/Digital Design

Simple 4-Bit Shift Register Clocked in common Just serial in and serial out Fall 2012 ENG241/Digital Design

Symbol Again, we could gate the clock But have to potentially deal with skew Fall 2012 ENG241/Digital Design

VHDL for Shift Registers -- 4 bit Shift Register with Reset library ieee; use ieee.std_logic_1164.all; entity srg_4_r is port (CLK, RESET, SI : in std_logic; Q : out std_logic_vector(3 downto 0); SO : out std_logic); end srg_4_r; architecture behavioral of srg_4_r is Signal shift : std_logic_vector (3 downto 0); begin process (CLK, RESET) if (RESET = `1’) then shift <= `0000’; elsif (CLK’event and CLK = `1’)) then shift<= shift(2 downto 0) & SI; end if; end process; Q <= shift; S0 <= shift(3); end behavioral ; Fall 2012 ENG241/Digital Design

Bidirectional Shift Register Shift either way Now we have following possible inputs Parallel load Shift from left Shift from right Also “no change” Fall 2012 ENG241/Digital Design

One stage of a bidirectional shift register with parallel load Schematic One stage of a bidirectional shift register with parallel load Fall 2012 ENG241/Digital Design

Serial Addition Then shift through adder into A. Added to 0 if A is empty. Initially reset all registers Register A accumulates Adds one bit at a time At same time, new value going into B Stores carry one clock Shift value in serially Fall 2012 ENG241/Digital Design

Hardware Comparison Serial vs. parallel adder One full adder vs. n adders Serial takes n clock cycles, parallel only one clock cycle Fall 2012 ENG241/Digital Design

Shift Register with Parallel Load Can provide parallel outputs from flip-flops And also parallel inputs Fall 2012 ENG241/Digital Design

Schematic Fall 2012 ENG241/Digital Design

Shift Registers (Summary) Capability to shift bits In one or both directions Usage? Part of standard CPU instruction set Cheap Multiplication/Division Serial communications Fall 2012 ENG241/Digital Design

Counters Counter is a register – but has state Also goes through sequence of states – counts – on clock or other pulses Examples: Binary Counter Counts through binary sequence n bit counter counts from 0 to 2n – 1 BCD Counter Any Sequence Counter Fall 2012 ENG241/Digital Design

Ripple Counter Simple (Asynch) Toggle Fall 2012 ENG241/Digital Design

Synchronous Counters Ripple counter is useful and easy to design but its Asynchronous nature may cause problems Synchronous counters are more common Fall 2012 ENG241/Digital Design

Synthesis Using T Flip Flops Design a counter that counts from “000” to “111” and then back to “000” again. Use T Flip-Flops Fall 2012 ENG241/Digital Design

A Counter using T Flip Flops 000 001 010 011 111 110 101 100 Fall 2012 ENG241/Digital Design

Example: T Flip Flop Synthesis Fall 2012 ENG241/Digital Design

T Flip Flops By using K-maps we can minimize the flip flop input equations. T 1 A0 A1 A2 Fall 2012 ENG241/Digital Design

Binary Counter with Parallel Load Counters employed in digital systems quite often require a parallel-load capability for transferring an initial binary number into the counter prior to the counter operation. When “load” is equal to 1, the input load control disables the count operation and causes a transfer of data from the four parallel inputs to the four outputs. The carry output C0 becomes a 1 if all flip-flops are equal to 1 while the count input is enabled. This feature is useful for expanding the counter to more stages Fall 2012 ENG241/Digital Design

Fall 2012 ENG241/Digital Design

BCD Counter using Binary Counters The binary counter with parallel load can be converted into a synchronous BCD counter (How?) By connecting an external AND gate to the load control (as shown in the Figure). Fall 2012 ENG241/Digital Design

BCD Counter BCD Counters can be designed of course directly using individual flip-flops and gates Fall 2012 ENG241/Digital Design

Arbitrary Count Sequence One more type of counter is useful Count an arbitrary sequence Maybe you need a sequence of states Fall 2012 ENG241/Digital Design

Circuit and State Diagram 011 111 Fall 2012 ENG241/Digital Design

VHDL for Counters -- 4 bit Binary Counter with Reset library ieee; use ieee.std_logic_1164.all; entity count_4_r is port (CLK, RESET, EN : in std_logic; Q : out std_logic_vector(3 downto 0); CO : out std_logic); end count_4_r; architecture behavioral of count_4_r is Signal count : std_logic_vector (3 downto 0); begin process (CLK, RESET) if (RESET = `1’) then count <= `0000’; elsif (CLK’event and CLK = `1’) and (EN = `1’)) then count <= count + “0001”; end if; end process; q <= count; C0 <= `1’ when count = “1111” and EN = `1’ else ‘0’; end behavioral ; Fall 2012 ENG241/Digital Design

Extra Slides Fall 2012 ENG241/Digital Design

Serial Transfer (8-bit Shift Register) Could shift data in What’s on wire at each clock? Clocked 4 times Fall 2012 ENG241/Digital Design

Table Showing Shift Fall 2012 ENG241/Digital Design

Example II Fall 2012 ENG241/Digital Design

Example II .. Continue Fall 2012 ENG241/Digital Design