Sequential logic circuits

Similar documents
CSE115: Digital Design Lecture 23: Latches & Flip-Flops

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

CHAPTER 4: Logic Circuits

CHAPTER 4: Logic Circuits

Logic Design II (17.342) Spring Lecture Outline

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

6.3 Sequential Circuits (plus a few Combinational)

Registers and Counters

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

CHAPTER1: Digital Logic Circuits

Computer Systems Architecture

Lecture 8: Sequential Logic

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

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

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

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

CS 110 Computer Architecture. Finite State Machines, Functional Units. Instructor: Sören Schwertfeger.

Computer Organization & Architecture Lecture #5

ELCT201: DIGITAL LOGIC DESIGN

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

Registers and Counters

Chapter 3. Boolean Algebra and Digital Logic

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

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

COMP2611: Computer Organization. Introduction to Digital Logic

More Digital Circuits

Chapter 5 Sequential Circuits

Sequential Logic. Introduction to Computer Yung-Yu Chuang

1. Convert the decimal number to binary, octal, and hexadecimal.

LATCHES & FLIP-FLOP. Chapter 7

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

EECS 270 Midterm 1 Exam Closed book portion Winter 2017

Sequential Circuits: Latches & Flip-Flops

MODULE 3. Combinational & Sequential logic

D Latch (Transparent Latch)

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

COMP sequential logic 1 Jan. 25, 2016

Combinational vs Sequential

FLIP-FLOPS AND RELATED DEVICES

Logic Devices for Interfacing, The 8085 MPU Lecture 4

CS3350B Computer Architecture Winter 2015

Synchronous Sequential Logic

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

DIGITAL CIRCUIT COMBINATORIAL LOGIC

EE292: Fundamentals of ECE

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Logic Design. Flip Flops, Registers and Counters

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

Principles of Computer Architecture. Appendix A: Digital Logic

Contents Circuits... 1

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

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

Final Exam review: chapter 4 and 5. Supplement 3 and 4

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

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

AIM: To study and verify the truth table of logic gates

Lecture 12. Amirali Baniasadi

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Sequential Logic Notes

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

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

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

Experiment 8 Introduction to Latches and Flip-Flops and registers

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

Chapter 5 Synchronous Sequential Logic

Digital Networks and Systems Laboratory 2 Basic Digital Building Blocks Time 4 hours

Microprocessor Design

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

Chapter 5: Synchronous Sequential Logic

North Shore Community College

CS61C : Machine Structures

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Rangkaian Sekuensial. Flip-flop

ELEN Electronique numérique

1.b. Realize a 5-input NOR function using 2-input NOR gates only.

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

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

MC9211 Computer Organization

UNIVERSITI TEKNOLOGI MALAYSIA

6. Sequential Logic Flip-Flops

COMP12111: Fundamentals of Computer Engineering

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

Registers and Counters

Synchronous Sequential Logic

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

CPS311 Lecture: Sequential Circuits

Sequential Design Basics

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

Introduction to Microprocessor & Digital Logic

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

ASYNCHRONOUS COUNTER CIRCUITS

Module -5 Sequential Logic Design

Transcription:

Computer Mathematics Week 10 Sequential logic circuits College of Information Science and Engineering Ritsumeikan University

last week combinational digital circuits signals and busses logic gates and, or, not nand, nor, xor gate-level logical operations bitwise: and, or, not Central Processing Unit IR increment PC CU operation select PSR Mouse DR PC registers LU Universal Serial us R Input / Output Controller address bus Random ccess Memory PCI us Keyboard HDD GPU udio SSD Net 0 4 8 16 20 24 28 data bus gate-level arithmetic operations addition, subtraction (unsigned, 2 s complement) 1-of-N selection multiplexers 2

this week sequential digital circuits stateful logic level-triggered devices latches Central Processing Unit IR increment PC CU operation select PSR DR PC registers LU R address bus 0 4 8 16 20 24 28 data bus Random ccess Memory clocks edge-triggered devices Universal Serial us Input / Output Controller PCI us Mouse Keyboard HDD GPU udio SSD Net synchronous logic flip-flops registers and memory CPU operation according to the clock cycle 3

