summaryrefslogtreecommitdiff
path: root/991/CH24/EX24.5/Example24_5.sce
blob: 414f5930a01bf6aa5fadc1200f5cbde669c13e0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Example 24.5. multiply binary numbers
clc
h=bin2dec('1101')
o=bin2dec('1100')
p=h*o
z=dec2bin(p)
disp(z,"(i) 1101 x 1100 = ")
h=bin2dec('1000')
o=bin2dec('101')
p=h*o
z=dec2bin(p)
disp(z,"(ii) 1000 x 101 = ")
h=bin2dec('1111')
o=bin2dec('1001')
p=h*o
z=dec2bin(p)
disp(z,"(iii) 1111 x 1001 = ")