MIPS instruction encoding

Slides:



Advertisements
Similar presentations
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.
Advertisements

COE 202: Digital Logic Design Signed Numbers
1 Data Representation Patt and Patel Ch. 2 & 9. 2 Data Representation Goal: Store numbers, characters, sets, database records in the computer.Goal: Store.
Lecture 14: Review Intro to IT COSC1078 Introduction to Information Technology Lecture 14 Revision and Review James Harland
Data Representation. CMPE12cGabriel Hugh Elkaim 2 Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Lecture 5.
Lecture Objectives: 1)Define the terms least significant bit and most significant bit. 2)Explain how unsigned integer numbers are represented in memory.
Number Representation
Chapter 2 CSF 2009 The MIPS Assembly Language: Introduction to Binary System.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
An Example Architecture. A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Negative Integer Representation.
Data Representation. Goal: Store numbers, characters, sets, database records in the computer. What we got: Circuit that stores 2 voltages, one for logic.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Computer Organization 1 Data Representation Negative Integers.
ECE 3110: Introduction to Digital Systems Signed Number Conversions and operations.
Number Systems Part 2. Counting in Binary DecimalBinary
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
973cs111_add_posneg.ppt Integers Whole numbers Do NOT contain decimal points (as in money) 43,689 is an integer 43, is NOT an integer (it is floating.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
CSCI206 - Computer Organization & Programming
Floating Points & IEEE 754.
Department of Computer Science Georgia State University
Topic: Binary Encoding – Part 2
David Kauchak CS 52 – Spring 2017
Computer Architecture & Operations I
Binary -ve and +ve numbers!.
Negative Integers Unsigned binary representation can not be used to represent negative numbers. With paper and pencil arithmetic, a number is made negative.
Dr. Clincy Professor of CS
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CSCI206 - Computer Organization & Programming
Computer Science 210 Computer Organization
Numbers in a Computer Unsigned integers Signed magnitude
Morgan Kaufmann Publishers
Addition of Signed Numbers
Goal: use counters to add integers
Computer Architecture & Operations I
Negative Binary Numbers
CSE 102 Introduction to Computer Engineering
MIPS Instructions.
Binary Addition & Subtraction
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
CSCI206 - Computer Organization & Programming
Computer Science 210 Computer Organization
CSCI206 - Computer Organization & Programming
CSCI206 - Computer Organization & Programming
CSCI206 - Computer Organization & Programming
CSCI206 - Computer Organization & Programming
Negative Integer Representation
How to represent signed integers
What two numbers will give you a product of 64 and a quotient of 4?
Dr. Clincy Professor of CS
Computer Architecture & Operations I
1.6) Storing Integer:.
Two’s Complement Shortcut
Unit 18: Computational Thinking
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
Number Systems Lecture 2.
October 17 Chapter 4 – Floating Point Read 5.1 through 5.3 1/16/2019
Number Representation
Storing Negative Integers
Decimal and binary representation systems
Lecture No.5.
COMS 361 Computer Organization
Computer Organization and Assembly Language
OBJECTIVES After reading this chapter, the reader should be able to :
Today Binary addition Representing negative numbers 2.
Presentation transcript:

MIPS instruction encoding j 0x400090 “jump” instruction: 000010 Address 0x400090: 100 0000 0000 0000 1001 0000 Because this address has only 23 bits, we’ll pad the leading bits by three 0’s, making a total of 26 bits 00 0100 0000 0000 0000 1001 0000 4. The entire bit pattern is 000010 00 0100 0000 0000 0000 1001 0000 5. Reorganize in group of 4-bits 0000 1000 0100 0000 0000 0000 1001 0000 6. Hex pattern: 0x08400090

CSCI206 - Computer Organization & Programming Signed Integers zyBook: 5.5

How to actually do add or sub? If the registers r1, r2, hold values 3, -2, how does the operation add $r3, $r1, $r2 work? In general, how does compute do x = 4 + (-3)

How are numbers represented? A 3-bit system would have 8 different values, -4 through 3, how do we operate such that 3 + (-2) == 1? 011 + (???) = 001 -4 -3 -2 -1 1 2 3 ? 000 001 010 011

How to represent signed integers 1. Sign Magnitude The leading bit represents the sign, 0 for positive, 1 for negative, followed by the value (magnitude). 00000000 11111111 -127 00000001 1 11111110 -126 10001001

How to represent signed integers 2. 1’s Complement The leading bit represents the sign, invert the rest of the bits if a negative value. 00000000 11111111 -0 00000001 1 11111110 -1 00001001

How to represent signed integers 3. 2’s Complement The leading bit represents the sign, invert the rest of the bits if a negative value, and add 1 to the last bit. 00000000 11111111 -1 00000001 1 11111110 -2 -9

How to represent signed integers 4. Biased (excess) B = 3 p x 000 -3 001 -2 010 -1 011 100 1 101 2 110 3 111 4 B = 127 p x 00000000 -127 11111111 128 00000001 -126 11111110 127 9 A bias value, B, is usually chosen to be roughly in the middle of the range. The actual value x of a bit pattern p is x = p - B. Given x, the bit pattern should be p = x + B.

Number Encoding Summary Sign Magnitude first digit is sign (0=positive), remaining digits are magnitude 1’s Complement first digit is sign, remaining bits are magnitude. Negative numbers are stored inverted. 2’s Complement Same as 1’st complement, but negative numbers are inverted + 1. Biased redefine zero to be in the middle of the range. The distance from the virtual zero is the magnitude. Stop, do activity