CS 2630 Computer Organization. Meeting 4: Intro to Architecture (specifically, MIPS) Brandon Myers University of Iowa

Similar documents
The plot thickens. Some MIPS instructions you can write cannot be translated to a 32-bit number

The plot thickens. Some MIPS instructions you can write cannot be translated to a 32-bit number

CS 2630 Computer Organization. Meeting 10/11: data structures in MIPS Brandon Myers University of Iowa

CS3350B Computer Architecture MIPS Instruction Representation

Where we are going (today)

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

CS 2630 Computer Organization. Meeting 13: Faster arithmetic and more operations Brandon Myers University of Iowa

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

Where we are going (today)

Assembly Programming

Computer Architecture

CS61C Machine Structures. Lecture 8 - Introduction to the MIPS Processor and Assembly Language. 9/14/2007 John Wawrzynek

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

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

Lecture 4: Instruction Set Architecture

CSE 378 Midterm 2/12/10 Sample Solution

ECE260: Fundamentals of Computer Engineering

Chapter 2. Instructions:

EC 413 Computer Organization

Review of instruction set architectures

ECE260: Fundamentals of Computer Engineering

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Lecture 4: MIPS Instruction Set

Instruction Set Architecture

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

ECE 154A Introduction to. Fall 2012

Where are we? Compiler. translating source code (C or Java) Programs to assembly language And linking your code to Library code

The MIPS Instruction Set Architecture

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

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

Operations, Operands, and Instructions

Instructions: Language of the Computer

CS61C : Machine Structures

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

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

CSCI 402: Computer Architectures

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Instructions: Language of the Computer

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

CS 61C: Great Ideas in Computer Architecture Lecture 2: Introduction to C, Part I

Chapter 2: Instructions:

Lecture 6 Decision + Shift + I/O

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

CS 61C: Great Ideas in Computer Architecture Introduction to Assembly Language and RISC-V Instruction Set Architecture

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

COMPSCI 313 S Computer Organization. 7 MIPS Instruction Set

Processor design - MIPS

ECE232: Hardware Organization and Design

CS61C : Machine Structures

Lecture Topics. Announcements. Today: The MIPS ISA (P&H ) Next: continued. Milestone #1 (due 1/26) Milestone #2 (due 2/2)

Thomas Polzer Institut für Technische Informatik

Unsigned Binary Integers

Unsigned Binary Integers

Programming the processor

ISA: The Hardware Software Interface

Chapter 3. Instructions:

CS 4200/5200 Computer Architecture I

Chapter Two MIPS Arithmetic

Lecture #6 Intro MIPS; Load & Store

EE108B Lecture 2 MIPS Assembly Language I. Christos Kozyrakis Stanford University

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

ECE 15B Computer Organization Spring 2011

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

Review. Lecture #9 MIPS Logical & Shift Ops, and Instruction Representation I Logical Operators (1/3) Bitwise Operations

Chapter 2A Instructions: Language of the Computer

CS 61C: Great Ideas in Computer Architecture Introduction to Assembly Language and MIPS Instruction Set Architecture

CS 2506 Computer Organization II

EC 413 Computer Organization

Review: ISA. Review: Compiling Applications. Computer Architecture ELEC3441. Instruction Set Architecture (1) Computer Architecture: HW/SW Interface

Computer Organization MIPS ISA

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

Architecture I. Computer Systems Laboratory Sungkyunkwan University

CS 61c: Great Ideas in Computer Architecture

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

MIPS%Assembly% E155%

CS61C Machine Structures. Lecture 12 - MIPS Procedures II & Logical Ops. 2/13/2006 John Wawrzynek. www-inst.eecs.berkeley.

CENG3420 Lecture 03 Review

Chapter 2: Instructions How we talk to the computer

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

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

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

3. Instruction Set Architecture The MIPS architecture

Programmable Machines

CS 110 Computer Architecture. Lecture 2: Introduction to C, Part I. Instructor: Sören Schwertfeger.

Programmable Machines

CS3350B Computer Architecture Quiz 3 March 15, 2018

CS 351 Exam 2 Mon. 11/2/2015

Computer Organization and Components

Many ways to build logic out of MOSFETs

MACHINE LANGUAGE. To work with the machine, we need a translator.

Topic Notes: MIPS Instruction Set Architecture

Lectures 3-4: MIPS instructions

CSEE 3827: Fundamentals of Computer Systems

