blob: 57ee2fad22fe8462be8630e6f483fdbd496da728 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
//9.11
clc;
c=60;
xc= bitcmp (c ,8);
A=xc+1;
d=28;
xd= bitcmp (d ,8);
B=xd+1;
Ans=B+A;
a=dec2bin(Ans)
disp(a)
disp('Since the MSB is 1 so the number is negative and equal to -88')
Ans=B-A;
a=dec2bin(Ans,8)
disp(a)
disp('Since the MSB is 0 so the number is positive and equal to +32')
|