CSE A215 Assembly Language Programming for Engineers

Similar documents
CSE A215 Assembly Language Programming for Engineers

Recitation Session 6

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Philadelphia University Student Name: Student Number:

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

EE 3170 Microcontroller Applications

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

LECTURE 4. Logic Design

Lecture 9: More ILP. Today: limits of ILP, case studies, boosting ILP (Sections )

Chapter 4. The Processor

Chapter 4. The Processor

ECE 486/586. Computer Architecture. Lecture # 7

Lecture: Pipelining Basics

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

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

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

Chapter 4. The Processor

Computer and Hardware Architecture I. Benny Thörnberg Associate Professor in Electronics

Ti Parallel Computing PIPELINING. Michał Roziecki, Tomáš Cipr

COMPUTER ORGANIZATION AND DESIGN

CPE300: Digital System Architecture and Design

Improving Performance: Pipelining

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

Chapter 3 - Top Level View of Computer Function

ECE 341. Lecture # 15

Question Total Possible Test Score Total 100

CSE A215 Assembly Language Programming for Engineers

Module 5 - CPU Design

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

Computer Architecture

Parallelism. Execution Cycle. Dual Bus Simple CPU. Pipelining COMP375 1

Programmable Logic Devices

Instruction Level Parallelism. ILP, Loop level Parallelism Dependences, Hazards Speculation, Branch prediction

CS150 Project Final Report

Design of Digital Circuits ( L) ETH Zürich, Spring 2017

ECE 486/586. Computer Architecture. Lecture # 12

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

Systems Architecture I

What is Pipelining? Time per instruction on unpipelined machine Number of pipe stages

What is Pipelining? RISC remainder (our assumptions)

ECE 341 Midterm Exam

Pipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome

Multiple Instruction Issue. Superscalars

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

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

THE MICROPROCESSOR Von Neumann s Architecture Model

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

CISC Processor Design

Chapter 4. The Processor

Chapter 4 The Processor 1. Chapter 4A. The Processor

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

Lecture 11: Control Unit and Instruction Encoding

Advanced Computer Architecture

Pipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome

Chapter 4. The Processor Designing the datapath

Where Does The Cpu Store The Address Of The

CSE140: Components and Design Techniques for Digital Systems

COMPUTER ORGANIZATION AND DESIGN

Suggested Readings! Recap: Pipelining improves throughput! Processor comparison! Lecture 17" Short Pipelining Review! ! Readings!

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

CS3350B Computer Architecture Winter 2015

Topics. Midterm Finish Chapter 7

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

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

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

COPYRIGHTED MATERIAL INDEX

4. The Processor Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3. Emil Sekerinski, McMaster University, Fall Term 2015/16

Department of Computer and IT Engineering University of Kurdistan. Computer Architecture Pipelining. By: Dr. Alireza Abdollahpouri

Programmable Logic Devices (PLDs)

Chapter 3 : Control Unit

More advanced CPUs. August 4, Howard Huang 1

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

Code No: 07A3EC03 Set No. 1

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

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

There are different characteristics for exceptions. They are as follows:

Laboratory Pipeline MIPS CPU Design (2): 16-bits version

(Basic) Processor Pipeline

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

ECEC 355: Pipelining

COSC 6385 Computer Architecture - Pipelining

Final Lecture. A few minutes to wrap up and add some perspective

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

Lecture 5: The Processor

UPY14602-DIGITAL ELECTRONICS AND MICROPROCESSORS Lesson Plan

Arab Open University. Computer Organization and Architecture - T103

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

Code No: R Set No. 1

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed

Levels in Processor Design

Advanced Parallel Architecture Lessons 5 and 6. Annalisa Massini /2017

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

Pipelining. Pipeline performance

Fundamentals of Computer Organization and Design Errata. Sivarama P. Dandamudi School of Computer Science Carleton University

Single Cycle Datapath

Computer Architecture and Organization

Introduction to CPU Design

Transcription:

CSE A215 Assembly Language Programming for Engineers Lecture 4 & 5 Logic Design Review (Chapter 3 And Appendices C&D in COD CDROM) September 20, 2012 Sam Siewert

ALU Quick Review Conceptual ALU Operation Sam Siewert 2

Quick Primer on State Machines States are Circles Transitions Occur Due to an Input and Produce an Output Transitions Cause One State to be left and a new State to be Entered Input is External to the State Machine Ouput is produced external to the State Machine E.g. Switch with LED to Indicate Power State Power-on / LED-on Off On Power-off / LED-off Sam Siewert 3

Example Instruction Format For the Example Operator (8 bits) 256 unique instructions Input Operand Registers (8 bits each) Output Register (8 bits) Operator Operand-1 Operand-2 Operand-3 8-bit 8-bit 8-bit 8-bit add (0xD7) R0 (0x00) R1 (0x01) R255 (0xFF) 1101_0111 0000_0000 0000_0001 1111_1111 Sam Siewert 4

Start The ALU as a State Machine 4 State Machine 4 Stages of Execution for each ASM Instruction Power-on / Ready Clk-4 / R255 Ready (Written Back) {Clk-1, IP} / {Instruction} Executed Fetched {Clk-3, EU-Select} / Result Decoded {Clk-2, Instruction} / {Opcode, R0, R1, R3} Sam Siewert 5

