DIGITAL
ARITHMETIC
1. Represent
each of the following signed decimal
numbers I the 2’s-complement system. Use a total of eight bits including the
sign bit.
a) +32
Completion : 00100000 = +32
C-I => 11011111
C-II
=> 1 +
11100000
= -32
b) -14
Completion
: 00001110= +14
C-I => 11110001
C-II=> 1 +
11110010=
-14
C-I
=> 00001101
C-II
=> 1 +
00001110=
+14
c) +63
Completion
: 00111111= +63
C-I
=> 11000000
C-II
=> 1 +
11000010=
-63
d) -104
Completion
: 01101000= +104
C-I => 10010111
C-II=> 1 +
10011000=
-104
C-I
=> 01100111
C-II
=> 1 +
01101000=
+104
e) +127
Completion
: 01111111= +127
C-I
=> 10000000
C-II
=> 1 +
10000001=
-127
f) -127
Completion
: 01111111= +127
C-I
=> 10000000
C-II
=> 1 +
10000001=
-127
C-I
=> 01111110
C-II
=> 1 +
01111111=
+127
g) +89
Completion
: 01011001= +89
C-I
=> 10100110
C-II
=> 1 +
10100111=
-89
h) -55
Completion
: 00110111= +55
C-I
=> 11001000
C-II
=> 1 +
11001001=
-55
C-I
=> 00110110
C-II
=> 1 +
00110111=
+55
i)
-1
Completion
: 00000001= +1
C-I
=> 11111110
C-II
=> 1 +
11111111=
-1
C-I
=> 00000000
C-II
=> 1 +
00000001=
+1
j)
-128
Completion
: 10000000= +128
C-I
=> 01111111
C-II
=> 1 +
10000000=
-128
C-I
=> 01111111
C-II
=> 1 +
10000000=
+127
k) -169
Completion
: 10101000= +169
C-I
=> 01010111
C-II
=> 1 +
01011000=
-169
C-I
=> 10100111
C-II
=> 1 +
10101000=
+169
l)
0
Completion
: 00000000= 0
C-I
=> 11111111
C-II
=> 1 +
00000000=
0
m) +81
Completion
: 01010000= +81
C-I
=> 10101111
C-II
=> 1 +
10110000=
-81
n) +3
Completion
: 00000011= +3
C-I
=> 11111100
C-II
=> 1 +
11111101=
-3
o) -3
Completion
: 00000011= +3
C-I
=> 11111100
C-II
=> 1 +
11111101=
-3
C-I
=> 00000010
C-II
=> 1 +
00000011=
+3
p) -190
Completion
: 010111110= +190
C-I
=> 101000001
C-II
=> 1 +
101000010=
-190
C-I
=> 010111101
C-II
=> 1 +
010111110=
+190
2. Each
of the following numbers represent a signed decimal number in the
2’s-complement system. Determine the decimal value in each case. (Hint: use
negation to convert negative numbers to positive.)
a) 01101
= 13
b) 11101
= -3
C
–I => 00010
C-II
=> 1 +
00011 = 3
c) 01111011=
123
d) 10011001=
-103
C-I
=> 01100110
C-II
=> 1 +
01100111 = 103
e) 01111111=
127
f) 10000000=
+/-128
C-I
=> 01111111
C-II
=> 1+
10000000 = +/-128
g) 11111111=
-1
C-I => 00000000
C-II
=> 1 +
00000001 =
1
h) 10000001
= -127
C-I =>
01111110
C-II
=> 1 +
01111111 = 127
i)
01100011 = 99
j)
11011001 = -39
C-I =>
00100110
C-II => 1 +
00100111 = 39
Tidak ada komentar:
Posting Komentar