CS334: Number Systems&& Mars simulator Lab 1_2. Ins.Ebtesam AL-Etowi Quizzes/Participation/Absence 5% Logisim/MIPS Programming5% CPU Design Project10%

Slides:



Advertisements
Similar presentations
Lecture 13: 10/8/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Advertisements

Goal: Write Programs in Assembly
Code Composer Department of Electrical and Computer Engineering
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
Intro to CS – Honors I Representing Numbers GEORGIOS PORTOKALIDIS
Syscall in MIPS Xinhui Hu Yuan Wang.
IT253: Computer Organization Lecture 6: Assembly Language and MIPS: Programming Tonga Institute of Higher Education.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS
CS 61C L02 Number Representation (1)Harvey / Wawrzynek Fall 2003 © UCB 8/27/2003  Brian Harvey ( John Wawrzynek  (Warznek) (
Instruction Representation II (1) Fall 2007 Lecture 10: Instruction Representation II.
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
Systems Environment 3 Quick Revision Review of Exercises Introduction to TOM TOM Exercises.
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
1 Lab Session-IV CSIT-120 Fall 2000 Precedence Rules Machine Language Programming The “Micro” Machine The “Micro” Simulator The “Micro” Translator (Thanks.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Computer Architecture
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
Comp Sci vars & expns 1 Ch. 4 Variables and Expressions.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
CSCI 211 Intro Computer Organization –Consists of gates for logic And Or Not –Processor –Memory –I/O interface.
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
MIPS coding. Review Shifting – Shift Left Logical (sll) – Shift Right Logical (srl) – Moves all of the bits to the left/right and fills in gap with 0’s.
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
1 Lecture 7: MARS, Computer Arithmetic Today’s topics:  MARS intro  Numerical representations  Addition and subtraction.
Dale & Lewis Chapter 5 Computing components
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Computer Organization Instructions Language of The Computer (MIPS) 2.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 Integer Representations V1.0 (22/10/2005). 2 Integer Representations  Unsigned integer  Signed integer  Sign and magnitude  Complements  One’s.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Writing an Assembly-language program MIPS assembly language using MARS: MIPS Assembler and Runtime Simulator CS-2710 Dr. Mark L. Hornick 1.
1 Chapter 1: Introduction Appendix A: Binary and Hexadecimal Tutorial Assembly Language for Intel-Based Computers, 3rd edition Kip R. Irvine.
CS 312 Computer Architecture & Organization
CS2100 Computer Organisation
David Kauchak CS 52 – Spring 2017
Computers’ Basic Organization
Compsci 210 Tutorial Five.
Chapter 1 Introduction.
Status Register Status = system byte (supervisor only) + user byte = system status + condition code register usually, it is not important to know.
Introduction to Lab #1 José Nelson Amaral.
Assembly Language (continue)
Morgan Kaufmann Publishers
ACOE301: Computer Architecture II Labs
MIPS assembly syntax Comments
COMP3221: Microprocessors and Embedded Systems
CDA 3101 Spring 2016 Introduction to Computer Organization
Data Representation – Instructions
THE sic mACHINE CSCI/CMPE 3334 David Egle.
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Chapter 1 C for Embedded Systems.
The University of Adelaide, School of Computer Science
MISP Assembly.
CSCI206 - Computer Organization & Programming
The University of Adelaide, School of Computer Science
Chapter 1 C for Embedded Systems.
MIPS Assembly.
CS334: Memory _ Mars simulator Lab 4(part2-2)
MIPS Assembly.
CS334: Number Systems Lab 1.
CS334: MIPS language _Mars simulator Lab 2_1
CS334: Logisim program lab6
COMS 361 Computer Organization
CS 286 Computer Architecture & Organization
Some Assembly
CS 111 – Sept. 16 Machine language examples Instruction execution
Presentation transcript:

CS334: Number Systems&& Mars simulator Lab 1_2

Ins.Ebtesam AL-Etowi Quizzes/Participation/Absence 5% Logisim/MIPS Programming5% CPU Design Project10% Website: cs334

Ins.Ebtesam AL-Etowi Contents: Exercises && HW solution. Mars simulator.

Ins.Ebtesam AL-Etowi Perform the binary subtraction. Did signed overflow occur? determined whether or not overflow occurred Perform the binary addition. Did signed overflow occur? determined whether or not overflow occurred Exercises discarde solution You are given the following two numbers in two ’ s complement representation:

solution Ins.Ebtesam AL-Etowi H.W solution

simulator Mars 4.2 Ins.Ebtesam AL-Etowi Download the Mars simulator from Step 1: Step 2: Launch the Mars simulator. Step 3: Click on the Edit tab on the top left (in this pane, you'll see your assembly language program. Well, after you've created it). Step 4: Go to File and click on New, to start a new program. Step 5: Let's start with a simple program.

Ins.Ebtesam AL-Etowi

MIPS assembly language Ins.Ebtesam AL-Etowi Registers 32 general-purpose registers register preceded by $ in assembly language instruction Program Structure data declaration section followed by program code section

Cont..))MIPS assembly language Ins.Ebtesam AL-Etowi Data Declarations placed in section of program identified with assembler directive.data Code placed in section of text identified with assembler directive.text contains program code (instructions).

Cont..))MIPS assembly language Ins.Ebtesam AL-Etowi Comments anything following # on a line # This comment Data Declarations format for declarations: name: storage_type value(s( example var1:.word 3 # create a single integer variable with initial value 3

Ins.Ebtesam AL-Etowi Arithmetic Instructions most use 3 operands. all operands are registers; no RAM or indirect addressing. operand size is word (4 bytes). Cont..))MIPS assembly language

General Example Ins.Ebtesam AL-Etowi