Processor design - MIPS

Similar documents
Chapter 2. Instructions:

COMP 303 MIPS Processor Design Project 3: Simple Execution Loop

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

Instructions: Language of the Computer

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

Chapter 3. Instructions:

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#:

MIPS Instruction Set

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

MIPS Coding Continued

Topic Notes: MIPS Instruction Set Architecture

MIPS%Assembly% E155%

Unsigned Binary Integers

Unsigned Binary Integers

Anne Bracy CS 3410 Computer Science Cornell University. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

CS31001 COMPUTER ORGANIZATION AND ARCHITECTURE. Debdeep Mukhopadhyay, CSE, IIT Kharagpur. Instructions and Addressing

Grading: 3 pts each part. If answer is correct but uses more instructions, 1 pt off. Wrong answer 3pts off.

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

A Processor! Hakim Weatherspoon CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1

Chapter 4. The Processor

Chapter 2. Instructions: Language of the Computer. HW#1: 1.3 all, 1.4 all, 1.6.1, , , , , and Due date: one week.

ECE 30 Introduction to Computer Engineering

University of California at Santa Barbara. ECE 154A Introduction to Computer Architecture. Quiz #1. October 30 th, Name (Last, First)

COMPSCI 313 S Computer Organization. 7 MIPS Instruction Set

CS222: MIPS Instruction Set

Programmable Machines

CS3350B Computer Architecture Quiz 3 March 15, 2018

comp 180 Lecture 10 Outline of Lecture Procedure calls Saving and restoring registers Summary of MIPS instructions

Programmable Machines

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

Instructions: Language of the Computer

ECE232: Hardware Organization and Design

Review of instruction set architectures

Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

CS3350B Computer Architecture MIPS Instruction Representation

CENG3420 Lecture 03 Review

Concocting an Instruction Set

CSE 378 Midterm 2/12/10 Sample Solution

COMP MIPS instructions 2 Feb. 8, f = g + h i;

Chapter 4. The Processor

Course Administration

Lecture 4: MIPS Instruction Set

Computer Architecture

Lectures 3-4: MIPS instructions

These actions may use different parts of the CPU. Pipelining is when the parts run simultaneously on different instructions.

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements

Lecture 2. Instructions: Language of the Computer (Chapter 2 of the textbook)


Stored Program Concept. Instructions: Characteristics of Instruction Set. Architecture Specification. Example of multiple operands

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

CS3350B Computer Architecture MIPS Introduction

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Examples of branch instructions

The MIPS Instruction Set Architecture

Computer Architecture. MIPS Instruction Set Architecture

Concocting an Instruction Set

Chapter 4. The Processor Designing the datapath

A General-Purpose Computer The von Neumann Model. Concocting an Instruction Set. Meaning of an Instruction. Anatomy of an Instruction

Stored Program Concept. Instructions: Characteristics of Instruction Set. Architecture Specification. Example of multiple operands

M2 Instruction Set Architecture

Introduction. Datapath Basics

Flow of Control -- Conditional branch instructions

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

Reduced Instruction Set Computer (RISC)

Reduced Instruction Set Computer (RISC)

EE 361 University of Hawaii Fall

Character Is a byte quantity (00~FF or 0~255) ASCII (American Standard Code for Information Interchange) Page 91, Fig. 2.21

Instructions: Assembly Language

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design

Lecture 4: Instruction Set Architecture

Today s topics. MIPS operations and operands. MIPS arithmetic. CS/COE1541: Introduction to Computer Architecture. A Review of MIPS ISA.

Computer Organization MIPS ISA

Chapter 2. Instruction Set Architecture (ISA)

CS 351 Exam 2 Mon. 11/2/2015

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

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

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

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

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology

Midterm. Sticker winners: if you got >= 50 / 67

SISTEMI EMBEDDED. Basic Concepts about Computers. Federico Baronti Last version:

Control Hazards - branching causes problems since the pipeline can be filled with the wrong instructions.

Data paths for MIPS instructions

Chapter 2A Instructions: Language of the Computer

Control Unit. Simulation. Result

Instruction Set Principles. (Appendix B)

Chapter 4. The Processor

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I

Chapter 4. The Processor. Computer Architecture and IC Design Lab

Transcription:

EASY Processor design - MIPS Q.1 What happens when a register is loaded? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit pattern at a memory location is copied to the register. The memory is set to all zeros. 4. A bit pattern at a memory location is copied to the register. Memory is not changed. Q.2 What happens when a register is stored? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit pattern at a memory location is copied to the register. The memory is set to all zeros. 4. A bit pattern at a memory location is copied to the register. Memory is not changed. Q.3 By software convention, the machine instructions of a program are put in a designated section of memory. What is this section called? 1. Data segment. 2. Stack segment. 3. Program segment. 4. Text segment. Q.4 What general purpose register is permanently set to thirty-two zero bits? 1. $0 2. $1 3. $31 4. $32

Q.5 What part of the processor chip performs arithmetic and logical operations? 1. CPU 2. ALU 3. ROM 4. PCI Q.6 Where do the operands for an arithmetic machine instruction come from? 1. Both operands are registers. 2. Both operands come from memory. 3. One operands must be a register, the other one may be memory or a register. 4. One operand must be a register, the other may be a register or may be part of the machine instruction. Q.7 What is an opcode? 1. The part of a machine instruction that designates the data to be used. 2. A bit field, part of a machine instruction that designates a machine operation. 3. The part of the processor chip that performs decoding operations. 4. The part of a machine instruction that is used as data in an operation. Q.8 So what size bit field must a machine instruction use to designate a register? 1. 3 2. 4 3. 5 4. 16 MEDIUM Q.9 What is the mnemonic name of a register? 1. A register number like $0 or $31.

