Storage Elements & Sequential Circuits

Similar documents
COMPSCI 210 S Computer Systems 1. 6 Sequential Logic Circuit

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

Transistor: Digital Building Blocks

Computing Layers. Chapter 3 Digital Logic Structures. Combinational vs. Sequential. State Machine. Another type of sequential circuit

Combinational vs. Sequential. State Machine. Computing Layers. Chapter 3 Digital Logic Structures. ! Another type of sequential circuit

Memories. Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu.

Recitation Session 6

Computer Architecture: Part III. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University

3.4 Basic Storage Elements

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS

Chapter 6 (Lect 3) Counters Continued. Unused States Ring counter. Implementing with Registers Implementing with Counter and Decoder

(ii) Simplify and implement the following SOP function using NOR gates:

Code No: 07A3EC03 Set No. 1

Injntu.com Injntu.com Injntu.com R16

falling edge Intro Computer Organization

CSEE 3827: Fundamentals of Computer Systems. Storage

Topic #6. Processor Design

Unit 6 1.Random Access Memory (RAM) Chapter 3 Combinational Logic Design 2.Programmable Logic

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

Reference Sheet for C112 Hardware

II/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION. Answer ONE question from each unit.

PART B. 3. Minimize the following function using K-map and also verify through tabulation method. F (A, B, C, D) = +d (0, 3, 6, 10).

Code No: R Set No. 1

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

SECTION-A

Memory and Programmable Logic

Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition

R07. Code No: V0423. II B. Tech II Semester, Supplementary Examinations, April

Digital Design, Kyung Hee Univ. Chapter 7. Memory and Programmable Logic

Computer Systems Organization

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM


ECSE-2610 Computer Components & Operations (COCO)

L11: Major/Minor FSMs

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

Memory and Programmable Logic

Internal Memory. Computer Architecture. Outline. Memory Hierarchy. Semiconductor Memory Types. Copyright 2000 N. AYDIN. All rights reserved.

Semiconductor Memories: RAMs and ROMs

Lec-6-HW-2-digitalDesign

VALLIAMMAI ENGINEERING COLLEGE

R07

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

VALLIAMMAI ENGINEERING COLLEGE

: : (91-44) (Office) (91-44) (Residence)

END-TERM EXAMINATION

Finite State Machines (FSMs) and RAMs and CPUs. COS 116, Spring 2011 Sanjeev Arora

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

