blob: 0c10b86c124b05a2a2ff443a316f7f2cfb27bb53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
clc;clear;
//Example 25.5
//calculation of difference of two binary numbers
//given values
X='1000';//first binary number
Y='0011';//second binary number
//calculation
x=bin2dec(X);//decimal equivalent
y=bin2dec(Y);//decimal equivalent
z=x-y;
Z=dec2bin(z);
disp(Z,'difference of the given binary numbers ')
|