CS 61C: Great Ideas in Computer Architecture. MIPS Instruction Formats

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

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Brock Wilcox CS470 Homework Assignment 2

Hardware Level Organization

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

Transcription:

CS 2630 Computer Organization Meeting 4: Intro to Architecture (specifically, MIPS) Brandon Myers University of Iowa

Where we are going Compiler Instruction set architecture (e.g., MIPS) translating source code (C or Java) Programs to assembly language And linking your code to Library code How the software talks To the hardware Memory system Processor Datapath & Control Digital logic I/O system How a processor runs MIPS Programs! How switches (1 or 0) can be used to build Interesting functions: from integer arithmetic to programmable computers

Where we are going Learned some bitwise operations Instruction Execution engine Data NEXT what gets stored in here Learned how bits are organized in

Where we are going Compiler Instruction set architecture (e.g., MIPS) translating source code (C or Java) Programs to assembly language And linking your code to Library code How the software talks To the hardware Memory system Processor Datapath & Control Digital logic I/O system How a processor runs MIPS Programs! How switches (1 or 0) can be used to build Interesting functions: from integer arithmetic to programmable computers

Reading quiz 1. In MIPS, what do load word (lw) and store word (sw) instructions do? 2. What is the name for constants in MIPS instructions? 3. What does this instruction do? add $t0, $t1, $t3 4. What is the difference between and registers?

Representations of a program int x = arr[1]; arr[2] = x + 10; Compiler High level language program (human readable) lw $t0, 4($r0) addi $t0, $t0, 10 sw $t0, 8($r0) Assembler assembly program as text (CS2630 student readable) 10001110000010000000000000000100 00100001000010000000000000001010 10101110000010000000000000001000 assembly program as binary (machine readable)

Languages High level language (HLL) programs are instruction set architectureindependent language is convenient to use language is has powerful features Java, C, Python, Lisp, C++, MATLAB, Assembly language programs are specific to an instruction set architecture the native language of the processor language is bare-bones: lacks most of the features of HLLs in this course, these are all synonyms Instruction set architecture instruction set ISA architecture MIPS, ARM, x86, SPARC, Power, Alpha,

Brief history of compatibility before IBM 360 different architecture for every processor my_program.asm version 1 Processor model 1 slow processor, small my_program.asm version 2 Processor model 2 mediocre processor, medium my_program.asm version 3 Processor model 3 fast processor, large post IBM 360 one architecture for all processors my_program.asm one program written for one architecture, IBM 360 runs on different microarchitectures IBM Model 30 slow processor, small IBM Model 50 mediocre processor, medium IBM Model 75 fast processor, large

Peer instruction I wrote my program in C (a high level language) and compiled it to run on a MIPS machine. What should I do to get that program to run on an x86 machine? a) rewrite my C program to be compatible with x86 b) rewrite my program in x86 assembly language c) recompile my C program for x86 d) reassemble my program using the x86 assembler

Languages High level language: usually has variables, objects, and arrays Assembly language: usually just has registers and

Memory Registers https://library.law.uiowa.edu/history-library

https://library.law.uiowa.edu/history-library

registers 0000 0004 0008 000C 0010 0014 0018 001C 0020 0024 0028

The main idea 4 categories of instructions perform an operation on two registers and store result in a register perform an operation on one register and a constant and store the result in a register move a value between a register and determine which instruction to execute next 0x0000

Register transfer language 4 categories of instructions perform an operation on two registers and store result in a register perform an operation on one register and a constant and store the result in a register move a value between a register and determine which instruction to execute next r2 <- r1 + r0 r1 <- r0 + constant r0 <- M[address] if r0 == r1 PC <- branchaddress else PC <- PC+4 M[address] <- r0

Example assembly program MEMORY address 0x0 0 0x4 0x8 0xC -14 50 1 a x y z r0 r1 r2 REGISTERS high level a = x + y - z Peer instruction: Write an assembly program using a sequence of instructions (use register transfer language)

MIPS reference sheet scavenger hunt roles: scribe / skeptic / manager In groups of 3: All of these questions are answerable from the information on the sheet. 1. What does the sll instruction do? Be specific about what happens to each operand. 2. What is the opcode (numeric value) for the subu instruction? 3. What does the notation {imm, 00} mean? 4. What does the andi instruction do? Be specific about what happens to each operand. 5. What is the difference between sb and sw, in terms of what the instructions do? (not just asking about the notes column) 6. Find the instruction you would use to put an immediate in the most significant 16- bits of a given register and 0 s in the least significant 16 bits.