summaryrefslogtreecommitdiff
path: root/3544/CH2/EX2.65/Ex2_65.sce
blob: 3d43b253736f2a2cd63b6088d90b411e89b515ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

//Understanding key range

n = [2; 3]
states = []
for i=1:length(n)
    printf("Bits: %d\n",n(i,1))
    printf("No of states: %d",2^n(i,1));
    disp("The states are:")
    for j=0:2^n(i,1)-1
        disp(dec2bin(j))
    end
    disp("")
end