summaryrefslogtreecommitdiff
path: root/761/CH9/EX9.6/9_6.sce
blob: 90ee7ed7dc49293add9e2b7318d868227d0f2397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
clc;
// page no 358
// prob no 9.6
m=21;
// The correct number of check bits is the smallest number that satisfy the equation 2^n  >= m+n+1;
for n=1:1:10 // we choose range of 1 to 10
    a=m+n+1;
    b=2^n;
    if(b>=a)
        disp(n,'hammming bits are required')
        break;
    end
end