summaryrefslogtreecommitdiff
path: root/462/CH2/EX2.13.a/ex_2_13_a.sce
blob: 6b63717bc3206f1262f1e1bbc473a5e35c3cf0fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//example 2.13(a)//
//addition of binary number//
clc
//clears the screen//
clear
//clears already existing variables//
x=bin2dec('1011')
//binary to decimal conversion//
y=bin2dec('1100')
z=x+y
//addition//
a=dec2bin(z)
//decimal to binary conversion//
disp('the addition of given numbers is:')
disp(a)
//answer in binary form//