Unit1-fixedpoint-EE357-Nazarian-Fall09

Unit1-fixedpoint-EE357-Nazarian-Fall09 - University...

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

View Full Document Right Arrow Icon
University of Southern California Viterbi School of Engineering EE357 asic Organization of Computer Systems Basic Organization of Computer Systems ixed Point Systems and Arithmetic Fixed Point Systems and Arithmetic References: 1) Textbook ) ark Redekopp’s slide series Shahin Nazarian Fall 2009 2) Mark Redekopp s slide series
Background image of page 1

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

View Full DocumentRight Arrow Icon
Unsigned 2’s Complement Sign and Zero Extension SIGNED AND UNSIGNED S gn an ro E t ns on Hexadecimal Representation SYSTEMS Shahin Nazarian/EE357/Fall 2009 2
Background image of page 2
Data Representation In C/C++ variables can be of different types and sizes Integer Types (signed and unsigned) C Type Bytes Bits Coldfire Name [unsigned] char 1 8 byte [unsigned] short [int] 2 16 word Floating Point Types [unsigned] long [int] 4 32 longword [unsigned] long long [int] 8 64 - C Type Bytes Bits Coldfire Name float 4 32 single Shahin Nazarian/EE357/Fall 2009 double 8 64 double 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
Binary Representation Systems Integer Systems Unsigned Codes Text Unsigned (Normal) binary Signed Signed Magnitude ASCII / Unicode Decimal Codes CD (Binary Coded 2’s complement Excess-N* BCD (Binary Coded Decimal) / (8421 Code) 1 s complement Floating Point For very large and small (fractional) numbers Shahin Nazarian/EE357/Fall 2009 * = Not fully covered in this class 4
Background image of page 4
Unsigned and Signed Variables Unsigned variables use unsigned binary (normal power-of-2 place values) to represent numbers = +147 igned variables use the ’ complement 128 64 32 16 8 4 2 1 1 0 0 1 0 0 1 1 +147 Signed variables use the 2 s complement system (Neg. MSB weight) to represent numbers 10010 01 1 = - 1 0 9 Shahin Nazarian/EE357/Fall 2009 -128 64 32 16 8 4 2 1 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
2’s Complement System MSB has negative weight MSB determines sign of the number 1 = negative 0 = positive To take the negative of a number (e.g. -7 => +7 or +2 => -2), requires taking the complement ’s c mpl m nt f # is f und b flippin bits 2s complement of a # is found by flipping bits and adding 1 1001 110 x = -7 it flip (1’scomp) Shahin Nazarian/EE357/Fall 2009 0110 + 1 0111 Bit flip (1 s comp.) Add 1 -x = -(-7) = +7 6
Background image of page 6
Zero and Sign Extension Extension is the process of increasing the number of bits used to represent a number without Unsigned = Zero Extension (Always add leading 0’s): changing its value 111011 = 00 111011 Increase a 6-bit number to 8-bit number by zero extending 2’s complement = Sign Extension (Replicate sign bit): ub eb yeo eedg 011010 = 00 011010 110011 = 11 110011 pos.
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

Unit1-fixedpoint-EE357-Nazarian-Fall09 - University...

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

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