combinational vs. sequential logic combinational logic outputs depend on current inputs no memory stateless C IN S C OUT sequential logic outputs depend on current and past inputs memory (history) of previous inputs IN UPDTE state OUT stateful 4

gate delay adders full adder: 3 gates to sum and carry out, 2 gates from carry in to carry out tg tg tg tg tg tg C IN Β C IN C IN ( Β) S C IN Β C IN C IN ( Β) S C OUT C OUT Β C IN ( Β)+Α Β Β C IN ( Β)+Α Β daisy-chained... N-1 N-2 1 0 N-1 N-2 1 0 C OUT C OUT S C IN C OUT S C IN C OUT S C IN C OUT S C IN C IN S N-1 S N-2 S 1 S 0 + N is limited by gate delay = t g from,, C IN changing, C OUT is available 3 t g later from C IN changing, C OUT is available 2 t g later final C OUT is available (1 + 2N) t g after inputs change 5

gate delay multiplexer 2-to-1 multiplexer tg tg tg SEL OUT 0 1 MUX OUT SEL gate delays from inputs to output from SEL changing, 3 t g to OUT being stable from data input changing, 2 t g to OUT changing this delay can be exploited to produce memory 6

memory latches one way to make memory: use a multiplexer 0 connect the output back to one of the inputs e.g., feedback from the output to input when SEL is 1, input is copied to output when SEL is 0, output is copied (via ) back to itself the output is held constant, independent of IN IN D 1 MUX G SEL Q OUT OUT this is called a transparent latch when the G (gate) input is 1, D (input) is copied to Q (output) the gate is open, the device is transparent when the G (gate) input is 0, Q (output) remains unchanged the device has latched onto the value of from the moment the G signal changed from 1 to 0 GTE G latch on to/onto 1. To get hold of; obtain. 2. To cling to. 7

the problem with latches let s try to make a one-bit counter using a latch latch stores current counter value a clock signal causes the counter to update 1-bit counter (divide-by-2) when the clock signal is low the output is held constant by the latch D Q OUTPUT the inverter computes the next desired output CLOCK G when the clock signal is high the computed next output is copied to the output the inverter computes the next desired output (inverse of the current output) the next output goes through the open latch and contradicts the current output clock oscillation D 0 0 1 0 Q (output) 1 1 0 1 unpredictable result 8

level- vs. edge-triggering in a level-triggered system, when the clock is high the outputs can change once, and once only until the clock goes low again, closing all the latches this is not very useful much better would be an edge-triggered system clock ticks coincide with a specified clock edge e.g., a clock transition from 0 to 1 (the rising edge) a snapshot of the input is taken at that instant, and becomes the new output the inputs can change arbitrarily at any other time, because... the output always reflects the input at the last clock tick cycle n cycle n+1 clock tick clock tick clock tick input state captured at tick copied immediately to output input can change between ticks output does not change between ticks etc... 9

synchronous logic at the start of each clock cycle the state of the machine is captured in registers computation of next state begins all we need is an edge-triggered register CLOCK synchronising clock 1-bit counter (divide-by-2) D Q combinational logic computes next state current state captured in synchronous register little triangle means "edge-triggered clock input" cycle n cycle n+1 clock tick state computed in cycle n-1 is captured in synchronous registers state computed in cycle n is captured in synchronous registers etc... combinational logic begins to compute new state for cycle n combinational logic begins to compute state for cycle n+1 10

synchronous logic register model let s construct an edge-triggered register using a pair of level-triggered latches when the clock is low the input gate is open the output gate is closed repeat: when the clock goes high (ticks) the input gate is closed the inputs are captured the output gate is opened captured inputs are sent to output when the clock goes low the output device is closed captured outputs remain stable the input device is opened input gate output gate CLOCK = 0 INPUT CLOCK = 1 tick CLOCK = 0 INPUT INPUT CLOCK = 1 tick INPUT.........C C.........C C... X open gate closed gate captured state X C changing state specific state OUTPUT OUTPUT OUTPUT OUTPUT 11

