Computer Architecture

Slides:



Advertisements
Similar presentations
CPSC 330 Fall 1999 HW #1 Assigned September 1, 1999 Due September 8, 1999 Submit in class Use a word processor (although you may hand-draw answers to Problems.
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
CEG 320/520: Computer Organization and Assembly Language Programming1 Assembly Language Programming Machine Code Hand Assembly.
LC-3 Computer LC-3 Instructions
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
Lecture 18 Last Lecture Today’s Topic Instruction formats
Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name of Unit : Introduction to Microprossor.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
ITEC 352 Lecture 20 JVM Intro. Functions + Assembly Review Questions? Project due today Activation record –How is it used?
CMP 301A Computer Architecture 1 Lecture 4. 2 Outline zISA Introduction zISA Classes yStack yAccumulator yRegister memory yRegister register/load store.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Chapter 4 The Von Neumann Model
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA = All of the.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
Dale & Lewis Chapter 5 Computing components
Operand Addressing And Instruction Representation Tutorial 3.
CPU performs the bulk of data processing operations CPU performs the bulk of data processing operations The CPU is made up of three parts. They are Control.
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
Computer Organization 1
MIPS Processor.
First Foray into Programming (the hard way). A reminder from last lesson: A machine code instruction has two parts:  Op-code  Operand An instruction.
1 Classification of instructions 4-address instructions 3-address instructions 2-address instructions 1-address instructions 0-address instructions.
Overview of Instruction Set Architectures
Immediate Addressing Mode
CPU Organisation & Operation
A Closer Look at Instruction Set Architectures
COMPUTER ARCHITECTURE & OPERATIONS I
Chapter 4 The Von Neumann Model
A Closer Look at Instruction Set Architectures
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
A Closer Look at Instruction Set Architectures: Expanding Opcodes
Decode and Operand Read
Instruction Formats Each instruction consists of two parts:
Chapter 5 The LC-3.
The Processor and Machine Language
Computer Programming Machine and Assembly.
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
The University of Adelaide, School of Computer Science
Computer Architecture & Operations I
MIPS Processor.
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Instructions Instructions (referred to as micro-instructions in the book) specify a relatively simple task to be executed It is assumed that data are stored.
Architecture Overview
Introduction to Micro Controllers & Embedded System Design
Classification of instructions
Chapter 4 The Von Neumann Model
LC-2: The Little Computer 2
CPU has 6 special locations called registers
Addressing mode summary
Execution time Execution Time (processor-related) = IC x CPI x T
Reverse Assembly Typical problem:
Example 1: (expression evaluation)
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Computer Operation 6/22/2019.
MIPS Processor.
Little Man Computer.
MIPS Assembly.
Presentation transcript:

Computer Architecture Homework #1

Problem 2.3 Write the code to implement the expression A=(B+C)*(D+E) on, 3-, 2-, 1-, and 0-address machines. In accordance with programming language practice, computing the expression should not change the values of its operands. Solution: T is a memory location used as temporary 3-address 2-address 1-address 0-address ADD A, B, C LOAD A, B LDA D PUSH D ADD T, D, E ADD A, C ADD E PUSH E MPY A, A, T LOAD T, D STA T ADD ADD T, E LDA B PUSH C MPY A, T ADD C PUSH B MPY T STA A MPY POP A 12 November 2018 Veton Këpuska

Problem 2.4 Write SRC code to implement the expression in Exercise 2.3 Solution: Assume that operands and results are stored in memory addresses that can be accessed with direct addressing. Also assume that ARC has a multiply instruction, mpy, that uses format 6. ld r0, B # r0←M[b] ld r1, C # r1←M[c] add r0, r0, r1 # r0←r0+r1 (B+C) ld r1, D # r1←M[d] ld r2, E # r2←M[e] add r1, r1, r2 # r1←r1+r2 (D+E) mpy r0, r0, r1 # r0←r0+r1 (B+C)*(D+E) st r0, A # r0→M[a] A=(B+C)*(D+E) 12 November 2018 Veton Këpuska

Problem 2.5 Compare the number of memory accesses for data needed to compute the expression by the fine machines of Exercises 2.3 and 2.4 Solution: Assume each instruction fetch requires one memory access: Machine # of Instructions Operands and Results Total memory accesses 3-address 3 3*3=9 3+9=12 2-address 5 2+3+2+3+3=13 5+13=18 1-address 7 7*1=7 7+7=14 0-address 8 5*1=5 8+5=13 SRC 12 November 2018 Veton Këpuska

Problem 2.6 Suppose that opcodes use 8-bits, memory addresses use 24 bits, and register numbers use 5 bits. Also assume that instructions can occupy any integer number of bytes. Compute how many instruction bytes are required by the expression evaluation code for the five machines of Exercises 2.3 and 2.4 Solution: 3-address: Each instruction has one 8-bit opcode field and three 24-bit memory address fields, so one instruction needs 10 bytes. Three instructions require 3*10=30 bytes. 2-address: Each instruction has one 8-bit opcode field and two 24-bit memory address field. One instruction needs 7 bytes, so five instructions require 5*7=35 bytes. 1-address: Each instruction has one 8-bit opcode field and one 24-bit memory address field. One instruction thus needs 4 bytes, so eight instructions require 8*4=24 bytes. 0-address: One arithmetic instruction only requires 8-bit opcode field. One PUSH/POP instruction requires one 8-bit opcode filed and one 24-bit memory address field. So three arithmetic instructions require 3*1=3 bytes. Five PUSH/POP instructions require 5*4=20 bytes. In total 3+20=23 bytes. SRC: Load/store instruction requires 8-bit opcode field, one 5-bit register number field and one 24-bit memory address field, making total of 5 bytes. One arithmetic instruction requires one 8-bit opcode field and three 5-bit register number fields; making total of 3 bytes. Therefore, five load/store instructions and three arithmetic instructions require 5*5+3*3 = 34 bytes. 12 November 2018 Veton Këpuska