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

Similar documents
EE 3170 Microcontroller Applications

Microprocessors/Microcontrollers

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Recitation Session 6

Computer Architecture 2/26/01 Lecture #

Storage Elements & Sequential Circuits

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

I 3 I 2. ! Language of logic design " Logic optimization, state, timing, CAD tools

Microcomputer Architecture and Programming

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU.

Module 5 - CPU Design

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

CSE A215 Assembly Language Programming for Engineers

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

CE1911 LECTURE FSM DESIGN PRACTICE DAY 2

2015 Paper E2.1: Digital Electronics II

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

Chapter 4. The Processor

Finite State Machines

Computer Architecture Programming the Basic Computer

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Architecture of 8085 microprocessor

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

1. Internal Architecture of 8085 Microprocessor

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

Injntu.com Injntu.com Injntu.com R16

3.1 Description of Microprocessor. 3.2 History of Microprocessor

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE) UNIT-I

CS 101, Mock Computer Architecture

CPSC 121: Models of Computation

Chapter 1: Basics of Microprocessor [08 M]

CS232: Computer Architecture II

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

Chapter 4. The Processor

Introduction to Microcontrollers

Computer Architecture

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

ECE 341 Midterm Exam

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

Verilog for High Performance

ECE 551: Digital System *

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

Information Science 1

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified.

CPU Architecture system clock

EE577A FINAL PROJECT REPORT Design of a General Purpose CPU

Memory Supplement for Section 3.6 of the textbook


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

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Sequential Logic Design

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

Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

7/28/ Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc.

Approaches to Digital System Design

Processor (I) - datapath & control. Hwansoo Han

Code No: 07A3EC03 Set No. 1

Finite State Machines

Sequential Circuits. inputs Comb FFs. Outputs. Comb CLK. Sequential logic examples. ! Another way to understand setup/hold/propagation time

MICROCONTROLLERS 8051

Basics of Microprocessor

Code No: R Set No. 1

ECE 595Z Digital Systems Design Automation

Single Cycle Datapath

EECS150. Implement of Processor FSMs

Readings: Storage unit. Can hold an n-bit value Composed of a group of n flip-flops. Each flip-flop stores 1 bit of information.

Computer Architecture and Assembly Language. Spring

Three-box Model: These three boxes need interconnecting (usually done by wiring known as a bus. 1. Processor CPU e.g. Pentium 4 2.

Introduction to Microprocessor

Modeling of Finite State Machines. Debdeep Mukhopadhyay

Music. Numbers correspond to course weeks EULA ESE150 Spring click OK Based on slides DeHon 1. !

THE MICROCOMPUTER SYSTEM CHAPTER - 2

CS 61C Summer 2012 Discussion 11 State, Timing, and CPU (Solutions)

Chapter 10. case studies in sequential logic design

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

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

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Lecture 19: Computers. Pay no attention to the man behind the curtain.

Finite-State Machine (FSM) Design

VHDL for Synthesis. Course Description. Course Duration. Goals

Philadelphia University Department of Computer Science. By Dareen Hamoudeh

Chapter 3 : Control Unit

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Chapter 2 Logic Gates and Introduction to Computer Architecture

Final Exam Review. b) Using only algebra, prove or disprove the following:

MCMASTER UNIVERSITY EMBEDDED SYSTEMS

Chapter 4. The Processor Designing the datapath

Control and Datapath 8

Design of Embedded DSP Processors

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Transcription:

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 D W M 5V 0V Time 5V 0V Time 5V 0V Time D W M Output appears when W becomes 0 again.

Finite State Machines (FSMs) Detected Person Automatic Door No Person Detected Closed Open Detected Person Finite number of states No Person Detected 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.

Implementing door FSM as synchronous circuit No Person Detected Detected Person Closed Open INPUT 0 = No Person Detected 1 = Person Detected STATE 0 = Door Closed 1 = Open No Person Detected Input Present State Next State 0 0 0 1 0 1 0 1 0 1 1 1 Detected Person

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

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

Discussion Time 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.

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 = 1 T =1 Output goes to motor that turns the wheel L = 0 T= 0

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 Data Data K Address Bits RAM RAM K Address Bits Write 2 K bits; bank of flipflops Read

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

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

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

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

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

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

Examples of Machine Language Instructions ADD 3 7 12 Add contents of Register 3 and Register 7 and store in Register 12 LOAD 3 67432 Read Location 67432 from memory and load into Register 3 JUMP 4 35876 If register 4 has a number > 0 set IP to 35876 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 Fetch Decode Execute

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

CPU as a conductor of a symphony Network Card CPU Sound Card BUS e.g., PCI CD-ROM Video Card 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.