Registers & Counters. BME208 Logic Circuits Yalçın İŞLER

Similar documents
Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

Registers and Counters

Registers and Counters

CSC Computer Architecture and Organization

Registers and Counters

Lecture 12. Amirali Baniasadi

Registers and Counters

Registers and Counters

Chapter 6 Registers and Counters

Agenda. EE 260: Introduction to Digital Design Counters and Registers. Asynchronous (Ripple) Counters. Asynchronous (Ripple) Counters

Unit-5 Sequential Circuits - 1

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Analysis of Sequential Circuits

Registers, Register Transfers and Counters Dr. Fethullah Karabiber

MC9211 Computer Organization

Sequential Logic Counters and Registers

Experiment 8 Introduction to Latches and Flip-Flops and registers

Chapter 3 Unit Combinational

Universal Asynchronous Receiver- Transmitter (UART)

Counter dan Register

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

ASYNCHRONOUS SEQUENTIAL CIRCUIT CONCEPTS

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

EET2411 DIGITAL ELECTRONICS

Outputs Combinational circuit. Next state. Fig. 4-1 Block Diagram of a Sequential Circuit

Counters

Asynchronous (Ripple) Counters

Chapter 2. Digital Circuits

EECS 3201: Digital Logic Design Lecture 9. Ihab Amer, PhD, SMIEEE, P.Eng.

CHAPTER1: Digital Logic Circuits

Review of digital electronics. Storage units Sequential circuits Counters Shifters

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

Logic Design. Flip Flops, Registers and Counters

Problems with D-Latch

Learning Outcomes. Unit 13. Sequential Logic BISTABLES, LATCHES, AND FLIP- FLOPS. I understand the difference between levelsensitive

ECE 263 Digital Systems, Fall 2015

Sequential Logic Circuits

ECE 3401 Lecture 11. Sequential Circuits

CS T34-DIGITAL SYSTEM DESIGN Y2/S3

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Other Flip-Flops. Lecture 27 1

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Switching Circuits & Logic Design, Fall Final Examination (1/13/2012, 3:30pm~5:20pm)

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

Fall 2000 Chapter 5 Part 1

Module -5 Sequential Logic Design

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Chapter 6 Digital Circuit 6-5 Department of Mechanical Engineering

Chapter 5 Sequential Circuits

Part 4: Introduction to Sequential Logic. Basic Sequential structure. Positive-edge-triggered D flip-flop. Flip-flops classified by inputs

Computer Organization & Architecture Lecture #5

ECE 25 Introduction to Digital Design. Chapter 5 Sequential Circuits ( ) Part 1 Storage Elements and Sequential Circuit Analysis

ENGN3213 Digital Systems and Microprocessors Sequential Circuits

Multiplexor (aka MUX) An example, yet VERY useful circuit!

ECE 3401 Lecture 12. Sequential Circuits (II)

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Serial In/Serial Left/Serial Out Operation

Vignana Bharathi Institute of Technology UNIT 4 DLD

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

Logic Design II (17.342) Spring Lecture Outline

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

CHAPTER 4: Logic Circuits

Course Administration

Digital Fundamentals: A Systems Approach

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Chapter 4: One-Shots, Counters, and Clocks

CHAPTER 4: Logic Circuits

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

Sequential Circuits. Sequential Logic. Circuits with Feedback. Simplest Circuits with Feedback. Memory with Cross-coupled Gates.

IT T35 Digital system desigm y - ii /s - iii

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

UNIVERSITI TEKNOLOGI MALAYSIA

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

Digital Logic Design I

Chapter 4. Logic Design

Synchronous Sequential Logic

Digital Systems Laboratory 3 Counters & Registers Time 4 hours

Chapter 5. Introduction

Question Bank. Unit 1. Digital Principles, Digital Logic

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

MODULE 3. Combinational & Sequential logic

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY CS 2202 DIGITAL PRINCIPLES AND SYSTEM DESIGN

ELE2120 Digital Circuits and Systems. Tutorial Note 8

Chapter 7 Counters and Registers

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

ELCT201: DIGITAL LOGIC DESIGN

Sequential Logic Circuit

Spring 2017 EE 3613: Computer Organization Chapter 5: The Processor: Datapath & Control - 1

D Latch (Transparent Latch)

