230Quiz2Notes

230Quiz2Notes - CSE/EEE 230 Click to edit Master subtitle...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style  CSE/EEE230 Fall  CSE/EEE 230 Fall 2009 Quiz 2 Notes Reference: Lecture Notes for Computer Organization  and Design, 4th Edition, 2009.
Background image of page 1

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

View Full DocumentRight Arrow Icon
 CSE/EEE230 Fall 2009 Quiz 2  You are responsible for the following sections in  the text. Chapter 2: 4-7 Reading 2
Background image of page 2
 CSE/EEE230 Fall 2009 Quiz 2  There are 10 types of people; those who get  binary and those who don’t. Signed and Unsigned Numbers §2.4 Signed/Unsigned Numbers 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
 CSE/EEE230 Fall 2009 Quiz 2  Unsigned Binary Integers Given an n-bit number 0 0 1 1 2 n 2 n 1 n 1 n 2 x 2 x 2 x 2 x x + + + + = - - - - n Range: 0 to +2n – 1 n Example n 0000 0000 0000 0000 0000 0000 0000 10112 = 0 + … + 1×23 + 0×22 +1×21 +1×20 = 0 + … + 8 + 0 + 2 + 1 = 1110 n Using 32 bits n 0 to +4,294,967,295 4
Background image of page 4
 CSE/EEE230 Fall 2009 Quiz 2  2s-Complement Signed Integers Bit 31 is sign bit 1 for negative numbers 0 for non-negative numbers –(–2n – 1) can’t be represented Non-negative numbers have the same unsigned  and 2s-complement representation Some specific numbers   0: 0000 0000 … 0000 –1: 1111 1111 … 1111 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
 CSE/EEE230 Fall 2009 Quiz 2  2s-Complement Signed Integers Given an n-bit number 0 0 1 1 2 n 2 n 1 n 1 n 2 x 2 x 2 x 2 x x + + + + - = - - - - n Range: –2n – 1 to +2n – 1 – 1 n Example n 1111 1111 1111 1111 1111 1111 1111 11002 = –1×231 + 1×230 + … + 1×22 +0×21 +0×20 = –2,147,483,648 + 2,147,483,644 = –410 n Using 32 bits n –2,147,483,648 to +2,147,483,647 6
Background image of page 6
 CSE/EEE230 Fall 2009 Quiz 2  To take the 2’s complement of a binary number 1. Convert the magnitude to binary 2. Take the 1’s complement 3. Add 1 to the 1’s complement value Example: What is -9 as a two’s complement binary number? 9 = 00001001 1’s complement = 11110110 2’s complement = 11110111 Determining 2’s complement 7
Background image of page 7

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

View Full DocumentRight Arrow Icon
 CSE/EEE230 Fall 2009 Quiz 2  Hexadecimal Base 16 Compact representation of bit strings 4 bits per hex digit 0 0000 4 0100 8 1000 c 1100 1 0001 5 0101 9 1001 d 1101 2 0010 6 0110 a 1010 e 1110 3 0011 7 0111 b 1011 f 1111 n Example: eca8 6420 n 1110 1100 1010 1000 0110 0100 0010 0000 8
Background image of page 8
 CSE/EEE230 Fall 2009 Quiz 2  What is the hexadecimal equivalent number for  each of the following decimal numbers?   Represent the answer as 1 byte. 23 -9 Practice 9
Background image of page 9

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

View Full DocumentRight Arrow Icon
 CSE/EEE230 Fall 2009 Quiz 2  What is the decimal equivalent number for each of  the following hexadecimal numbers?  Assume  two’s complement representation. 16 =  1*16^1 + 6*16^0 = 22 11101010 + 00010101+       1 => 00010110  => -22 Practice 10
Background image of page 10
 CSE/EEE230 Fall 2009 Quiz 2  Sign Extension Representing a number using more bits Preserve the numeric value In MIPS instruction set addi : extend immediate value lb lh : extend loaded byte/halfword beq bne : extend the displacement Replicate the sign bit to the left c.f. unsigned values: extend with 0s Examples: 8-bit to 16-bit 11
Background image of page 11

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

View Full DocumentRight Arrow Icon
 CSE/EEE230 Fall 2009 Quiz 2 
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 65

230Quiz2Notes - CSE/EEE 230 Click to edit Master subtitle...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online