ALU States R0 R1 Clk 3 EU 1 2 Ctl Decode 4 WB IP R255 Sam Siewert 6

Execution Unit Arithmetic or Logical Operation (Combinational Logic) Applied to Latched Operand Registers Provides Output to Write-Back Unit E.g. Add Unsigned Numbers with Carry and Overflow E.g. Add Two Unsigned, With Carry, No Overflow 0101_0000_1111_0101_1000_1000_0000_0000 (1,358,268,416) + 0101_0000_1111_0101_1000_1000_0000_0000 (1,358,268,416) ----------------------------------------------------------------------------------------- 1010_0001_1110_1011_0001_0000_0000_0000 (2,716,536,832) Sam Siewert 7

New Concept - Instruction Pipeline RISC Reduced Instruction Set Computing Compared to CISC Complex Instruction Set Computing Fit Operator and Operands into Basic Word (32-bit, 64-bit) Rely on Register Load from Memory and Store to Memory from Registers Main Goal is to Simplify Instruction Processing Logic (Stages) Instruction Fetch Instruction Decode Execution Write-Back Sam Siewert 8

Pipelined Architecture Recall that Pipeline Yields CPI of 1 or Less IPC of 4 or More Instruction Completed Each CPU Clock Unless Pipeline Stalls! IF ID Execute Write- Back IF ID Execute Write- Back IF ID Execute Write- Back IF ID Execute Write- Back IF ID Execute Write- Back IF ID Execute Write- Back Sam Siewert 9

Pipeline with Micro-parallelism Goal is to Retire (and Write-Back Result) at Least ONE instruction per Clock CPI of 1.0 or Less IPC of 1.0 or Greater Requires Ability to Overlap IF, ID, Execution and Write-Back Pipeline Stages Fully Pipeline Hazards Can Stall this Overlap of Stages Cache Miss Load or Store Takes Far Longer than 1 Cycle Data Dependencies Need Data From Slow Memory to Proceed Register Pressure All Registers are Tied Up with Out-standing (incomplete Instructions) Branch Mis-prediction Requires Alternate Branch Recovery (Speculative Branch Execution) Sam Siewert 10

Pipeline Depth and RISC vs. CISC RISC Simplification to Processing Logic Limits Pipeline Depth to 4 stages typically CISC Has Complex Instructions with Advanced Memory Access, More Operands (than can fit in a word) and many other convenient features, but requires many more stages for pipelining CISC Can be Pipelined (and has been done e.g. x86 ISA) CISC Can be composed of micro-code that is easier to pipeline Takes fewer instructions to implement the same C statement simpler code generation RISC is simple, but most often requires more ASM operations to code the same C code statement (algorithm) Sam Siewert 11

Logic Design Combinational and Sequential Logic Primer (Appendix C) Sam Siewert 12

Implementation of Boolean Algebra Logic Levels to Represent 1 and 0 Combinational Logic - A logic system whose blocks do not contain memory and hence compute the same output given the same input. Sequential Logic - A group of logic elements that contain memory and hence whose value depends on the inputs as well as the current contents of the memory. Sam Siewert 13

DeMorgan s Laws (A + B + C + + Z) = A & B & C & Z (A & B & C & Z) = A + B + C + Z A B C (A+B+C)' A' & B' & C' (A&B&C)' A' + B' + C' 0 0 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 Sam Siewert 14

Gate Representation of Logic Used in Combinational Logic and Sequential Use Truth Tables and Boolean Algebra to Analyze and Design Sam Siewert 15

Decoders Used for Addressing and Selection Logic Sam Siewert 16

Multiplexor (Input Selection) C = (A & S ) + (B & S) Sam Siewert 17

Building XOR from And/Or/Not Example of Assertion that all Logic can be Derived from 3 Basic Logic Operators Sam Siewert 18

Storing Bits with Flip-Flops Flip Flops Use Feedback (Asynchronous) RS Flip Flop or SR Latch Outputs Q and Q where Q is the Normal Output (State of Bit) Inputs S (Set) and R (Reset) In Normal State, Both Inputs are 0 unless we want to change state Application of momentary 1 to S causes set state (Q=1, Q =0) Application of momentary 1 to R causes clear state (Q=0, Q =1) S R Q Q' 1 0 1 0 0 0 1 0 after S=1, R=0 0 1 0 1 0 0 0 1 after S=0, R=0 1 1 0 0 indeterminate Sam Siewert 19

JK Flip Flop Used for Registers D flip-flop eliminates indeterminate state S & R can never be 1 at same time JK Flip Flop Defines the indeterminate state Q J K Q(t+1) 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 Sam Siewert 20

PLA for 2-layer Logic Using COD Example Truth Table Sam Siewert 21

Recall DeMorgan s Laws Re-write Logic for Truth-table as Product of Sums Enables Implementation with PLA 2-Level Logic Sam Siewert 22

PLA Provides Array of AND Gates and OR Gates for Sum-of- Products 2-layer Logic Fused Selection of Inputs or Inverted Inputs, AND Gates and OR gates applied ( dots ) Implements Truth Table Output (PLD or FPGA Technology Can Be Used) Sam Siewert 23