You are on page 1of 12

# 6-2

## Represent each of the following signed decimal numbers in the 2s complement

system.Use a total of eight bits including the sign bit.
a.

+32

e.

+127

i.

-1

m.

+84

b.

-14

f.

-127

j.

-128

n.

+3

c.

+63

g.

+89

k.

+169

o.

-3

d.

-104

h.

-55

l.

p.

-190

a)Since the number is positive,the magnitude (32) will be represented in its
true-magnitude form,that is, 32= 100000 . Attaching the sign bit of 0, we have
+32= 00100000
b)Since the number is negative ,the magnitude (14) must be represented in 2s
complement form:
+14= 00001100
11110011
1 +
-14= 11110100
c) +63 = 00111111

d) +104 =
+104 =

01101000
10010111
1+

-104 =

10011000

e) +127 = 01111111
f) -127 =
-127 =

01111111
10000000
1+

-127 =

10000001

g) +89 = 01010011
h) +55:
+55

00110111
11001000
1+

-55

11001001

## i) The decimal value 1 can be represented in binary using only two

bits.However,the problem statement requires a eight-bit magnitude
preceded by a sign bit.
+1

00000001
11111110
1 +

-1

11111111

10000000

J) +128 :
+128

01111111
1+
-128 =

10000000

k) +169= 01010111
l) 0
0

00000000
11111111
1+

00000000

m)

+84= 01010100

n)

+3= 00000011

+3 =

00000011
11111100
1 +

-3

= 11111101

+190 =

01000010
10111101
1+

-190 =

10111110

6-3
Each of the following numbers represent a signed decimal number in the 2s
complement system.Determine the decimal value in each case.(Hint: Use negation
to convert negative numbers to positive)
a.

01101

e.

01111111

i.

01100011

b.

11101

f.

10000000

j.

11011001

c.

01111011

g.

11111111

d.

10011001

h.

10000001

a)The sign bit is 0,so the number is positive and the other four bits represent the
true

## That is, 1101=13.

Thus,the decimal of number is +13
b)The sign bit of 11101 is a 1,so we know the number is negative,but,we cant tell
what the

magnitude is.

convert it

## to its positive equivalent.

11101
00010
+

00011

(+29)

Since the result of negation is 00011= +29, the original number 11101 must
be equivalent to -29.

c) 01111011= +123
d) Follow the same procedure as in (b):
10011001
01100110
+

01100111

(+153)

,10011001= -153
e) 01111111=+127
f) Follow the same procedure as in (b):
10000000

(-128)

01111111
+

10000000

(-128)

11111111

(-253)

00000000
+

00000001

(+253)

## h) Follow the same procedure as in (b):

10000001

(-129)

01111110
+

01111111

(+129)

11011001

(-217)

a) 01100011= +99
b) 11011001

00100110
+

00100111

(+217)

6-4
(a).What range of signed decimal values can be represented using 12 bits including
the sign bit ?
(b).How many bits would be required to represent decimal numbers from -32.768
to +32.767 ?

a) Since the MSB is to be used as the sign bit, there are twelve bits for the
magnitude.
The largest negative value is
1000000000000 = -212
= - 4096
The largest positive is
0111111111111= +212 1 = +4095
Thus, the range is -4096 to +4095 , this is a total of 8192 different values,
including zero.
Alternatively,since there are twelve magnitude bits (N=12),then there are
2+1 = 213 = 8192 different values
b) -32.768 = 1000000000000000 = 215
To
+32.767 = 0111111111111111= +215
Thus,the range is -32.768 to +32.767 have 15 bits.

6-6
Represent each of the following decimal values as an 8-bit signed binary value.
Then negate each one.
a. +73

b. -12

c. +15

a) +73 =
+73 = 01001001
10110110
1+
-73= 10110111
b) -12 =
-12 = 11110100
00001011
1+
+12 = 00001100
c) +15=
+15 = 00001101
11110010
1 +
-15 =
d) -1=

11110011

d. -1

e. -128

f.+127

-1 = 11111111
00000000
1 +
+1 = 00000001

e) -128 =
-128 = 10000000
01111111
1 +
+128 = 10000000

f) +127 =
+127 = 01111111
10000000
1

-127 = 10000001

6-7
What is the range of the unsigned decimal values that can be represented in 1bits?
What is the range of signed decimal values using the same number of bits?

-A byte is 10 bits. Since we are interested in unsigned numbers here,there is no
sign bit, so all of the ten bits are used for magnitude. Therefor the values will
range from
0000000000 = 0
To
1111111111 = 1023
This is a total of 1024 different values,which we could predicted since 210 =
1024.
-Since the MSB is to be used as the sign bit,there are nine bits for the
magnitude

## 1000000000= -29 = - 512

The largest positive is :
0111111111= +29 1 = +511
Thus, the range is -512 to +511 ; this is a total of 1024 different values,including
zero. Alternatively,since there are nine magnitude bits (N=9),then there are 2+1 =
210 = 1024 different values.