ET 154 Computer Programming

Background

This course assumes no familiarity with computers. If you feel that you have a sufficient programming background, please see me about testing out, or preferably opting for a more advanced course. Math level is mostly algebra with some trig. Much of our work will revolve around using the BASIC language to help solve electrical problems. We will also introduce the use of word processors for writing lab reports, and circuit simulation tools such as Electronics Workbench MultiSIM. For lab, you'll probably want a few 3.5" floppy disks to store your work (space is also available on the student network H drive). Lab exercises are due no later than one week from the date of assignment. A printout of both properly commented program code and results is expected. Hand written code will not be accepted. Late penalty is one letter grade for the first half week, two letter grades for the second half week. Assignments are not accepted beyond two weeks and receive a grade of 0. Remember, plagiarism is grounds for failure. Although I encourage students to help each other, these assignments are individual works. Anyone caught copying someone else's programs, or allowing someone to copy their programs will receive a grade of 0. (Obtaining proof is much easier than one might think.)

Note: QBASIC may be found on old MS-DOS disk sets and on Windows 95 and Windows 98 CDs. On Windows 95/98 CDs, QBASIC files will be found in the directory tools\oldmsdos. Create a directory on your hard drive called QBASIC and then copy the QBASIC files from tools\oldmsdos to your new directory. You now have QBASIC on your computer. A student copy of MultiSIM comes with the Boylestad Circuit Analysis text used in Circuits 1 and & 2.

Week-by-week progress and assignments

1

Our first week is an introduction to computers: what they are, the various types, and a representative block diagram. Examples include desktop machines, engineering workstations, and embedded applications. We introduce the ideas of bits and bytes, and look at the differences in the various generations of programming languages.

  • Reading: Chapter 1 (an overview), chapter 2, start chapter 3 (section on variables). 
  • Problems: Chapter 2: 1-6, 14.
  • Lab: We start with proper lab safety procedures and then examine the layout of a program using the BASIC programming language.
2

This week we start creating some simple programs using fundamental math operations. We also look at a method of obtaining user data via the INPUT statement.

  • Reading: Continue in chapter 3.
  • Problems: Chapter 3: 3, 15.
  • Lab: A simple Ohm's Law calculator using INPUT and PRINT statements.
3

We introduce the concept of flow control this week and examine the IF/THEN/ELSE structure.

  • Reading: Finish chapter 3.
  • Problems: 10.
  • Lab: A resistor tolerance program that computes whether or not a measured component falls within specified tolerances.
4

The topic of the week is structured programming. The idea is to create programs in a uniform and logical manner. We shall investigate proper techniques that allow for ease of code creation and maintenance. We continue with IF/THEN/ELSE applications.

  • Reading: First half of chapter 4.
  • Problems: 7, 9.
  • Lab: We create a program that determines battery life depending on case size and current drain.
5

Around here we'll have our first in-class test.

  • Reading: Review for the test!
  • Problems: 13.
  • Lab: This week things are a bit more free-form than usual. We look at some interesting odds and ends including variations on PRINT (USING, TAB, etc.).
6

We pick up looking at subroutines, including the GOSUB and RETURN keywords.

  • Reading: Sections 3 and 4 of chapter 4, and scan chapter 5.
  • Problems: Chapter 5: 3, 10.
  • Lab: An example of using IF/THEN or ON/GOSUB statements to create menu-driven programs (a temperature converter).
7

This week we begin with looping constructs, most notably, the FOR/NEXT loop. We will also look at the GOTO and examine some of the reasons why Dykstra claimed "GOTO considered harmful".

  • Reading: Start chapter 6.
  • Problems: 3.
  • Lab: We look at a technique to verify the maximum power transfer theorem.
8

An extension of simple looping, we consider nested/embedded loops, or loops-within-loops.

  • Reading: Finish chapter 6.
  • Problems: 10.
  • Lab: We create a table of circuit values using the voltage divider rule where both a resistance and the voltage source are changing.
9

We conclude our look at looping with the WHILE structure. It is not as compact as the FOR structure, but is considerably more flexible.

  • Reading: Final section of chapter 4.
  • Problems: 21.
  • Lab: The ever-popular radioactive frog game. No graphics, but fun just the same. A good example of using a WHILE loop in a unique way, and also a good exercise to stretch your imagination and glue a few of the recent concepts together.
10

This is a good time for our second in-class test.

  • Reading: Review for test.
  • Problems: Review for test.
  • Lab: Continue with frog game.
11

This week we look at how to store and access data within a program using the READ/DATA/RESTORE statements. We also introduce the concept of the array.

  • Reading: Begin chapter 7.
  • Problems: 17.
  • Lab: We create a quality control program that computes tolerance percentages for a manufacturing run.
12

We continue to examine the use of arrays, including some basic searching and sorting techniques. Multi-dimension arrays are also considered.

  • Reading: Finish chapter 7.
  • Problems: 25.
  • Lab: This week's lab looks at a way of comparing cost-of-energy from different viewpoints, based on consumer data.
13

This is our last week of BASIC instruction. We finish up with string functions and user-defined functions.

  • Reading: Chapter 8.
  • Problems: 3.
  • Lab: A basic address book application.
14

Our third and final in-class test will be here.

  • Reading: Review for test.
  • Problems: Create versions of lab circuits (such as those used in Circuits 1 and Intro to Electronics) using MultiSIM.
  • Lab:  Overview of Electronics Workbench MultiSIM, how to create circuit schematics, set component values, and obtain basic operational results.

15

We continue with MultiSIM, showing a few of the more useful details and functions.

  • Reading: Handouts on MultiSIM.
  • Problems: Continue with circuit creation and simulation. Compare the simulation results to the values you measured in lab.
  • Lab: We look at how to use the virtual instruments such as the DMM.

[Home] [MVCC Home]

© 2004 Jim Fiore