summaryrefslogtreecommitdiff
path: root/991/CH24/EX24.6/Example24_6.sce
blob: b7ade9bb52f462e1c843044591f9c588cfc8c470 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Example 24.6. perform the binary divisions
clc
x=bin2dec('110')
x1=bin2dec('10')
x2=x/x1
x3=dec2bin(x2)
disp("(i) 110 / 10")
disp(x3,"  = binary")
disp(x2,"  = decimal")
x=bin2dec('1111')
x1=bin2dec('110')
x2=x/x1
x3=dec2bin(int(x2));
disp("(ii) 1111 / 110")
disp(x3,"  = binary")
disp(x2,"  = decimal")