summaryrefslogtreecommitdiff
path: root/2492/CH8/EX8.1
diff options
context:
space:
mode:
Diffstat (limited to '2492/CH8/EX8.1')
-rwxr-xr-x2492/CH8/EX8.1/ex8_1.sce12
1 files changed, 12 insertions, 0 deletions
diff --git a/2492/CH8/EX8.1/ex8_1.sce b/2492/CH8/EX8.1/ex8_1.sce
new file mode 100755
index 000000000..8d48771cb
--- /dev/null
+++ b/2492/CH8/EX8.1/ex8_1.sce
@@ -0,0 +1,12 @@
+// Exa 8.1
+format('v',9)
+clc;
+clear;
+close;
+// Given data
+str= '3BF';// given number in hexadecimal to convert into binary
+str_in_dec= hex2dec(str);// decimal equivalent
+str_in_bin= dec2bin(str_in_dec);// binary equivalent
+disp(str_in_bin,"The binary equivalent of 3BF is : ")
+
+// Note : The answer in the book is wrong because binary equivalent of B = 1011 and in the book they used 1101 which is wrong.