synchronous logic register implementation INPUT D G Q D Q OUTPUT = G CLOCK D Q OUTPUT CLOCK clock tick tick tick G open open open open D D = Q Q G open open open this is a flip-flop, a 1-bit synchronous register while one side is flipping, the other side is flopping 12

synchronous logic example counters 1-bit counter (divide-by-2) clock tick tick tick CLOCK D Q OUTPUT Q (output) D 0 1 0 1 0 1 0 1 cascade N counters to make a 2 N -bit counter... N-bit counter (divide-by-2 N ) D Q D Q D Q N D Q OUTPUT CLOCK 13

synchronous logic example multi-bit registers 4-bit register D 3 D 2 D 1 D 0 D D D D Q Q Q Q CLOCK Q 3 Q 2 Q 1 Q 0 4 D3 D2 D1 D0 D Q3 Q2 Q1 Q0 Q 4 the global clock signal is often omitted from the diagram to make the diagram easier to read any unconnected clock input is understood to be connected to the global clock 14

a simple CPU one accumulator register 12-bit address bus DDR PROGRM MEMORY DT OUT 16-bit instructions and data bus OP CONSTNT CONSTNT is a 12-bit constant LS 12 bits of opcode OP is a 4-bit opcode LD / INC +1 PC LOD COUNTER Z JUMP 3 12 DECODER R 0 1 LS bit = constant/memory select instruction decoder: conditional load of PC OP Z read or write to RM DDR REGISTER ENLE R LU operation register load R Z output from LU 1 when = 0 RED / WRITE DDR MIN MEMORY DT IN DT OUT 15

a simple CPU decoder design 4-bit opcode lowest bit selects LU input: memory or constant eight operations OP instruction LU OP Z R RED/WRITE JUMP DDR - - 0 1 0 LOD - 1 1 0 STORE - - 0 0 0 DD + - 1 1 0 SU - 1 1 0 JUMP 1 0 1 1 JUMPZ =0 0 1 1 16

example program insn binary addr opcode op constant comment 0: 100 0 000000000010 DDR 2 prepare to read memory address 2 1: 000 1 000000000000 LOD read from memory to register 2: 001 0 000000000001 DD 1 add 1 to register 3: 011 0 000000000010 STORE 2 store register into memory address 2 4: 101 0 000000000000 JUMP 0 repeat from instruction 0 equivalent high-level program (assuming count is at address 2): while (true) { count = count + 1; } 17

next week mathematics of control models of stateful computation finite state machines formal model representations Central Processing Unit IR increment PC CU operation select PSR Mouse DR PC registers LU Universal Serial us R Input / Output Controller address bus Random ccess Memory PCI us Keyboard HDD GPU udio SSD Net 0 4 8 16 20 24 28 data bus FSM applications pattern matching pattern generation sequencing 18

homework study the simple CPU and example program simulate it on paper to see how it works one instruction at a time reinforce your understanding write a simulator for the simple CPU in Python model the current state of the machine inpect the current instruction compute the next state of the machine update the current state repeat print the state at each step run a simple program ask about anything you do not understand from any of the classes so far this semester (or the lecture notes) it will be too late for you to try to catch up later! I am always happy to explain things differently and practice examples with you 19

glossary clock a periodic signal that synchronises the operation of elements within a logic circuit. complemented inverted, or flipped. edge-triggered a device that performs its operation when a clock signal changes state. edge the vertical part of a square-shaped waveform. feedback connecting the output of a device or circuit back to an input. gate delay the time taken for the output of a gate to change in response to a changing input. latch a device that either copies its input to its output, or holds the output constant, depening on the state of a gate signal. level-triggered a device that performs its operation when a clock signal is in a particular state (high or low). register a device that can remember one or more bits of information. rising the edge of a clock signal corresponding to a change of state from 0 to 1. stateful a device that can remember its past inputs and/or outputs. stateless a device that has no memory and responds simply to the current set of inputs. tick the rising edge of a repeating clock signal, analogous to the ticking of a mechanical clock. 20