ARM Shifts, Multiplies & Divide??. MVN Pseudo Instructions Pseudo Intruction: Supported by assembler, not be hardware.

Slides:



Advertisements
Similar presentations
ARM versions ARM architecture has been extended over several versions.
Advertisements

Embedded Systems Programming
Overheads for Computers as Components 2nd ed.
Embedded Systems Architecture
Integer Arithmetic: Multiply, Divide, and Bitwise Operations
© 2000 Morgan Kaufman Overheads for Computers as Components ARM instruction set zARM versions. zARM assembly language. zARM programming model. zARM memory.
Chapter 2 Instruction Sets 金仲達教授 清華大學資訊工程學系 (Slides are taken from the textbook slides)
Machine Instructions Operations
1 ECE 5465 Advanced Microcomputers Group 11: Brian Knight Benjamin Moore Alex Williams.
Embedded System Design Center ARM7TDMI Microprocessor Data Processing Instructions Sai Kumar Devulapalli.
COMP3221 lec10-logical-II&mul.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 10: C/Assembler Logical and Shift – II & Multiplication.
Jan 28, 2004Blackfin Compute Unit REV B A comparison of DSP Architectures BlackFin ADSP-BFXXX Compute Unit Based on a ENEL white paper prepared by.
COMP3221 lec9-logical-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 9: C/Assembler Logical and Shift - I
Binary Logic (review) Basic logical operators: (Chapter 7 expanded)
Modified from the notes by
COMP3211 lec22-fraction.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 22 : Fractions September,
Instruction Set Architecture & Design
Thumb Data Processing Instructions and Breakpoint Instructions 02/18/2015 Mingliang Ge Yi (Leo) Wu Xinuo (Johnny) Zhao.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Jan 28, 2004Blackfin Compute Unit REV B ENEL DSP Architectures BlackFin Compute Unit.
Lecture Objectives: 1)Explain the relationship between addition and subtraction with twos complement numbering systems 2)Explain the concept of numeric.
ARM Instructions I Prof. Taeweon Suh Computer Science Education Korea University.
Embedded System Design Center Sai Kumar Devulapalli ARM7TDMI Microprocessor Thumb Instruction Set.
Topic 8: Data Transfer Instructions CSE 30: Computer Organization and Systems Programming Winter 2010 Prof. Ryan Kastner Dept. of Computer Science and.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
BITWISE OPERATIONS – Microprocessor Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Lecture 2: Advanced Instructions, Control, and Branching EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer.
Unit-2 Instruction Sets, CPUs
Lecture 4: Load/Store Architectures CS 2011 Fall 2014, Dr. Rozier.
Arithmetic and Logic Chapter 5
CDA 3101 Spring 2016 Introduction to Computer Organization
COMP3221: Microprocessors and Embedded Systems--Lecture 10 1 COMP3221: Microprocessors and Embedded Systems Lecture 10: Shift and Bit-set Instructions.
Addition Multiplication Subtraction Division. 1.If the signs are the same, add the numbers and keep the same sign = = If the.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Integer Multiplication and Division ICS 233 Computer Architecture & Assembly Language Prof. Muhamed Mudawar College of Computer Sciences and Engineering.
Binary Logic (review) Basic logical operators:(Chapter 7 expanded) NOT AND – outputs 1 only if both inputs are 1 OR – outputs 1 if at lest one input is.
Computer Architecture & Operations I
Combinational Circuits
ARM Intro.
Computer Architecture & Operations I
Chapter 15: Higher Level Constructs
Chapter 5 Integer Arithmetic.
ARM Registers Register – internal CPU hardware device that stores binary data; can be accessed much more rapidly than a location in RAM ARM has.
The Cortex-M3/m4 Embedded Systems: Cortex-M3/M4 Instruction Sets
EE 319K Introduction to Embedded Systems
Processor Instructions set. Learning Objectives
Morgan Kaufmann Publishers
March 2006 Saeid Nooshabadi
CDA 3101 Summer 2007 Introduction to Computer Organization
68000 Arithmetic Instructions
ALU Design: Shifter Details
MISP Assembly.
The University of Adelaide, School of Computer Science
Topic 6: Bitwise Instructions
Multiplication by small constants (pp. 139 – 140)
Arithmetic and Logic Chapter 5
Table 3‑1: Unsigned Data Range Summary in ARM
The ARM Instruction Set
Branching instructions
Overheads for Computers as Components 2nd ed.
MIPS Assembly.
Computer Architecture
Immediate data Immediate operands : ADD r3, r3, #1 valid ADD r3, #1,#2 invalid ADD #3, r1,r2 invalid ADD r3, r2, #&FF ( to represent hexadecimal immediate.
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
MICROCONTROLLERS AND EMBEDDED SYSTEMS Unit – 4 : ARM / Thumb Instruction set GEC
Shift and Rotate Instructions.
微處理機 Microprocessor (100上) ARM 內核嵌入式SOC原理
CS-401 Computer Architecture & Assembly Language Programming
Arithmetic and Logic Chapter 3
Presentation transcript:

ARM Shifts, Multiplies & Divide??

MVN

Pseudo Instructions Pseudo Intruction: Supported by assembler, not be hardware

Pseudo Instructions Pseudo Intruction: Supported by assembler, not be hardware

Pseudo Instructions Pseudo Intruction: Supported by assembler, not be hardware Replaced with other instruction(s)

Rotate & Shifts

Rotate Rotate : Move bits, overflow wraps around – Rotate Right 4:

Rotate Rotate Right: RORrd, rs, #___ rd  rs Shifted right # bits ROR rd, rs, rm rm

Rotate Rotate Left: Just rotate right by (32 – x bits) Left 12 bits = Right 20 bits

Logical Shift Logical Shift: Move bits, fill gaps with 0, drop overflow – Left Shift 4: – Right Shift 4:

LSL, LSR Logical Shift Left/Right LSLrd, rs, #___ rd  rs Shifted left # bits LSRrd, rs, #___ right LSLrd, rs, rm rd  rs Shifted left rm bits LSRrd, rs, rm right

Arithmetic Shift Arithmetic Shift Right: Move bits right, fill gaps with most significant bit, drop overflow – ASR 4 on Positive: – ASR 4 on Negative:

Arithmetic Shift Arithmetic Shift Right ASRrd, rs, #___ rd  rs Shifted right # bits ASRrd, rs, rm rm

Shifting & Math Shifting right N bits divides by 2 N

Shifting & Math Shifting left N bits multiplies by 2 N

Shift Architecture Shifter processes second operand to ALU

Shift Architecture Can specify a shift to apply to operand2 in other instructions: mov op1, op2, SHIFT_TYPE SHIFT_AMT

Shift Architecture Shifts are Pseudo Instructions implemented with MOV:

Shift Architecture Most data instructions support shifts operation dest, op1, op2, SHIFT_TYPE SHIFT_AMT

Multiply

Multiplier hardware separate from ALU

Basic Multiply MUL : Multiply MULrd, rs, rm rd  rs * rm No shifts or constants for rm!!!

Multiply & Accumulate MLA : Multiply with accumulate MLArd, rs, rm, rn rd  (rs * rm) + rn No shifts or constants Add results of multiply to r11

Divide

Multiply Divide??

Multiply Beefier ARM processors support – SDIV : Signed division SDIVrd, rs, rm rd  rs / rm – UDIV : Unsigned division UDIVrd, rs, rm rd  rs / rm

Multiply Divide?? – Powers of 2 : Shift! – Write a function to divide via subtraction – Do insane bit twiddling Like This Like This

High Level Languages

Shifts High level languages often provide bit shift Right shift may be arithmetic or logical!