summaryrefslogtreecommitdiff
path: root/45/CH12/EX12.1/example_12_1.sce
blob: d2832224e0c19129465a88c18713416c1a058685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//chapter 12
//Example 12.1
//Q.Find the binary equivalent of each bit in a 4-bit system
//solution:
clc;
clear;
LSB = 1/(2^4-1); // calculating binary weights 
LSB2 = 2*1/(2^4-1);
LSB3 = 4*1/(2^4-1);
MSB = 8*1/(2^4-1);
disp("Binary weight of each bit in a 4-bit system');
disp("LSB ="); // displaing the result 
disp(LSB);
disp("LSB2 =");
disp(LSB2) 
disp("LSB3 =");
disp(LSB3) 
disp("MSB =");
disp(MSB) ;