ALU Design: Shifter Details

Slides:



Advertisements
Similar presentations
Other Gate Types COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

Integer Arithmetic: Multiply, Divide, and Bitwise Operations
CS/COE0447 Computer Organization & Assembly Language
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
Functions and Functional Blocks
Lec 12Systems Architecture1 Systems Architecture Lecture 12: Design of the MIPS ALU Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some or all.
COE 405 Design and Synthesis of DataPath Controllers Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals.
Arithmetic for Computers
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
Informationsteknologi Saturday, September 29, 2007 Computer Architecture I - Class 41 Today’s class More assembly language programming.
Data Representation COE 205
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Integer Multiplication and Division
Combinational Comparators
Data Representation ICS 233
Datapath Functional Units Adapted from David Harris of Harvey Mudd College.
CMPE 325 Computer Architecture II Cem Ergün Eastern Mediterranean University Integer Representation and the ALU.
Integer Multiplication and Division
Lecture 4 Chap 5 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
1 Arithmetic I Instructor: Mozafar Bag-Mohammadi Ilam University.
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Addition, Subtraction, Logic Operations and ALU Design
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
ECE/CS 552: Arithmetic I Instructor:Mikko H Lipasti Fall 2010 University of Wisconsin-Madison Lecture notes partially based on set created by Mark Hill.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Computer Arthmetic Chapter Four P&H. Data Representation Why do we not encode numbers as strings of ASCII digits inside computers? What is overflow when.
Computer Organization and Design Arithmetic & Logic Circuits Montek Singh Nov 2, 2015 Lecture 11.
Csci136 Computer Architecture II Lab#5 Arithmetic Review ALU Design Ripple Carry Adder & Carry lookahead HW #4: Due on Feb 22, before class Feb.16, 2005.
E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals 2.6 E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals.
Integer Multiplication and Division ICS 233 Computer Architecture & Assembly Language Prof. Muhamed Mudawar College of Computer Sciences and Engineering.
MIPS Arithmetic and Logic Instructions
ARM Shifts, Multiplies & Divide??. MVN Pseudo Instructions Pseudo Intruction: Supported by assembler, not be hardware.
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 6, 2010.
Data Representation COE 308 Computer Architecture
Combinational Circuits
Data Representation ICS 233
CS 230: Computer Organization and Assembly Language
Integer Multiplication and Division
COMPUTER ARCHITECTURE & OPERATIONS I
Floating Point Operations
Combinational ALU Constructive Computer Architecture Arvind
Computer Organization and Design Arithmetic & Logic Circuits
CDA 3101 Summer 2007 Introduction to Computer Organization
Instructors: Randy H. Katz David A. Patterson
ECE/CS 552: Arithmetic and Logic
Data Representation COE 301 Computer Organization
King Fahd University of Petroleum and Minerals
Arithmetic Where we've been:
MISP Assembly.
King Fahd University of Petroleum and Minerals
Systems Architecture I
Computer Architecture & Operations I
King Fahd University of Petroleum and Minerals
EEL 3705 / 3705L Digital Logic Design
The University of Adelaide, School of Computer Science
Lecture 11: Hardware for Arithmetic
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Instructor: Mozafar Bag-Mohammadi University of Ilam
Data Representation ICS 233
Combinational Circuits
Logical instructions And rd rs rt Nor rd rs rt Or rd rs rt
MIPS Assembly.
MIPS assembly.
Logical Instructions And rd rs rt Nor rd rs rt Or rd rs rt
MIPS Arithmetic and Logic Instructions
MIPS Arithmetic and Logic Instructions
Data Representation COE 308 Computer Architecture
Single Cycle Processor Design
Arithmetic and Logic Circuits
Presentation transcript:

ALU Design: Shifter Details COE 301 Computer Organization ICS 233 Computer Architecture and Assembly Language Dr. Marwan Abu-Amara College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals [Adapted from slides of Dr. M. Mudawar and Dr. A. El-Maleh, KFUPM]

Building a Multifunction ALU 1 2 3 Logic Unit AND = 00 OR = 01 NOR = 10 XOR = 11 Operation Logical Shifter SLL = 00 SRL = 00 SRA = 01 ROR = 11 Shift/Rotate A 32 B d e r c0 ADD = 0 SUB = 1 Arithmetic Shift = 00 SLT = 01 Arith = 10 Logic = 11 ALU Selection Shift Amount ALU Result 5 sign ≠ zero overflow SLT: ALU does a SUB and check the sign and overflow

Details of the Shifter Implemented with multiplexers and wiring Shift Operation can be: SLL, SRL, SRA, or ROR Input Data is extended to 63 bits according to Shift Op The 63 bits are shifted right according to S4S3S2S1S0 S0 32 31 1 split 33 S1 2 35 S2 4 39 S3 8 47 S4 16 mux 63 Shift Right 0 or 16 bits 0 or 8 bits 0 or 4 bits 0 or 2 bits 0 or 1 bit Extender Shift op Data Data_out 5 sa SLL

Details of the Shifter – cont’d Input data is extended from 32 to 63 bits as follows: If shift op = SRL then ext_data[62:0] = 031 || data[31:0] If shift op = SRA then ext_data[62:0] = data[31]31 || data[31:0] If shift op = ROR then ext_data[62:0] = data[30:0] || data[31:0] If shift op = SLL then ext_data[62:0] = data[31:0] || 031 For SRL, the 32-bit input data is zero-extended to 63 bits For SRA, the 32-bit input data is sign-extended to 63 bits For ROR, 31-bit extension = lower 31 bits of data Then, shift right according to the shift amount As the extended data is shifted right, the upper bits will be: 0 (SRL), sign-bit (SRA), or lower bits of data (ROR)

Implementing Shift Left Logical The wiring of the above shifter dictates a right shift However, we can convert a left shift into a right shift For SLL, 31 zeros are appended to the right of data To shift left by 0 is equivalent to shifting right by 31 To shift left by 1 is equivalent to shifting right by 30 To shift left by 31 is equivalent to shifting right by 0 Therefore, for SLL use the 1’s complement of the shift amount ROL is equivalent to ROR if we use (32 – rotate amount) ROL by 10 bits is equivalent to ROR by (32–10) = 22 bits Therefore, software can convert ROL to ROR