! Two inverters form a static memory cell " Will hold value as long as it has power applied

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

B.Tech CSE Sem. 3 15CS202 DIGITAL SYSTEM DESIGN (Regulations 2015) UNIT -IV

RS flip-flop using NOR gate

UNIT IV. Sequential circuit

Flip-Flops and Sequential Circuit Design

CHW 261: Logic Design

Transcription:

Registers & ounters BME28 Logic ircuits Yalçın İŞLER islerya@yahoo.com http://me.islerya.com

Registers Registers are clocked sequential circuits A register is a group of flip-flops 2 Each flip-flop capable of storing one bit of information An n-bit register consists of n flip-flops capable of storing n bits of information besides flip-flops, a register usually contains combinational logic to perform some simple tasks In summary flip-flops to hold information combinational logic to control the state transition

ounters A counter is essentially a register that goes through a predetermined sequence of states ounting sequence FF FF Register FF n- ombinational logic 3

Uses of Registers and ounters Registers are useful for storing and manipulating information internal registers in microprocessors to manipulate data ounters are extensively used in control logic P (program counter) in microprocessors 4

4-bit Register R clear REG R 2 2 3 3 2 2 R F6E 6 6 [5:] [5:] clock clear 5 3 R 3 E LR

Verilog ode of F6E always @ (posedge or posedge LR) begin if (LR) <= 4 b; else begin if (E) <= ; end end

Register with Parallel Load Load R R 2 R 2 3 clock 7 clear R 3

Register Transfer /2 load n R R 2 R 2 R clock clock R load 8 R 2

Register Transfer 2/2 n-bit adder n n load R R 2 clock R R + R 2 9

Shift Registers A register capable of shifting its content in one or both directions Flip-flops in cascade serial input SI SO serial output clock The current of n-bit shift register state can be transferred in n clock cycles

Serial Mode A digital system is said to operate in serial mode when information is transferred and manipulated one bit a time. SI SO SI SO shift register A shift register B clock shift control clock shift control clk clk clk T T 2 T 3 T 4

B A Serial Transfer Suppose we have two 4-bit shift registers Timing pulse Shift register A Shift register B initial value After T After T 2 After T 3 After T 4 clock shift control A clk B clk clk 2 T T 2 T 3 T 4 shift control clock

Serial Addition In digital computers, operations are usually executed in parallel, since it is faster Serial mode is sometimes preferred since it requires less equipment serial output clock shift control SI shift register A SO a b _in FA S serial input SI shift register B SO 3 clear

Example: Serial Addition A and B are 2-bit shift registers clock shift control SR-A SR-B _in 4

Universal Shift Register apabilities:. A clear control to set the register to. 2. A clock input 3. A shift-right control 4. A shift-left control 5. n input lines & a parallel-load control 6. n parallel output lines 5

4-Bit Universal Shift Register parallel outputs A 3 A 2 A A clear clk s s 3 4 MUX 2 3 4 MUX 2 3 4 MUX 2 3 4 MUX 2 serial input for shift-right serial input for shift-left 6 parallel inputs

Verilog ode v // Behavioral description of a 4-bit universal shift register // Fig. 6.7 and Table 6.3 module Shift_Register_4_beh ( // V2, 25 output reg [3: ] A_par, // Register output input [3: ] I_par, // Parallel input input s, s, // Select inputs MSB_in, LSB_in, // Serial inputs LK, lear_b // lock and lear always @ ( posedge LK, negedge lear_b) // V2, 25 if (lear_b == ) A_par <= 4 b; else case ({s, s}) 2'b: A_par <= A_par; // No change 2'b: A_par <= {MSB_in, A_par[3: ]}; // Shift right 2'b: A_par <= {A_par[2: ], LSB_in}; // Shift left endcase endmodule 2'b: A_par <= I_par; // Parallel load of input 7

Verilog ode v2 // Behavioral description of a 4-bit universal shift register // Fig. 6.7 and Table 6.3 module Shift_Register_4_beh ( // V2, 25 output reg [3: ] A_par, // Register output input [3: ] I_par, // Parallel input input s, s, // Select inputs MSB_in, LSB_in, // Serial inputs LK, lear_b // lock and lear always @ ( posedge LK, negedge lear_b) // V2, 25 if (lear_b == ) A_par <= 4 b; else case ({s, s}) // 2'b: A_par <= A_par; // No change 2'b: A_par <= {MSB_in, A_par [3: ]}; // Shift right 2'b: A_par <= {A_par [2: ], LSB_in}; // Shift left 2'b: A_par <= I_par; // Parallel load of input endcase endmodule 8

