
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The IEEE floating point representation
Typology: Lecture notes
1 / 32
This page cannot be seen from the preview
Don't miss anything!

























◦ (^) ASCII (American Standard Code for Information Interchange) ◦ (^) Unicode ◦ (^) EBCDIC (Extended Binary Coded Decimal Interchange Code). The Alphanumeric Representation
The Decimal Representation Decimal BCD 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001
(^) Binary numbers may either signed or unsigned (^) Oddly, CPU performs arithmetic and comparison operations for both type equally well, without knowing which type it’s operating on. (^) An unsigned numbers : ◦ numbers with only positive values ◦ for 8-bit storage location : store unsigned integer value between 0 - 255 ◦ for 16-bit storage location : store unsigned integer value between 0 - 65535 (^) Unsigned number can be converted directly to binary numbers and processed without any special care Signed and Unsigned Numbers
For negative numbers , there are several ways used to represent it in binary form, depending on the process take place : i. Sign-and-magnitude representation ii. 1’s complement representation iii. 2’s complement representation Signed and Unsigned Numbers
Example 1 : Sign-and-Magnitude
(^) Example 2 : What is the sign-and-magnitude representation of the decimal numbers –31 and +31 if the basic unit is a byte? ◦ 3110 = 11111 2 ◦ Unit is a byte = 8 bits Sign-and-Magnitude
Example 4 : What is the decimal equivalent value of the sign- and -magnitude binary sequence 1011 1001? Sign-and-Magnitude
2
10
2
10
◦ (^) using the usual conventions of binary arithmetic ◦ (^) if both have same sign : magnitude are added and the same sign copied ◦ (^) if the sign different : number that has smaller magnitude is subtracted from the larger one. The sign is copied from the larger magnitude. Sign-and-Magnitude
(^) Example 6 : What is the decimal value of the sum of the binary numbers 10110011 and 00010110 if they are represented in sign-and- magnitude? Assume that the basic unit is the byte. ◦ (^) Different signs : Larger magnitude - smaller magnitude ◦ (^) Larger magnitude: 1011 0011 ◦ (^) Smaller magnitude : 0001 0110 Sign-and-Magnitude 0 2 0 1 2 Sign is negative 111012 = 29 10 1001 1101 2 = - 29
(^) Most popular among computer manufacturers since it does not present any of the problems of the sign-and-magnitude or 1’s complement. (^) Positive numbers : using similar procedure as sign-and-magnitude (^) Given n bits, the range of numbers that can be represented in 2’s complement is (–(2n^ )) to (2n-1^ –1) (^) Notice that the range of negative numbers is one larger than the range of the positive values 2’S Complement Convention 0111 1111 (127) 0000 0000 (0) 1111 1111 (-1) 1000 0000 (-128) ( 2 n- –1) - ( n )