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

Slides:



Advertisements
Similar presentations
RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address
Advertisements

Chapter 1. Basic Structure of Computers
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Circuits require memory to store intermediate data
Processor System Architecture
Finite State Machines (FSMs) and RAMs and inner workings of CPUs 3/27/2008 COS 116 Instructor: Sanjeev Arora.
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
Introduction to Computer Systems
Memory; Sequential & Clocked Circuits; Finite State Machines COS 116: 3/25/2008 Sanjeev Arora.
Give qualifications of instructors: DAP
Topics covered: CPU Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
16/07/2015CSE1303 Part B lecture notes 1 Hardware Implementation Lecture B17 Lecture notes section B17.
Chapter 6 Memory and Programmable Logic Devices
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora.
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
1 Catalog of useful (structural) modules and architectures In this course we will be working mostly at the BEHAVIORAL and STRUCTURAL levels. We will rely.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Memory; Sequential & Clocked Circuits; Finite State Machines
Computer Architecture
CPU Computer Hardware Organization (How does the computer look from inside?) Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge.
Finite State Machines (FSMs) and RAMs and inner workings of CPUs COS 116, Spring 2010 Guest: Szymon Rusinkiewicz.
Multiple-bus organization
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
The Central Processing Unit (CPU) and the Machine Cycle.
General Concepts of Computer Organization Overview of Microcomputer.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Complete Example.
1 i206: Lecture 4: The CPU, Instruction Sets, and How Computers Work Marti Hearst Spring 2012.
ECE 445 – Computer Organization
DLD Lecture 26 Finite State Machine Design Procedure.
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Lecture 15 Microarchitecture Level: Level 1. Microarchitecture Level The level above digital logic level. Job: to implement the ISA level above it. The.
Logic Design / Processor and Control Units Tony Diep.
Concepts of Engineering and Technology Copyright © Texas Education Agency, All rights reserved.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
REGISTER TRANSFER LANGUAGE (RTL) INTRODUCTION TO REGISTER Registers1.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Controller Implementation
Class Exercise 1B.
Catalog of useful (structural) modules and architectures
Control & Execution Finite State Machines for Control MIPS Execution.
Transforming Data Into Information
COMP541 Sequential Logic – 2: Finite State Machines
von Neumann Architecture CPU
Dr. Clincy Professor of CS
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Control & Execution Finite State Machines for Control MIPS Execution.
Lecture 13: Sequential Circuits, FSM
McGraw-Hill Technology Education
Lecture 13: Sequential Circuits, FSM
CSE 370 – Winter Sequential Logic - 1
CSE 370 – Winter Sequential Logic-2 - 1
von Neumann Architecture CPU
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Overview Last lecture Digital hardware systems Today
Systems Architecture I
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
McGraw-Hill Technology Education
Digital Circuits and Logic
McGraw-Hill Technology Education
Presentation transcript:

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

Recap Combinational logic circuits: no cycles, hence no “memory” Sequential circuits: cycles allowed; can have memory as well as “undefined”/ambiguous behavior Clocked sequential circuits: Contain D flip flops whose “Write” input is controlled by a clock signal

Recap: R-S Latch S R M Forbidden to turn on both Set and Reset simultaneously (value is “ambiguous”)

Recap: D Flip Flop Basic Memory Block – stores 1 bit. D W M If we “toggle” the write input (setting it 1 then setting it 0) then M acquires the value of D.

“Timing Diagram” 5V 0V Time D 5V 0V Time W 5V 0V Time M D W M Output appears when W becomes 0 again.

Finite State Machines (FSMs) Finite number of states Machine can produce outputs, these depend upon current state only (“Moore machine;” see Hayes article) Machine can accept one or more bits of input; reading these causes transitions among states. Closed Open Detected Person No Person Detected Detected Person No Person Detected “Automatic Door”

Implementing door FSM as synchronous circuit INPUT STATE 0 = No Person Detected 1 = Person Detected 0 = Door Closed 1 = Open InputPresent StateNext State

Implementation of door FSM (contd) D W M INPUT CLOCK 0 = No Person Detected 1 = Person Detected 0 = Door Closed 1 = Open STATE

Implementation: General Schematic Inputs Circuit to compute next state Flip flops (memory elements that hold “state”) Circuit to compute outputs CLK K Flip flops allow FSM to have 2 K states State

Example: 4-state machine; 1 bit of input; 1 bit of output State variables: P, Q Input variable: D Next value of P = (P + Q)  D Next value of Q = P Output = P  Q What is its state diagram? How can it be implemented as a clocked synchronous circuit? Divide in groups of 3 and hand this in. Discussion Time

How to implement a FSM? If number of states = 2 k then represent “state” by k boolean variables. Identify number of input variables Write truth table expressing how “next state” is determined from “current state” and current values of the input. Convert to boolean circuit. Express as clocked synchronous circuit.

How an FSM does “reasoning” “If left infrared sensor detects an object, turn left” L = 0 L = 1 T =1 T= 0 Output goes to motor that turns the wheel

Next…. Random Access Memory (RAM) Memory where each location has an address

Recall from last lecture: “Register” with 4 bits of memory How can you set up an addressing system for large banks of memory?

RAM 2 K bits; bank of flipflops K Address Bits Data Write RAM K Address Bits Data Read

If 4 locations, “address” has 2 bits Address Clock To RAM’s “Clock” input

RAM: Implementing “Write” RAM Decoder (Demux) Data The decoder selects which cell in the RAM gets its “Write” input toggled K-bit address (in binary) Clock (simple combinational circuit; see logic handout)

Ram: implementing “Read” RAM Multiplexer Data The multiplexer is connected to all cells in the RAM; selects the appropriate cell based upon the k-bit address K-bit address (in binary) (simple combinational circuit; see logic handout)

Next, the secret revealed... How computers execute programs. CPU = Central Processing Unit

Scribbler Control Panel Program Machine Executable Code F5 “Download to Robot” (Compilation) T-P programs represented in binary.exe files in the Wintel world Similar to: Point 1: Programs are “translated” into “machine language”; this is what’s get executed.

Greatly simplified view of modern CPUs. Program (in binary) stored in memory Memory Registers Arithmetic and Logic Unit (ALU) Control FSM Lots of Custom Hardware Instruction Pointer RAM

Examples of Machine Language Instructions ADD Add contents of Register 3 and Register 7 and store in Register 12 JUMP If register 4 has a number > 0 set IP to LOAD Read Location from memory and load into Register 3 Stored in binary (recall Davis’s binary encoding of T-P programs)

Different CPUs have different machine languages Intel Pentium, Core, Xeon, etc. (PC, recent Mac) Power PC (old Mac) ARM (cellphones, mobile devices, etc.) “Backwards Compatibility” – Core 2’s machine language extends Pentium’s machine language Machine languages now allow complicated calculations (eg for multimedia, graphics) in a single instruction

Main Insight Computer = FSM controlling a larger (or infinite) memory.

Meet the little green man… The Fetch – Decode – Execute FSM Execute Decode Fetch

Fetch – Decode – Execute FSM “Fetch” IP IP + 1 Decode Execute (output bits used to control circuits that add, multiply etc.) ADD Instruction JUMP Instruction Go to next instruction

CPU as a conductor of a symphony Network Card CPU Sound Card CD-ROM Video Card “BUS” e.g., PCI Bus: “Everybody hears everybody else”

Speculation: Brain as FSM? Network (“graph”) of 100 billion neurons; each connected to a few thousand others Neuron = tiny Computational Element; “switching time” 0.01 s Neuron generates a voltage spike depending upon how many neighbors are spiking.