summaryrefslogtreecommitdiff
path: root/3544/CH2/EX2.65/Ex2_65.sce
diff options
context:
space:
mode:
Diffstat (limited to '3544/CH2/EX2.65/Ex2_65.sce')
-rw-r--r--3544/CH2/EX2.65/Ex2_65.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/3544/CH2/EX2.65/Ex2_65.sce b/3544/CH2/EX2.65/Ex2_65.sce
new file mode 100644
index 000000000..3d43b2537
--- /dev/null
+++ b/3544/CH2/EX2.65/Ex2_65.sce
@@ -0,0 +1,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