Special Microarchitecture based on a lecture by Sanjay Rajopadhye modified by Yashwant Malaiya

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

LC-3 Instruction Processing

LC-3 Instruction Processing. (Textbook s Chapter 4)

CS 2461: Computer Architecture I

LC3DataPath ECE2893. Lecture 9a. ECE2893 LC3DataPath Spring / 14

11/28/2016. ECE 120: Introduction to Computing. Register Loads Control Updates to Register Values. We Consider Five Groups of LC-3 Control Signals

EEL 5722C Field-Programmable Gate Array Design

Computing Layers. Chapter 5 The LC-3

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture

Instruction Set Architecture

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review

The LC-3 Instruction Set Architecture. ISA Overview Operate instructions Data Movement instructions Control Instructions LC-3 data path

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

Chapter 8 Input/Output

Computer Architecture. Lecture 5: Multi-Cycle and Microprogrammed Microarchitectures

Computer Architecture Lecture 6: Multi-Cycle and Microprogrammed Microarchitectures

( input = α output = λ move = L )

LC-3 ISA - II. Lecture Topics. Lecture materials. Homework. Machine problem. Announcements. ECE 190 Lecture 10 February 17, 2011

CS 270 Fall 2013 Mock Final

The von Neumann Model

Microprogrammed Control. ECE 238L μseq 2006 Page 1

10/31/2016. The LC-3 ISA Has Three Kinds of Opcodes. ECE 120: Introduction to Computing. ADD and AND Have Two Addressing Modes

Intro. to Computer Architecture Homework 4 CSE 240 Autumn 2005 DUE: Mon. 10 October 2005

Chapter 5 - ISA. 1.The Von Neumann Model. The Stored Program Computer. Von Neumann Model. Memory

20/08/14. Computer Systems 1. Instruction Processing: FETCH. Instruction Processing: DECODE

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

Department of Electrical and Computer Engineering The University of Texas at Austin

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

Register Files. Single Bus Architecture. Register Files. Single Bus Processor. Term Project: using VHDL. Accumulator based architecture

Chapter 4 The Von Neumann Model

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

Department of Electrical and Computer Engineering The University of Texas at Austin

REGISTER TRANSFER LANGUAGE

Chapter 4 The Von Neumann Model

Informatics 2C Computer Systems Practical 2 Deadline: 18th November 2009, 4:00 PM

Levels in Processor Design

Introduction to Computer Engineering. CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison

ECE260: Fundamentals of Computer Engineering

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture

Parallel logic circuits

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

LC-3. 3 bits for condition codes (more later) Fixed-length instructions, with 4-bit opcodes. IIT CS 350 S 18- Hale

Department of Electrical and Computer Engineering The University of Texas at Austin

Department of Electrical and Computer Engineering The University of Texas at Austin

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma

LC-3 Instruction Set Architecture

General purpose registers These are memory units within the CPU designed to hold temporary data.

Chapter 4 The Von Neumann Model

LC-3 Instruction Set Architecture. Textbook Chapter 5

Processor (I) - datapath & control. Hwansoo Han

Topic #6. Processor Design

Design of the MIPS Processor (contd)

Chapter 5: The Processor: Datapath and Control

RISC Design: Multi-Cycle Implementation

Binghamton University. CS-120 Summer LC3 Memory. Text: Introduction to Computer Systems : Sections 5.1.1, 5.3

Design of Digital Circuits Lecture 15: Pipelining. Prof. Onur Mutlu ETH Zurich Spring April 2017

Design of the MIPS Processor

Inf2C - Computer Systems Lecture Processor Design Single Cycle

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

Department of Electrical and Computer Engineering The University of Texas at Austin

Implementing Another ISA, Basic Pipelining

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

Department of Electrical and Computer Engineering The University of Texas at Austin

CSE140: Components and Design Techniques for Digital Systems

CPE 335. Basic MIPS Architecture Part II

EE 3170 Microcontroller Applications

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Chapter 4. The Processor

Logistics. IIT CS 350 S '17 - Hale

Department of Electrical and Computer Engineering The University of Texas at Austin

CHAPTER 4: Register Transfer Language and Microoperations

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

REGISTER TRANSFER AND MICROOPERATIONS

REGISTER TRANSFER AND MICROOPERATIONS

Department of Electrical and Computer Engineering The University of Texas at Austin

CPU Organization (Design)

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

