Lab 8: A Calculator Using Stack Memory

Slides:



Advertisements
Similar presentations
The CPU The Central Presentation Unit What is the CPU?
Advertisements

Computer Science Education
Microprocessors.
Adding the Jump Instruction
CS364 CH16 Control Unit Operation
1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
Microprocessor.  The CPU of Microcomputer is called microprocessor.  It is a CPU on a single chip (microchip).  It is called brain or heart of the.
NDG-L37-41Introduction to ASIC Design1 Design of a Simple Customizable Microprocessor * Chapter 7 and 15, “Digital System Design and Prototyping”  SIMP.
10/13/2005Comp 120 Fall October Questions? Today Control.
Computer Systems. Computer System Components Computer Networks.
L14 – Control & Execution 1 Comp 411 – Fall /04/09 Control & Execution Finite State Machines for Control MIPS Execution.
16-bit 4-stage Pipelined Microprocessor EECS 427 Project Group: JARS (John, Abhishek, Ramashis, Syed)
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Lec 8: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
L15 – Control & Execution 1 Comp 411 – Spring /25/08 Control & Execution Finite State Machines for Control MIPS Execution.
System Block Diagram MemDataIn is the input port AddressOut and WriteDataOut are output ports Reset clears regfile and all registers Ignore memory control.
SAP1 (Simple-As-Possible) Computer
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.
Lab 7: A Calculator Using Stack Memory
Chapter 14 Introduction to Microprocessors. 2 Microcomputer A self-contained computer system that consists of CPU (central processing unit), memory (RAM.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Fall EE 333 Lillevik 333f06-l8 University of Portland School of Engineering Computer Organization Lecture 8 Detailed MIPS datapath Timing overview.
General Concepts of Computer Organization Overview of Microcomputer.
Multiple-Cycle Hardwired Control Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
Sample Code (Simple) Run the following code on a pipelined datapath: add1 2 3 ; reg 3 = reg 1 + reg 2 nand ; reg 6 = reg 4 & reg 5 lw ; reg.
TEAM FRONT END ECEN 4243 Digital Computer Design.
1 Sequential CPU Implementation. 2 Outline Logic design Organizing Processing into Stages SEQ timing Suggested Reading 4.2,4.3.1 ~
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
Picoblaze Overview EENG Introduction 8-bit microcontroller for Xilinx devices Soft Core – Soft Processor 5% of the resources of spartan 3 (3S200.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
The System Bus. Conceptual CPU Block Diagram Datapath Regs Buses ALU Control Unit Bus Interface IR etc. PC etc. Control Signals Status Signals PSR System.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
CSE431 L06 Basic MIPS Pipelining.1Irwin, PSU, 2005 MIPS Pipeline Datapath Modifications  What do we need to add/modify in our MIPS datapath? l State registers.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
CPUz 4 n00bz.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
CS161 – Design and Architecture of Computer Systems
Catalog of useful (structural) modules and architectures
SAP1 (Simple-As-Possible) Computer
CPU Organisation & Operation
Control & Execution Finite State Machines for Control MIPS Execution.
William Stallings Computer Organization and Architecture 8th Edition
CSCI206 - Computer Organization & Programming
Computer Architecture
Processor (I).
Simple Processor Control Unit
פרק 2: חיווט, זיכרונות בנקים זוגיים ואי-זוגיים
Other DataPath designs: Microprogrammed and pipelined datapaths
The fetch-execute cycle
Control & Execution Finite State Machines for Control MIPS Execution.
Computer Architecture
Computer Organization and ASSEMBLY LANGUAGE
A Multiple Clock Cycle Instruction Implementation
CSCI206 - Computer Organization & Programming
Computer Organization
The Little Man Computer
von Neumann Architecture CPU
22 October 3 classes before 2nd exam! Control 1/16/2019
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
COMS 361 Computer Organization
Other DataPath designs: Microprogrammed and pipelined datapaths
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
Computer Architecture Assembly Language
Computer Architecture
Presentation transcript:

Lab 8: A Calculator Using Stack Memory A simple computer design example A control unit (FSM) Changes from Lab 7 use single port RAM modify the datapath a different control unit NO (fetch + push) NO (fetch + exec + pop)

The block diagram of Lab 7 A dual-port RAM Stack pointer Dual-port RAM stack Program counter inst. IR B A mux mux ALU

Design Changes Modify the block diagram datapath controls require a few changes push/pop and fetch cannot be done in parallel mux controls clk_en for registers and counters Single- port RAM Stack pointer stack mux Program counter inst. IR B A mux mux ALU

Single-port RAM RAM_ADDR 16 * 9 bits inputs outputs Fetch: PC DI: data input WE: write_enable (active high) WCLK: synchronous RAM - positive-edge triggered A: address outputs DO: Data output RAM_ADDR Fetch: PC PUSH_POP_ ==1: STP PUSH_POP_ ==0: STP-1

Stack pointer (no change) push/write operation address = stack pointer ++ pop/read operation address = -- stack_pointer Program counter except that CLK_EN needs to be controlled CLK_EN is activated when an instruction is fetched

Data Flow

Controls Inputs Outputs RESET: power-on reset IR: instruction register STP: stack pointer Outputs AB_SEL: select the inputs for registers A and B 0/1= push/pop (exec) A_CLK_EN, B_CLK_EN Latch regs A and B EOF_ = ~(IR == 1FF) ERROR_: syntax error IR_CLK_EN: latch IR and PC ++ STP_up_dn_: 0/1 = pop/push STP_CLK_EN: real push/pop

Operations and Controls fetch shift push pop execution fetch: IR_CLK_EN shift: B_CLK_EN, (A_CLK_EN), !AB_SEL push: STK_UP_DN_, STK_CLK_EN pop: !STK_UP_DN_, STK_CLK_EN, A_CLK_EN, AB_SEL execution: AB_SEL, B_CLK_EN halt: ! All_CLK_EN

The Control Unit of Lab 7 States Operations S0 S1 IR S2 IR, B S3 OPR Fetch, sh_AB ,push States S0 S1 IR S2 IR, B S3 IR, B, A S4 IR, B, A, STK Error Halt Operations fetch shift push/pop execution

The Control Unit of Lab 8 States that need changes Design options States that need no changes S0 S1: IR S2: IR, B Halt Error States that need changes S3: IR, B, A S4 Design options After an execution To fetch or to pop? Need to be changed !!

Final Design

Operations Pipelining (sort of) Fetch Exec but, Execution Fetch is stalled, if execution requires memory access in this case, execution may require two clock cycles one for operand fetch; the other for execution Execution operation code if REGA, execute the operation ( and fetch in parallel) else pop data from the stack to A register (fetch is stalled), and execute in the next clock cycle (and fetch in parallel) data if A register contains data, push to the stack (a memory write) fetch is stalled IR->B->A