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.

Slides:



Advertisements
Similar presentations
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Advertisements

Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
1 Chapter 10 - Structures, Unions, Bit Manipulations, and Enumerations Outline 10.1Introduction 10.2Structure Definitions 10.3Initializing Structures 10.4Accessing.
Processor Data Path and Control Diana Palsetia UPenn
Computer Science Education
SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
Embedded Software 1. General 8051 features (excluding I/O) CPU 8 bit microcontroller The basic registers include (more discussed later) The 8-bit A (accumulator)
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 10 - Structures, Unions, Bit Manipulations, and Enumerations Outline 10.1Introduction 10.2Structure.
1 B. Bruidegom Computer Architecture Top down approach B. Bruidegom AMSTEL-instituut.
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
25 seconds left…...
Execution Cycle. Outline (Brief) Review of MIPS Microarchitecture Execution Cycle Pipelining Big vs. Little Endian-ness CPU Execution Time 1 IF ID EX.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
Topics Left Superscalar machines IA64 / EPIC architecture
Instruction execution and sequencing
Compiler Construction Sohail Aslam Lecture Code Generation  The code generation problem is the task of mapping intermediate code to machine code.
ARM versions ARM architecture has been extended over several versions.
Tutorial Essentially all the Blackfin instruction you need for all of ENCM511. The instructions are easy. Its knowing when to use them that is the difficult.
RAT R1 R2 R3 R4 R5 R6 R7 Fetch Q RS MOB ROB Execute Retire.
Cosc 2150: Computer Organization
Overheads for Computers as Components 2nd ed.
Introduction to Computer Systems
Suranaree University Of Technology มทส  2002 Anant Oonsivilai 2002/2/27 Microcomputers and Microprocessors Chapter Assembly Language Programming.
Chapter 3 โพรเซสเซอร์และการทำงาน The Processing Unit
MIPS Assembly Tutorial
THUMB Instructions: Branching and Data Processing
ITEC 352 Lecture 13 ISA(4).
Target code Generation Made by – Siddharth Rakesh 11CS30036 Date – 12/11/2013.
Digital System Design Using Verilog
Code Generation.
Goal: Write Programs in Assembly
Branches Two branch instructions:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
ELEN 468 Advanced Logic Design
Chapter 2 Instructions: Language of the Computer
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
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 Organization and Architecture Module III.
Lecture 18 Last Lecture Today’s Topic Instruction formats
Module 10 Adapted By and Prepared James Tan © 2001.
ITEC 352 Lecture 20 JVM Intro. Functions + Assembly Review Questions? Project due today Activation record –How is it used?
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.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
Computer Organization 1
SRC: instruction formats Op-coderarb rc c Type D Op-code Type Aunused Op-codera Type Bc1 21 Op-coderarb.
A Closer Look at Instruction Set Architectures
COMPUTER ARCHITECTURE & OPERATIONS I
ELEN 468 Advanced Logic Design
A Closer Look at Instruction Set Architectures: Expanding Opcodes
Instruction Formats Each instruction consists of two parts:
The Processor and Machine Language
Falcon-E : Introduction
Computer Architecture
Computer Architecture & Operations I
The University of Adelaide, School of Computer Science
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Architecture Overview
Classification of instructions
Example 1: (expression evaluation)
MIPS Processor.
Presentation transcript:

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 24 and 25) Chapter 2, Heuring and Jordan, Prob: 2, 3, 4, 5, 6, 9, 14, 23, 24, 25

2.3 T is a memory location used as a 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 ADD STA A MPY POP A

2.4 Assume that operands and results are stored in memory addresses can be accessed with direct addressing. Also assume that SRC has a multiply instruction, mpy, that uses format 6. ld r0, B ld r1, C add r0, r0, r1 ld r1, D ld r2, E add r1, r1, r2 mpy r0, r0, r1 st r0, A

2.5 Assume each instruction fetch requires one memory access Machine Instructions Opnds/Results Total 3-address address 5 13* 18 1-address address SRC (gen reg) *ADD A, C takes 3 data accesses: 2 to fetch A and C and one to store A

address: Each instruction has one 8-bit opcode field and three 24-bit memory address fields, so one instruction needs 10 bytes. Three instructions = 30 bytes. 2-address: Each instruction has one 8-bit opcode field and two 24-bit memory address fields. One instruction needs 7 bytes, so five require 35 bytes. 1-address: Each instruction has one 8-bit opcode field and one 24-bit memory address field. One instruction needs 4 bytes, so eight require 32 bytes. 0-address: One arithmetic instruction only requires one 8-bit opcode field. One PUSH/POP instruction requires one 8-bit and one 24-bit memory address field, so three arithmetic instructions require 3 bytes and five PUSH/POP instructions require 20 bytes. Total 23 bytes. SRC: One load/store instruction requires 8-bit opcode field, one 5-bit register number field, and one 24-bit memory address field, so one load/store instruction requires 5 bytes. One arithmetic instruction requires one 8-bit opcode field and three 5-bit register number fields, so one arithmetic instruction requires 3 bytes. Therefore. five load/store instructions and three arithmetic instructions require 5 * * 3 = 34 bytes.

2.9 In a stack machine, an arithmetic instruction only needs an opcode field, while a PUSH/POP instruction needs both opcode and a much longer address field. If all instructions were forced to be the same length, a considerable amount of memory space would be wasted in arithmetic instructions.

2.14 a) ld r0, a ; Get value of a la r1, 1 ; Gt constant +1 lar r2, plus ; Set branch target brzr r2, r0 ; Skip next if a=0 neg r1, r1 ; Convert constant to -1 plus: add r0, r0, r1 ; Form a+1 or a-1 st r0, a ; Update a b) la r4, 0 ; Constant 0 la r3, ndigit ; R[3] points to ndigit[i] lar r2, loop ; Branch target addi r1, r4, 0 ; Make R[1], =i, 0 loop: st r4, 0(r3) ; ndigit[i] = 0 addi r3, r3, 4 ; Advance array pointer addi r1, r1, 1 ; i++ addi r0, r1,-10 ; R[0]<0 iff i<10 brmi r2, r0 ; Repeat if i<10

2.23 Register Transfer Control signals a) W <- R[6]+1 R[6]out, Win Y <- W Wout, Yin Z <- R[4] + Y R[4]out, Zin R[3] <- Z Zout, R[3]in b) Y <- R[5] R[5]out, Yin Z <- R[4] + Y R[4], Zin Y <- Z Zout, Yin Z <- R[3] + Y R[3]out, Zin R[2] <- Z Zout, R[2]in

2.24 On whiteboard 2.25 On whiteboard