blob: 72e35ec9ccf5b8c98143bf33228e66f9aa3c82c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
clc;clear;
//Example 25.7
//calculation of product of two binary numbers
//given values
X='10101';//first binary number with last two digits in fractional part
Y='101';//second binary number with last two digits in fractional part
//calculation
x=bin2dec(X);//decimal equivalent
y=bin2dec(Y);//decimal equivalent
z=x*y;
Z=dec2bin(z);
disp(Z,'product of the given binary numbers is ')
|