Universal Shift Register Mode ontrol s s Register operation No change Shift right Shift left Parallel load 9

ounters registers that go through a prescribed sequence of states upon the application of input pulses 2 input pulses are usually clock pulses Example: n-bit binary counter count in binary from to 2 n - lassification. Synchronous counters flip-flops receive the same common clock as the pulse 2. Ripple counters flip-flop output transition serves as the pulse to trigger other flip-flops

3-bit binary ripple counter Binary Ripple ounter 2 3 4 5 6 7 Idea: to connect the output of one flip-flop to the input of the next high-order flipflop We need complementing flip-flops We can use T flip-flops to obtain complementing flip-flops or JK flip-flops with its inputs are tied together or flip-flops with complement output connected to the input. 2

4-bit Binary Ripple ounter count T R A 2 count R A 3 T R A 4 5 6 R A 7 T R A 2 8 9 R A 2 logic- 22 clear T R A 3 2 3 4 5 clear R A 3

4-bit Binary Ripple ounter count T R A T A R T A 2 R logic- T A 3 23 clear R

Synchronous ounters There is a common clock that triggers all flip-flops simultaneously If T = or J = K = the flip-flop does not change state. If T = or J = K = the flip-flop does change state. esign procedure is so simple no need for going through sequential logic design process A is always complemented A is complemented when A = A 2 is complemented when A = and A = so on 24 2 3 4 5 6 7

4-bit Binary Synchronous ounter ount_enable J K A J K A Polarity of the clock is not essential J K A 2 25 clock J K A 3 to next stage

Timing of Synchronous ounters clock A A A 2 A 3 26

Timing of Ripple ounters clock A A A 2 A 3 27 27

Up-own Binary ounter When counting downward the least significant bit is always complemented (with each clock pulse) A bit in any other position is complemented if all lower significant bits are equal to. For example: Next state: For example: Next state: 28 7 6 5 4 3 2

Up-own Binary ounter up down T A T A T A 2 The circuit 29 clock

count load Binary ounter with Parallel Load J K A J K A 2 J K A 2 clock carry output clear 3

Binary ounter with Parallel Load Function Table clear clock load ount Function X X X clear to X load inputs count up no change 3

Other ounters Ring ounter A ring counter is a circular shift register with only one flip-flop being set at any particular time, all others are cleared. shift right T T T 2 T 3 initial value Usage Timing signals control the sequence of operations in a digital system 32

Ring ounter Sequence of timing signals clock T T T 2 T 3 33

Ring ounter To generate 2 n timing signals, we need a shift register with? flip-flops or, we can construct the ring counter with a binary counter and a decoder count T T T 2 T 3 2x4 decoder 2-bit counter ost: 2 flip-flops 2-to-4 line decoder ost in general case: n flip-flops n-to-2 n line decoder 2 n n-input AN gates n NOT gates 34

Johnson ounter A k-bit ring counter can generate k distinguishable states The number of states can be doubled if the shift register is connected as a switch-tail ring counter X Y Z T X Y Z T clock 35

Johnson ounter ount sequence and required decoding sequence number Flip-flop outputs X Y Z T Output S = X T 2 S = XY 3 S 2 = YZ 4 S 3 = ZT 5 S 4 = XT 6 7 S 5 = X Y S 6 = Y Z 8 S 7 = Z T 36

Johnson ounter ecoding circuit S S S 2 S 3 S 4 S 5 S 6 S 7 X Y Z T clock 37

Unused States in ounters 4-bit Johnson counter 38

orrection 39

4 Johnson ounter Next State Present State T Z Y X T Z Y X

K-Maps ZT XY X(t+) = T ZT XY ZT XY Y(t+) = XY + XZ + XT ZT XY 4 Z(t+) = Y T(t+) = Z

Unused States in ounters Remedy X(t+) = T Z(t+) = Y Y(t+) = XY + XZ + XT T(t+) = Z Y = X(Y+Z+T ) X Y Z T clock 42