summaryrefslogtreecommitdiff
path: root/2621/CH10/EX10.6/Ex10_6.sce
blob: aebe3121ea51722ecbe35da453ad48e804ae44a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Example 10.6
clc;
clear;
close;
// Given data
format('v',6);
V_REF= 1.25;// in V
R1= 3*10^3;// in Ω
R2= 1*10^3;// in Ω
Vin= 20;// in V
Vout= V_REF*(R1+R2)/R2;// output voltage in volts
// Duty cycle,
D= Vout/Vin*100;// in %
disp("The duty cycle is "+string(D)+" %")