Chapter 4. The Processor

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

RISC Processor Design

STRUCTURE OF DESKTOP COMPUTERS

Major and Minor States

A 32-bit Processor: Sequencing and Output Logic

Computer Architecture Programming the Basic Computer

Computer Architecture

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

Department of Electrical and Computer Engineering The University of Texas at Austin

CS311 Lecture: CPU Implementation: The Register Transfer Level, the Register Set, Data Paths, and the ALU

Introduction to CPU Design

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

LECTURE 5. Single-Cycle Datapath and Control

The Processor: Datapath & Control

CSE 2021 COMPUTER ORGANIZATION

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

ENEE 350 Computer Organization Fall, 2004 Project Part 2, due November 18, 2004

Transcription:

Special Microarchitecture based on a lecture by Sanjay Rajopadhye modified by Yashwant Malaiya

Computing Layers Problems Algorithms Language Instruction Set Architecture Microarchitecture Circuits Devices

LC-3 Data Path Revisited Filled arrow = info to be processed. Unfilled arrow = control signal. 5-3

Microarchitecture Functional hardware blocks in a digital system With storage : Registers, Register file, Memory ØTriggerd by the system clock Combinational : MUXes, ALU, adder, SEXT, wiring etc. ØRespond after some propagation delay Design process: Design the datapath and identify control signals Design the Control Finite State Machine Design of functional blocks using gates and flip-flops will be studied later. 4

Timing relative to system clock Combinational blocks (Logic and wiring) Output is always a function of the values on input wires If input changes, the change propagates with some propagation delay. Storage elements are timed Clock a special signal that determines this timing Storage can be updated only at the tick of the clock What happens between ticks? The current values are processed by logic and wiring to produce values that will be used to update at the next tick How fast can the clock tick? Must allow for the longest combinational signal path 5

Timing relative to system clock How fast can the clock tick? Must allow for the longest combinational signal path. Clock frequency: tick rate Ex: 2 GHz mean 2x10 9 cycles per second Clock period: period between two pulses Inverse of clock frequency 2 GHz clock frequency means period is 0.5 nanosecond clock period. Signals must stabilize between two clock periods. Thus longest combinational signal path must be less than a clock period. 6

Register Transfer and Timing In one clock period, signals travel from a source register(s) to a destination register, through the combinational logic. Register transfer notation describes such transfer. For example: Condition: Rdest <- Rsource 1 + Rsource 2 Condition is the logical condition for which this transfer takes place (often in terms of control signals). Transfer takes one clock cycle. Memory operations assumed here to take one cycle also (in reality memories are slow, and take multiple cycles) Register transfer languages: Basic: here Advanced: VHDL, Verolog: used for description/design 7

Combinational Logic A digital circuit that computes a function of the inputs. Examples: Adder: takes X and Y and produces X + Y AND: takes X and Y, produces bitwise and NOT: takes X and Y and produces ~X 2-to-1 MUX: takes three inputs, X, Y and s (the last one is 1- bit) and produces (note that this is C-syntax, not the RTN that we will show later) (s==0)? X : Y 8

Wires and Busses Wires are (almost) just like electrical wires Directional (arrows), sometimes bidirectional May have a thickness: number of bits of data: e.g., the adder output is 16-bits in LC-3 Busses: Shared wires Anyone can read at all times Write is via arbitration (control signals to decide who gets to write on the bus) 9

Storage Elements Large scale storage (memory): view it like an array Address, Data in/out Small scale storage (registers): Programmer-visible registers: R0 R7 Special purpose registers: ØPC, IR, PSR (processor status register), MAR, MDR 10

Memory Processor issues commands to memory, who responds Mem.EN (memory enable): hey, I m talking to you Mem.RW: here s what I want you to do Two special registers Memory Address Register (MAR): only processor writes to this Memory Data Register (MDR): both processor/memory can write to this Ø the processor generates the control signals If Mem.EN and if Mem.RW==0, (i.e.., read) the memory outputs the value at address MAR, If Mem.RW==0, copy the contents of MDR into location Mem[MAR] 11

12 Registers Every register is connected to some inputs and has a special load signal. If load signal is 1 at the next clock tick the input is stored into the register Otherwise, no change in register contents (LD.PC & (PCMux = 10) )? PC ß PC+1 In terms of simple RTN notation Cycle 2: PC ß PC+1 Which assumes that during Cycle2 [LD.PC & (PCMux = 10)) is true.

