From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 45/CH15/EX15.6/example_15_6.sce | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 45/CH15/EX15.6/example_15_6.sce (limited to '45/CH15/EX15.6/example_15_6.sce') diff --git a/45/CH15/EX15.6/example_15_6.sce b/45/CH15/EX15.6/example_15_6.sce new file mode 100755 index 000000000..d4288d07f --- /dev/null +++ b/45/CH15/EX15.6/example_15_6.sce @@ -0,0 +1,15 @@ +//example 15.6 +clc; +clear; +//s= input('Enter the clk freqency in kHz : '); +//f=input('Enter the frequency of the unknown input in Hz :'); +s=100;// taking the inputs +f=200; +g=1000000/f; // making neccesary calculations +c=g*s/1000; +c=round(c); +p=c*1000/s; +disp('Assuming that the conter and the display are initially at 00000');//displaying results +printf('Enable gate time in micro secnds will be : %d\n',g); +printf('During the gate time the counter will be advced by (number of counts ) %d \n',c); +printf('The time period of the unknown input in micro-seconds is : %d',p); -- cgit