ENG241 Digital Design Week #8 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.
Logic and Computer Design Fundamentals Registers and Counters
COE 202: Digital Logic Design Sequential Circuits Part 4 KFUPM Courtesy of Dr. Ahmad Almulhem.
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.
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.
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.
Registers and Counters
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 & Counters M. Önder Efe
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.
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.
Abdullah Said Alkalbani University of Buraimi
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.
 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.
Digital Electronics.
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
Basic Counters: Part I Section 7-6 (pp ).
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 7 – Part 2.
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
DIGITAL COMPONENTS. MULTIPLEXERS A multiplexer is a combinational circuit that receives binary information from one of 2 n input data lines and directs.
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.
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.
Registers and Counters
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 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.
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
29-Nov-18 Counters Chapter 5 (Sections ).
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
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
Outline Registers Counters 5/11/2019.
(Sequential-Circuit Building Blocks)
Presentation transcript:

ENG241 Digital Design Week #8 Registers and Counters

2 Week #8 Topics  Definition of Register and Counter  Registers, Shift Registers  Ripple Counters  Synchronous Binary Counters  BCD Counters

3Resources  Chapter #7, Mano Sections 7.1 Registers and Load Enable 7.6 Shift Registers 7.6 Ripple Counters 7.6 Synchronous Binary Counters

4Definitions  Register – a set of flip-flops  May include extensive logic to control state transition  Registers also refer to fast memory for storing data in a computer  Counter  Register that goes through sequence of states as it is clocked previous Lecture  We designed a simple counter in the previous Lecture

5 Simple Register (No External Gates)  Functionality  Store D (D 0,D 1,D 2,D 3 )  On pos-edge of Clock  Clear signal normally high  Power-up reset

6 Clocking  The transfer of new info into a register is referred to as loading the register.  Typically don’t want to load every clock gate the clock!!  Can gate the clock!!  We try to avoid gating!! (Timing issues)

7Alternative  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

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

9 Simple 4-bit Shift Register  Every bit shifts to the right at every clock edge.  New information will enter via S i and leave from S o

10 Simple 4-Bit Shift Register: Diagram  Clocked in common  Just serial in and serial out SO Q0Q0 Q1Q1 Q2Q2 Q3Q3

11 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) begin 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 ;

12 Bidirectional Shift Register  Shift either way  Now we have following possible inputs  Parallel load  Shift from left  Shift from right  Also “no change”

13 One stage of a bidirectional shift register with parallel loadSchematic

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

15 Hardware Comparison Serial vs. parallel adder  One full adder vs. n adders  Serial takes n clock cycles, parallel only one clock cycle

16 Shift Register with Parallel Load  Load any value to the shift register  The shift register can then shift information one bit at a time

17 Schematic Shift Register with Parallel Load

18 Shift Registers (Summary)  Capability to shift bits  In one or both directions  Usage?  Part of standard CPU instruction set  Cheap Multiplication/Division  Serial communications

19 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 2 n – 1  BCD Counter  Any Sequence Counter

20 Synthesis Using T Flip Flops  Design a counter that counts from “000” to “111” and then back to “000” again.  Use T Flip-Flops

21 A Counter using T Flip Flops “Synchronous Counters”

22 Example: T Flip Flop Synthesis 0

23 T Flip Flops “Synchronous” By using K-maps we can minimize the flip flop input equations. T T T 1 A0A0 A1A1 A2A2

24 Asynchronous Counters Ripple counters are yet another type of counters that are easy to design.

25 Ripple Counter Simple (Asynch) Toggle

26 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

27

28 BCD Counters BCD Counters can also be designed using individual flip-flops and gates

29 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).

30 Arbitrary Count Sequence  One more type of counter is useful  Count an arbitrary sequence  Maybe you need a sequence of states

31 Circuit and State Diagram

32 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) begin 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 ;

33

34 Serial Transfer (8-bit Shift Register) Clocked 4 times Could shift data in What’s on wire at each clock?

35 Table Showing Shift

36 Example II

37 Example II.. Continue