Register Transfer Notation Compact, program-like notation Describe what happens in the datapath One or more transfers per clock tick one line = one clock tick Two columns: Write the desired transfers List control signals to effect the transfer Let s move on to LC3-Viz (special thanks, Joe Arnett) Corrections BR uses IR[8:0] instead of IR[10:0] for the PC offset 14

RTN/LC3-Viz Conventions Signals indicated must be asserted before the clock tick in order for the indicated transfer to occur. Sequence is: Signals are asserted Clock tick arrives, and causes the transfer In an RTN transfer, on either the right hand side (rhs), or left hand side (lhs) Mem[x] is the memory at address x Mem[MAR] is the memory at address that is in the MAR Reg[x] is Register number x 15

RTN Conventions An RTN transfer is of the form: LHS-location ß RHS-expression The LHSlocation may be a memory or a specific register or the x-th register The RHS-expression is: named registers, e.g., Reg[3] memory locations e.g., Mem[MAR] simple expressions PC+1, Reg[src] + Reg[dst] 16

17 How does the LC-3 fetch an instruction? # Transfer the PC into MAR Cycle 1: MAR ß PC # LD.MAR, GatePC # Read memory; increment PC Cycle 2: MDR ß Mem[MAR]; PC ß PC+1 # Transfer MDR into IR Cycle 3: IR ß MDR # LD.MDR, MDR.SEL, MEM.EN, LD.PC, PCMUX # LD.IR, GateMDR

Control Unit State Diagram The control unit is a state machine. Here is part of a simplified state diagram for the LC-3: A more complete state diagram is in Appendix C. It will be more understandable after Chapter 5. 4-18

Control Unit State Diagram Appendix C. 4-19

20 How does the LC-3 decode the instruction? # Special decode step (controller makes decision, no clock cycle is wasted since it only involves logic) # No visible signal is active

21 How does the LC-3 execute a NOT instruction? # Src register contents are negated by ALU and result is stored in dst register Cycle 4: Reg[dst] ß ~Reg[src]; CC ß Sign(~Reg[src]) # LD.REG, DR = dst, GateALU, ALUK = ~, SR1 = src, LD.CC

Other instructions Every instruction is a sequence of transfers Every one has the same first three cycles (instruction fetch) Every one takes (at least one) additional cycle Some take even more more Each one effected by a specific set of control signals The Controller is responsible for generating the correct signals in the appropriate cycle Reminder Logic responds after some propagation dalay, Storage loads are on clock ticks 22

Data Path Components 5-23

Data Path Components Global bus special set of wires that carry a 16-bit signal to many components inputs to the bus are tri-state devices, that only place a signal on the bus when they are enabled only one (16-bit) signal should be enabled at any time Øcontrol unit decides which signal drives the bus any number of components can read the bus Øregister only captures bus data if it is write-enabled by the control unit Memory Control and data registers for memory and I/O devices memory: MAR, MDR (also control signal for read/write) 5-24

Data Path Components ALU Accepts inputs from register file and from sign-extended bits from IR (immediate field). Output goes to bus. Øused by condition code logic, register file, memory Register File Two read addresses (SR1, SR2), one write address (DR) Input from bus Øresult of ALU operation or memory read Two 16-bit outputs Øused by ALU, PC, memory address Ødata for store instructions passes through ALU 5-25

Data Path Components More details later. Multiplexer (MUX): selects data from multiple sources PC and PCMUX Three inputs to PC, controlled by PCMUX 1. PC+1 FETCH stage 2. Address adder BR, JMP 3. bus TRAP (discussed later) MAR and MARMUX Two inputs to MAR, controlled by MARMUX 1. Address adder LD/ST, LDR/STR 2. Zero-extended IR[7:0] -- TRAP (discussed later) 5-26

Data Path Components Condition Code Logic Looks at value on bus and generates N, Z, P signals Registers set only when control unit enables them (LD.CC) Øonly certain instructions set the codes (ADD, AND, NOT, LD, LDI, LDR, LEA) Control Unit Finite State Machine On each machine cycle, changes control signals for next phase of instruction processing Øwho drives the bus? (GatePC, GateALU, ) Øwhich registers are write enabled? (LD.IR, LD.REG, ) Øwhich operation should ALU perform? (ALUK) Ø Logic includes decoder for opcode, etc. 5-27