2. A name that helps you remember the hardware characteristics of the register. 3. The bit pattern that designates the register in a machine instruction. 4. A name like $s0 that helps you remember the conventional software uses for the register. Q.10 In what order should be the three steps of the machine cycle? 1. fetch, increment, execute. 2. Execute, fetch, increment. 3. Fetch, execute, increment. 4. increment, fetch, execute. Q.11 PC should be incremented by how many bytes to read the next instruction in sequence? 1. 2 2. 4 3. 5 4. 8 Q.12 Which format does arithmetic expression use? 1. R-type 2. J-type 3. B-type 4. I-type Q.13 What are the four bytes immediately following a jump instruction called? 1. fetch delay slot 2. pipeline delay slot 3. branch delay slot 4. PC advance slot Q.14 What is a pipeline?

1. Several words of data from memory are moved into the processor before instructions need them. 2. Several sequential instructions are simultaneously prepared for execution while one instruction finishes its execution. 3. A single instruction is divided into four phases and each phase is executed in one machine cycle. 4. Multiple items of data are sent down the system bus like water in a pipe. Q.15 Say that a sll instruction is located in memory at address 0x400100, and an add instruction is located in memory at address 0x400104. After the add instruction executes, what value will be in the PC? 1. 0x400100 2. 0x400104 3. 0x400105 4. 0x400108 Q.16 Say that a j (jump) instruction is located in memory at address 0x400100, and a sll instruction is located in memory at address 0x400104. After the j instruction executes, what value will be in the PC? 1. 0x400100 2. 0x400101 3. 0x400102 4. 0x400104 Q.17 Here is a schematic program loop.

What numbers go into the two blanks? 1. 14, 08 2. 14, 00 3. 00, 08 4. 14, 18 HARD Q.18 Here is a 32-bit j instruction. The first 6 bits are the op-code. 000010 00 0001 0000 0000 0000 0000 1000 Here is the value of the PC while the target address is being constructed: 0000 1000 0001 0000 0000 1100 0110 1000 What address does the j put into the PC? 1. 0000 00 0001 0000 0000 0000 0000 1000 00 2. 0000 1000 0001 0000 0000 1100 0110 1000 3. 0000 10 0001 0000 0000 1100 0110 1000 00 4. 1000 00 0001 0000 0000 0000 0000 1000 00 Q.19 Examine the following program fragment. The program is to add $5 and $6 together only if they are not equal. Pick instructions to fill the blanks. 1. beq ; addu 2. bne ; sll 3. bne ; addu

4. beq ; sll Q.20 Here is an if-then-else structure. The code is to compare $10 and $11. If these registers contain the same bit pattern, set register $7 to 1. Otherwise set $7 to 0. Which choices should fill the blanks? 1. bne ; equal ; join 2. beq ; join ; equal 3. beq ; equal ; join 4. bne ; join ; equal Q.21 Say that registers $5 and $6 each contain an ASCII character in the low order byte. Can the beq instruction be used to compare the characters? 1. Yes, because beq will recognize the character data and do a character comparison. 2. No, because beq only works with two's complement integers. 3. No, because beq only works with full 32-bit data. 4. Yes, because beq compares bit patterns regardless of what they represent. Q.22 What operation copies data from main memory into a general purpose register?

1. load 2. store 3. move 4. add Q.23 Which one of the following addresses is word aligned? 1. 0x01234567 2. 0x00FA0700 3. 0x77000003 4. 0x00000042 Q.24 Say that four bytes in main storage contain (bits that represent) a 32-bit integer. What is the address used for this integer? 1. The address of the byte with the highest address of the four. 2. The address of each byte is used. 3. Only one byte at a time can be addressed. 4. The address of the byte with the lowest address of the four. Q.25 Here is a 32-bit pattern: 0x00224477. This pattern is to be stored in main memory using bytes at addresses 0x10000000, 0x10000001, 0x10000002, and 0x10000003. On a big endian processor, what bit pattern is contained in address 0x10000000? 1. 0x00 2. 0x22 3. 0x44 4. 0x77 Q.26 A lw is to load register $5 from location 0x0040000C in memory. Register $10 contains 0x00400000. Write the assembly language instruction: 1. lw $10, 0x0C($10) 2. lw $10, 0x0C($5) 3. lw $5, 0x0C($10)

4. lw $5, 0x0C(400000) Q.27 Register $10 contains 0x100000000. Beginning at that address there are five integers in a row. Write the instruction that loads the last integer into register $7. 1. lw $7, 50($10) 2. lw $7, 20($10) 3. lw $7, 16($10) 4. lw $7, 40($10) Q.28 Register $5 contains the address 0x10000100. Write the instruction that loads the four bytes that precede this address into register $7. 1. lw $7, 4($5) 2. lw $7, -4($5) 3. lw $5, 4(-$5) 4. lw $7, 0($5-4) Q.29 Write the assembly instruction that fills register $10 with 0x10000000 1. lui $10, 0x1000 2. lui $10, 0x10000000 3. ori $10, $0, 0x10000000 4. ori $10, $10, 0x1000 Q.30 Say that somehow register $10 has been loaded with the address 0x10000000. Write the instruction that alters $10 so that it contains 0x100000F0. 1. ori $10, $0, 0x00F0 2. or $10, $10, 0x00F0 3. ori $10, $10, 0x00F0 4. andi $10, $10, 0x00F0 Answered:- 1. 4

2. 2 3. 4 4. 1 5. 2 6. 4 7. 2 8. 3 9. 4 10. 1 11. 2 12. 1 13. 3 14. 2 15. 4 16. 4 17. 1 18. 1 19. 4 20. 3 21. 4 22. 1 23. 2 24. 4 25. 1 26. 3 27. 3 28. 2 29. 1 30. 3