# 13-shifters - ECE2030 Introduction to Computer Engineering...

This preview shows pages 1–3. Sign up to view the full content.

9/28/09 1 1 ECE2030 Introduction to Computer Engineering Lecture 11: Building Blocks for Combinational Logic – Shifters 2 Basic Shifting 3 Logical Shift • Shift Left • MSB: Shifted out • LSB: Shifted in with a “0” • Examples: • (11001011 << 1) = 10010110 • (11001011 << 3) = 01011000 • Shift right • MSB: Shifted in with a “0” • LSB: Shifted out • Examples: (Some ISA use triple “>” for logical right shift) • (11001011 >>> 1) = 01100101 • (11001011 >>> 3) = 00011001 4 Arithmetic Shift • Shift left • MSB: Shifted out, however, be aware of overflow /underflow • LSB: Shifted in with a “0” • Examples: • (1100 << 1) = 1000 • (1100 << 3) = 0000 (Incorrect!) Underflow • Shift right • MSB: Retain “sign bit” • LSB: Shifted out • Examples: • (1100 >> 1) = 1110 (Retain sign bit) • (1100 >> 3) = 1111 ( -4/8 = -1 ) Floor value of -0.5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
9/28/09 2 5 Examples of Arithmetic Shift 1111 1011 Arithmetic shift right by 1 1111 1101 1111 1011 Arithmetic shift left by 1 1111 0110 1011 1111 (= -65) Arithmetic shift left by 1 (i.e. x2) 0111 1110 (= +126 -130) Underflow ! 0100 0010 (= +66) Arithmetic shift left by 1 (i.e. x2) 1000 0100 (= -124 +132) Overflow !
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/24/2009 for the course ENGINEERIN 4283 taught by Professor Smith during the Spring '09 term at American InterContinental University Dunwoody.

### Page1 / 6

13-shifters - ECE2030 Introduction to Computer Engineering...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online