13.10.2012 Views

boylistad

boylistad

boylistad

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

oscilloscope will generate the oscilloscope on which a Timebase of<br />

100 ms/div. can be set again with a vertical sensitivity of 5 V/div. Select<br />

1 on the Simulate switch, and the waveform of Fig. 13.77 will appear.<br />

Choosing Singular under Trigger will result in a fixed display; then set<br />

the Simulate switch on 0 to the end the simulation. Placing the cursors<br />

in the same position shows that the waveforms for Figs. 13.76 and 13.77<br />

are the same.<br />

For most of the EWB analyses to appear in this text, the<br />

AC – VOLTAGE – SOURCE under Sources will be employed. However,<br />

with such a limited introduction to EWB, it seemed appropriate<br />

to introduce the use of the Function Generator because of its close<br />

linkage to the laboratory experience.<br />

C��<br />

Calculating the Average Value of a Waveform The absence of<br />

any network configurations to analyze in this chapter severely limits the<br />

content with respect to packaged computer programs. However, the<br />

door is still wide open for the application of a language to write programs<br />

that can be helpful in the application of some of the concepts<br />

introduced in the chapter. In particular, let us examine the C�� program<br />

of Fig. 13.78, designed to calculate the average value of a pulse<br />

waveform having up to 5 different levels.<br />

The program begins with a heading and preprocessor directive.<br />

Recall that the iostream.h header file sets up the input-output path<br />

Body<br />

of<br />

program<br />

Heading<br />

Preprocessor<br />

directive<br />

Define<br />

form<br />

and<br />

name<br />

of<br />

variables<br />

Obtain<br />

# of<br />

levels<br />

Iterative<br />

for<br />

statement<br />

Calculate V ave<br />

Display<br />

results<br />

FIG. 13.78<br />

C�� program designed to calculate the average value of a waveform with up<br />

to five positive or negative pulses.<br />

COMPUTER ANALYSIS ⏐⏐⏐ 563

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!