M. Sc (CS) (II Semester) Examination, Subject: Computer System Architecture Paper Code: M.Sc-CS-203. Time: Three Hours] [Maximum Marks: 60

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6302 DIGITAL ELECTRONICS

Sense Amplifiers 6 T Cell. M PC is the precharge transistor whose purpose is to force the latch to operate at the unstable point.

CS 320 February 2, 2018 Ch 5 Memory

COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK SUBJECT CODE & NAME: EC 1312 DIGITAL LOGIC CIRCUITS UNIT I

Chapter 5 Internal Memory

EE 3170 Microcontroller Applications

ECE 341. Lecture # 16

Chapter 5. Register Transfer Level (RTL) Design High Level State Machine (HLSM) Memory Chapters 5

Concept of Memory. The memory of computer is broadly categories into two categories:

PROGRAMMABLE LOGIC DEVICES

IA Digital Electronics - Supervision I

CS429: Computer Organization and Architecture

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

EECS150, Fall 2004, Midterm 1, Prof. Culler. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function.

SHRI ANGALAMMAN COLLEGE OF ENGINEERING. (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

Code No: R Set No. 1

MODULE 12 APPLICATIONS OF MEMORY DEVICES:

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

EECS150 Homework 2 Solutions Fall ) CLD2 problem 2.2. Page 1 of 15

Lecture 13: Memory and Programmable Logic

CS303 LOGIC DESIGN FINAL EXAM

Memory & Simple I/O Interfacing

Principles of Digital Techniques PDT (17320) Assignment No State advantages of digital system over analog system.

The Memory Component

ECE369. Chapter 5 ECE369

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

Memory & Logic Array. Lecture # 23 & 24 By : Ali Mustafa

The D igital Digital Logic Level Chapter 3 1

William Stallings Computer Organization and Architecture 8th Edition. Chapter 5 Internal Memory

Address connections Data connections Selection connections

MLR Institute of Technology

CENG4480 Lecture 09: Memory 1

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 13

Computer Organization. 8th Edition. Chapter 5 Internal Memory

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Sequential Logic Design

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

Chapter 5 Registers & Counters


Computer Organization and Assembly Language (CS-506)

UNIT V (PROGRAMMABLE LOGIC DEVICES)

EECS 150 Homework 7 Solutions Fall (a) 4.3 The functions for the 7 segment display decoder given in Section 4.3 are:

Mark Redekopp, All rights reserved. EE 352 Unit 8. HW Constructs

CONTENTS CHAPTER 1: NUMBER SYSTEM. Foreword...(vii) Preface... (ix) Acknowledgement... (xi) About the Author...(xxiii)

Control and Datapath 8

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY

Transcription:

Storage Elements & Sequential Circuits

LC-3 Data Path Revisited Now Registers and Memory 5-2

Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs Øex: adder always generates sum and carry, regardless of previous inputs Sequential Circuit stores information output depends on stored information (state) plus input Øso a given input might produce different outputs, depending on the stored information example: ticket counter Øadvances when you push the button Øoutput depends on previous state useful for building memory elements and state machines 3-3

Storage Elements Static: use a circuit with feedback to save a bit of information flipflops Static memories Dynamic: Use charge at a node to represent a or A cell in a dynamic memory Fewer transistors hence cheaper Need periodic refreshing, every few millisecs. Both are volatile. Not consideed here: ROM (read only memory): combinational Flash memory: semiconductor, but work like disks 4

R-S Latch: Simple Storage Element R is used to reset or clear the element set it to zero. S is used to set the element set it to one. If both R and S are one, out could be either zero or one. quiescent state -- holds its previous value note: if a is, b is, and vice versa 3-5

Clearing the R-S latch Suppose we start with output =, then change R to zero. Output changes to zero. Then set R= to store value in quiescent state. 3-6

Setting the R-S Latch Suppose we start with output =, then change S to zero. Output changes to one. Then set S= to store value in quiescent state. 3-7

R-S Latch Summary R = S = hold current value in latch S =, R= set value to R =, S = set value to R = S = both outputs equal one final state determined by electrical properties of gates Don t do it! 3-8

Gated D-Latch Two inputs: D (data) and WE (write enable) when WE =, latch is set to value of D ØS = NOT(D), R = D when WE =, latch holds previous value ØS = R = 3-9

Register A register stores a multi-bit value. We use a collection of D-latches, all controlled by a common WE. When WE=, n-bit value D is written to register. 3-

Flip-flops D Flip-flop: a storage element, can be edgetriggered (available in logisim) Clock Q D Q D Next Q Rising edge: input sampled Clock State Q is always available YKM /7/7

Registers A register is a row of storage element. Register with parallel load with a Load control line Clock is often implied YKM 2 /7/7

Representing Multi-bit Values Number bits from right () to left (n-) just a convention -- could be left to right, but must be consistent Use brackets to denote range: D[l:r] denotes bit l to bit r, from left to right 5 A = A[4:9] = A[2:] = May also see A<4:9>, especially in hardware block diagrams. 3-3

Memory Now that we know how to store bits, we can build a memory a logical k m array of stored bits. Address Space: number of locations (usually a power of 2) k = 2 n locations Addressability: number of bits per location (e.g., byte-addressable) m bits 3-4

2 2 x 3 Memory address word select word WE input bits write enable address decoder output bits 3-5

More Memory Details This is a not the way actual memory is implemented. fewer transistors, much more dense, relies on electrical properties But the logical structure is very similar. address decoder word select line word write enable Two basic kinds of RAM (Random Access Memory) Static RAM (SRAM) fast, maintains data as long as power applied Dynamic RAM (DRAM) slower but denser, bit storage decays must be periodically refreshed Also, non-volatile memories: ROM, PROM, flash, 3-6

Finite State Machines 3-7

State Machine A general sequential circuit Combines combinational logic with storage Remembers state, and changes output (and state) based on inputs and current state State Machine Inputs Combinational Logic Circuit Storage Elements Outputs Mealy type: general Moore type: Output depends only on state 3-8

Combinational vs. Sequential Two types of combination locks 4 8 4 25 2 3 5 5 Combinational Success depends only on the values, not the order in which they are set. Sequential Success depends on the sequence of values (e.g, R-3, L-22, R-3). 3-9

State The state of a system is a snapshot of all the relevant elements of the system at the moment the snapshot is taken. Examples: The state of a basketball game can be represented by the scoreboard. ØNumber of points, time remaining, possession, etc. The state of a tic-tac-toe game can be represented by the placement of X s and O s on the board. 3-2

State of Sequential Lock Our lock example has four different states, labelled A-D: A: The lock is not open, and no relevant operations have been performed. B: The lock is not open, and the user has completed the R-3 operation. C: The lock is not open, and the user has completed R-3, followed by L-22. D: The lock is open. 3-2

State Diagram Shows states and actions that cause a transition between states. 3-22

State Table for the lock Input Present State Next State R-32 A B - Not R-32 A A - L-22 B C - Not L-22 B A - R-3 C D - Not R-3 C A - Output/a ction R-3 D B Open Not R-3 D A Open CS27 - Fall Semester 25 23

Finite State Machine A description of a system with the following components:. A finite number of states 2. A finite number of external inputs 3. A finite number of external outputs 4. An explicit specification of all state transitions 5. An explicit specification of what determines each external output value Often described by a state diagram. Inputs trigger state transitions. Outputs are associated with each state (or with each transition). 3-24

The Clock Frequently, a clock circuit triggers transition from one state to the next. One Cycle time At the beginning of each clock cycle, state machine makes a transition, based on the current state and the external inputs. Not always required. In lock example, the input itself triggers a transition. 3-25

Implementing a Finite State Machine Combinational logic Determine outputs and next state. Storage elements Maintain state representation. State Machine Inputs Combinational Logic Circuit Outputs Clock Storage Elements 3-26

Storage: Master-Slave Flipflop Skip: there are several A pair of gated D-latches, Possible designs to isolate next state from current state. During st phase (clock=), previously-computed state becomes current state and is sent to the logic circuit. During 2 nd phase (clock=), next state, computed by logic circuit, is stored in Latch A. 3-27

Analyzing a FSM: Logic Circuit to State Diagram. Describe combinational circuit outputs using Boolean algebra. 2. Get the State Table for all possible Input/state combinations.. Causes: Input, Present State 2. Effects: Next State, Outputs (if different from State) 3. Get a state diagram. It provides a graphical description of the behavior. 3-28

Example : Analyze this FSM Input: x State: A,B Output: A, B Combinational block In: x, A, B Out: DA, DB DA = xa + AB + xab DB = xb + xb 29 /7/7

Example : Analyze this FSM (cont) DA = xa + AB + xab DB = xb + xb Input Present State Next State X A B A B 3 /7/7

Example : Analyze this FSM (last) State Table X= State Diagram Input Present State Next State X A B A B It is an up counter 3 /7/7

Designing a FSM: Specification to Circuit Reverse of Anaysis we have seen.. Obtain a State Diagram using the specification. This is the challenging part. Determine the number of flip-flops needed (We will only use D type for convenience) and assign each state a unique binary combination. 2. Get the State Table for all possible Input/state combinations.. Causes: Input, Present State 2. Effects: Next State, Outputs (if different from State) 3. The Combinational circuit truth table is given by the State Table itself (Next state values are the D inputs). Design the combinational circuit. Optimize it as needed. 4. Get complete circuit with Combinational Logic, flip-flops att connected. 5. Simulate and verify the design. 3-32

Example 2: Danger Sign design from P&P A blinking traffic sign No lights on & 2 on, 2, 3, & 4 on, 2, 3, 4, & 5 on 3 4 5 (repeat as long as switch is turned on) 2 Input: Switch Outputs: Z, Y, X States: 4 (bits S, S) Choose: output depends on the state DANGER MOVE RIGHT 3-33

Traffic Sign State Diagram Switch off Switch on State bit S State bit S Outputs Transition on each clock cycle. 3-34

State Table Input Present State Next State Output In S S S S ZYX See Logisim implementation Present state: flipflop output Next state: flipflop D inputs 35

Traffic Sign Truth Tables (from book) Outputs (depend only on state: S S ) Next State: S S (depend on state and input) S S Z Y X Lights and 2 Lights 3 and 4 Light 5 Switch In S S S Whenever In=, next state is. S X X 3-36

Traffic Sign Logic (from book) This design is not optimized. Try Logisim to optimize. Any edge triggered flipflop will work. Master-slave flipflop 3-37

From Logic to Data Path The data path of a computer is all the logic used to process information. See the data path of the LC-3 as an example. Combinational Logic Decoders -- convert instructions into control signals Multiplexers -- select inputs and outputs ALU (Arithmetic and Logic Unit) -- operations on data Sequential Logic State machine -- coordinate control signals and data movement Registers and latches -- storage elements 3-38