Address alignment When a word (4-bytes) is loaded or stored the memory address must be a multiple of four. This is called an alignment restriction. Addresses.

Slides:



Advertisements
Similar presentations
1 Instruction Set Principles and Examples 游象甫. 2 Outline Introduction Classifying instruction set architectures Memory addressing Type and size of operands.
Advertisements

1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
Microprocessors General Features To be Examined For Each Chip Jan 24 th, 2002.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
ARM programmer’s model and assembler Embedded Systems Programming.
1 RISC Machines l RISC system »instruction –standard, fixed instruction format –single-cycle execution of most instructions –memory access is available.
ECE 4436ECE 5367 ISA I. ECE 4436ECE 5367 CPU = Seconds= Instructions x Cycles x Seconds Time Program Program Instruction Cycle CPU = Seconds= Instructions.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
Overview of Microprocessors
MIPS assembly. Computer What’s in a computer? Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
Instruction Set Architecture
ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kong
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 15 & 16 Stacks, Endianness Addressing Modes Course Instructor: Engr. Aisha Danish.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Instruction Set Architecture Basics. Our Progress Done with levels 0 and 1 Seen multiple examples of level 2 Ready for ISA general principles.
COMPUTER ORGANIZATION & ARCHITECTURE A digital computer solves problems by executing a sequence of instructions called a program Ioan Despi.
Working With Main Memory. Why Main Memory Register space limited Used for communication.
CSCI 136 Lab 1: 135 Review.
1 Computer Architecture COSC 3430 Lecture 3: Instructions.
Lecture 8. MIPS Instructions #2 – Memory Access (Load/Store) Instructions Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer.
Lecture 4. MIPS Instructions #2 Memory Access (Load/Store) Instructions Prof. Taeweon Suh Computer Science Education Korea University ECM534 Advanced Computer.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Computer Organization – Memory Access David Monismith Jan. 30, 2015 Based upon notes by Dr. Bill Siever and the Patterson and Hennessy Text.
Computer Architecture and Organization
Computer Architecture EKT 422
Lecture 10: MIPS Simulator Today’s topic –SPIM Simulator Readings –Appendix B 1.
Assembly language: arithmetic and load/store instructions Ellen Spertus MCS 111 September 17, 2002.
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
MIPS Instruction Set Architecture Prof. Sirer CS 316 Cornell University.
MIPS assembly. Computer  What’s in a computer?  Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
Byte Addressability Bytes are always 8 bits Word length typically ranges from 16 to 64 bits. Memory location assignments refer to successive byte locations.
Memory, Bits, & Bytes. Memory Part of the computer where programs and data are stored. Read and written (changed). Bit – Binary digit – Basic unit of.
Lecture 12: 10/3/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Memory Access Instructions Load and Store Addressing Modes Memory Addressing. Base addressing mode. Load byte and store byte: lb, lbu, sb Address alignment.
MIPS Arithmetic is 32 bits
Computer Architecture & Operations I
Computer Architecture & Operations I
Big-Endians Little-Endians and Bi-Endians
Data representation How do we represent data in a digital system?
Memory Access Instructions
A Closer Look at Instruction Set Architectures
An example of multiplying two numbers A = A * B;
MIPS Assembly.
CSCI206 - Computer Organization & Programming
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
CSCI206 - Computer Organization & Programming
The University of Adelaide, School of Computer Science
MIPS assembly.
MIPS Instruction Encoding
1 Overview of Microprocessors A. Parveen. 2 Lecture overview Introduction to microprocessors Instruction set architecture Typical commercial microprocessors.
MIPS Instruction Encoding
Computer Instructions
Computer Architecture
September 17 Test 1 pre(re)view Fang-Yi will demonstrate Spim
What is Computer Architecture?
Data representation How do we represent data in a digital system?
Introduction to Microprocessor Programming
COMS 361 Computer Organization
What is Computer Architecture?
What is Computer Architecture?
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
January 16 The books are here. Assignment 1 now due Thursday 18 Jan.
Data representation How do we represent data in a digital system?
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
CSE378 Introduction to Machine Organization
Presentation transcript:

Address alignment When a word (4-bytes) is loaded or stored the memory address must be a multiple of four. This is called an alignment restriction. Addresses that are a multiple of four are called word aligned (start with 0,4,8,C). General Purpose Register Not word aligned What looks like the binary address rightmost part for word aligned addresses ?

Endianness  A load word or store word instruction uses only one memory address.  The lowest address of the four bytes is used for the address of a block of four contiguous bytes.  How is a 32-bit pattern held in the four bytes of memory?  A choice has to be made about which byte of memory gets what part of the pattern.  There are two ways that computers commonly do this:  A load word or store word instruction uses only one memory address.  The lowest address of the four bytes is used for the address of a block of four contiguous bytes.  How is a 32-bit pattern held in the four bytes of memory?  A choice has to be made about which byte of memory gets what part of the pattern.  There are two ways that computers commonly do this: General Purpose Register

Big Endian and Little Endian  Big Endian Byte Order: The most significant byte (the "big end") of the data is placed at the lowest addressed byte.  Little Endian Byte Order: The least significant byte (the "little end") of the data is placed at the lowest addressed byte.  Big Endian Byte Order: The most significant byte (the "big end") of the data is placed at the lowest addressed byte.  Little Endian Byte Order: The least significant byte (the "little end") of the data is placed at the lowest addressed byte General Purpose Register Big Endian Order

 Say that the 32-bit pattern 0x is at address 0x  The most significant byte is 0x12;  the least significant is 0x78.  Here are the two byte orders: Big, Little endian example Lowest Address The Most Significant byte This is memory, not registers

 Within a byte, for all processors, bit 7 is the most significant bit.  So the big end byte looks the same for both byte orderings. Usually in printed material this bit is shown at the left, as in Bit Order

Byte Order of MIPS and SPIM Intel 80x86: little-endian processor family Macintosh OS runs on computers based on big-endian processors. IBM z/Architecture – Big endian More and more architectures use Bi-Endian hardware Allow switchable endianness ARM versions 3 and above, PowerPC,, SPARC V9, MIPS PA-RISC, SuperH SH-4 and IA-64, Alpha The SPIM simulator uses the byte ordering of the computer it is running on.

Load Word lw $10 $ opcode base dest offset lw $8, 0x60($10) The instruction immediately after a lw instruction should not use the register that is being loaded Which type of instruction is this ?

Store Word Instruction

 A MIPS halfword is two bytes.  Halfword addresses must be halfword aligned.  Attempting to load a halfword from an unaligned address will cause a trap. Loading Halfwords

Address alignment for halfword When a halfword (2-bytes) is loaded or stored the memory address must be a multiple of 2. Addresses that are a multiple of 2 are called halfword aligned (start with 0,2,4,…). General Purpose Register What looks like the binary address rightmost part for halfword aligned addresses ?

Storing Halfwords