machine level representation of data, Lecture notes of Computer Architecture and Organization

The IEEE floating point representation

Typology: Lecture notes

2017/2018

Uploaded on 02/07/2018

ciuciu1985
ciuciu1985 🇮🇹

4

(1)

2 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MACHINE LEVEL
REPRESENTATION OF DATA
PART 3
THE Alphanumeric REPRESENTATION
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download machine level representation of data and more Lecture notes Computer Architecture and Organization in PDF only on Docsity!

MACHINE LEVEL

REPRESENTATION OF DATA

PART 3

THE Alphanumeric REPRESENTATION

The data entered as characters, number

digits, and punctuation are known as

alphanumeric data.

3 alphanumeric codes are in common use.

◦ (^) ASCII (American Standard Code for Information Interchange) ◦ (^) Unicode ◦ (^) EBCDIC (Extended Binary Coded Decimal Interchange Code). The Alphanumeric Representation

THE DECIMAL

REPRESENTATION

BCD (Binary

Coded Decimal)

is often used to

represent

decimal number

in binary.

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

  • 0010 0101 (+37) 0000 0000 0000 0001 (+1) 0111 1111 1111 1111 (+32767)
  • 1010 0101 (-37) 1000 0000 0000 0001 (-1) 1111 1111 1111 1111 (-32767)

 (^) 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

  • (^31) = 1 0 0 1 1 1 1 1

 Example 4 : What is the decimal equivalent value of the sign- and -magnitude binary sequence 1011 1001? Sign-and-Magnitude

Sign is negative

2

10

2

10

Addition of 2 numbers in sign-and-

magnitude :

◦ (^) 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

1’S Complement

Convention

2’S Complement

Convention

 (^) 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 )