summaryrefslogtreecommitdiff
path: root/3871/CH14/EX14.5/Ex14_5.sce
blob: 706237a9d9af33cd0a78b983f38853b4d4bdcde8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//=====================================================================================
//Chapter 14 example 5
clc;
clear all;

//variable declaration
t       = 5*10^6;   //time reaading in ms
t2       = 500;   //time reaading in ms
x       = 0.005;     //accuracy in percent of reading
t3       = 500*10^3;   //time reaading in ms

//calculations
e       = ((x/100)*t)+1;      //maximum likely timing error in ms
e1      = ((x/100)*t2)+1;      //maximum timing error in ms
a       = t2*10^6;          //maximum accuracy mininum error will be obtained when the time is read on the us read
e3      = ((x/100)*t3)+1;      //maximum timing error in ms

//result
mprintf("maximum likely timing error  when time reading is 05000000 ms = %3.2f ms",e);
mprintf("\nmaximum   timing error  when time reading is 00000500 ms = %3.2f ms",e1);
mprintf("\nmaximum  error  when time reading is 00500000 = %3.2f ms",e3);