summaryrefslogtreecommitdiff
path: root/1850/CH8/EX8.14/exa_8_14.sce
blob: e1ecb2471e8c36dc66b3d5b3a1238ba3af831ba6 (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
// Exa 8.14
clc;
clear;
close;
//given data
f=75;// in MHz
f=f*10^6;// in Hz
// For an 8-bit converter reference voltage
V_REF= 100;// in volt
// For setting D7=1
Vo_7= V_REF*2^7/2^8;//in volt
// For setting D6=1
Vo_6= V_REF*2^6/2^8;//in volt
// For setting D7=1 and D6=1
Vo_76= Vo_7+Vo_6;//in volt
// For setting D5=1 D6=1 and D7=1
Vo_5= V_REF*2^5/2^8+Vo_7+Vo_6;//in volt
disp(Vo_7,"For setting D7=1 output voltage in volt is :")
disp(Vo_6,"For setting D6=1 output voltage in volt is :")
disp(Vo_76,"For setting D7=1 and D6=1 output voltage in volt is :")
disp(Vo_5,"For setting D5=1, D6=1 and D7=1 output voltage in volt is :")
disp("All other digits will be set to zero or 1. Output will be accordingly indicated as a resul of successive approximation. The converted 8-bit digital form will be 1110010")
T=1/f;// in sec
disp(T*10^9,"Conversion time in ns")