Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Express the following expressions in 4-bit sign-magnitude format and then cal

ID: 3900712 • Letter: 1

Question

1.       Express the following expressions in 4-bit sign-magnitude format and then calculate the answers. Indicate if overflow.

5 + 2 = 0101 + 0011=

4 + 4

-5 + -2

-4 + -4

5 + -2

4 + -4

-5 + 2

-1 + 1

5 – 2

4 - 4

-1 - -1

0 - 1

3.       Demote the following 8-bit unsigned integers to 4-bit representation. Indicate if chopping is not possible without losing accuracy.

00000001

10000001

00010001

10001010

10000111

Signed Integer – Two’s Complement Representation

5.       What is the largest number in 8-bit Two’s compliment integer representation?

7.       What is the smallest number in 8-bit Two’s compliment integer representation?

5 + 2 = 0101 + 0011=

4 + 4

-5 + -2

-4 + -4

5 + -2

4 + -4

-5 + 2

-1 + 1

5 – 2

4 - 4

-1 - -1

0 - 1

Explanation / Answer

1.

In sign magnitude representation , most significant bit is the sign bit (0-positive and 1- negative)and rest of the bits represent the number

3. 8 bit unsigned integers means that there is no sign bit and all the 8 bits are used to represent a number

00000001 : 0001 (4 bit representation)

10000001 : We cant chop this number to 4 bits from the begining or the end without loosing accuracy (bits having 1 value).

00010001 : We cant chop this number to 4 bits from the begining or the end without loosing accuracy (bits having 1 value).

10001010 : We cant chop this number to 4 bits from the begining or the end without loosing accuracy (bits having 1 value).

10000111: We cant chop this number to 4 bits from the begining or the end without loosing accuracy (bits having 1 value).

5. We convert a negative binary number to 2's complement by reversing all the bits in the number and adding 0000 0001 to the number.

For positive 8 bit numbers , most significant bit is the sign bit and the rest represent the number. Thus the greatest number possible is = 011111111 = 127 in decimal

Hence the largest 8 bit 2s complement number is 01111111 i.e. 127 in decimal

the smallest 2s complement 8 bit number would be 10000000. this numer in decimal would be 01111111+00000001 = 10000000 = -128 in decimal. Thus the smallest 2s complement number is -128

Question 4 bit sign magnitude format Result in 4 bit sign magnitude 5+2 0101+0010 0111 (7) 4+4 0100+0100 overflow as the result is +8 i.e. 01000(5 bits) -5+-2 1101 + 1010 1111 (-7) -4+-4 1100+1100 overflow as the result is -8 i.e. 11000(5 bits) 5+-2 0101+1010 0011 (3) 4+-4 0100+1100 0000 (0) -5+2 1101+0010 1011 (-3) -1+1 1001+0001 0000 (0) 5-2 0101-0010 0011 (3) 4-4 0100-0100 0000 (0) -1 - -1 1001 - 1001 1010 0-1 0000 - 0001 1001