summaryrefslogtreecommitdiff
path: root/911/CH2/EX2.8.a/ex_2_8.sce
blob: 40353579d0656cf22b1b27e14faee9307b68dc18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//example 2.8//
//multiplication in binary form//
clc
//clears the screen //
clear
//clears all the existing variables //
x=bin2dec('100')
//first number to be multiplied is x //
//binary to decima l conversion //
y= bin2dec ('10' )
//second number to be multiplied is y //
z=x*y
//multiplication//
a= dec2bin (z)
//decimal to binary conversion //
disp (a,'the multiplication of given numbers results in binary form = : ' )
disp (z, 'the multiplication of given numbers results in decimal form =: ' )
// answer in binary number //