Project Description
Microprocessors Laboratory
EEL 4743 -- Fall 1998




Create a program that acts as a basic calculator for two-digit numbers. The program should provide the user with addition, subtraction, and multiplication features for any two two-digit numbers.

Program (35 points)

When the program starts, it should display a ``0'' on the first line of the LCD display, as illustrated in Figure 1(a). When the user enters the first number, for example ``12'', it should replace the zero on the display as shown in Figure 1(b). The user will next press a key on the hex keypad that indicates the desired arithemetic operation for which the program should print the appropriate operator. For instance, if the user presses ``A'' for addition, the program will then print a ``+'' as shown in Figure 1(c). If the user presses one of these keys before entering both digits of the first number, the program will use either zero or the single digit number, accordingly. Next, the user will enter the second two digit number, for example ``24'' as presented in Figure 1(d). The user will then press ``E'' (for equals) to perform the desired operation, at which time the program should print ``='' and the result, as shown in Figure 1(e). However, if the user presses ``E'' before specifying two digits for the second number, the program should either print a zero or a single number, accordingly. The program should then move the cursor to the next line and again print ``0'' to indicate it is ready for use, as shown in Figure 1(f). If the user presses ``C'' (for clear) at any time, the program should clear the current line and print ``0'' to start a new iteration. The keys and their correpsponding operations are given in Table 1.
        
Figure 1: Various stages of program operation
\begin{figure}
 \begin{center}
 \subfigure[]{ 
 
\fbox {\parbox[c][1.8\baselines...
 ...{\screenwidth}{\normalsize\ttfamily12 + 24 = 36\ 0}}
} \end{center}\end{figure}


 
Table 1: Arithmetic Operations
Key Operator Operation
A + addition
B - subtraction
C   clear
F x multiplication
E = equals
D / division (Extra Credit)
 

The program should use the SCI for communications with the ULDP1 lab board.

Hints

Some hints are provided below.

Extra Credit (10 points)

Provide a division function that is used if the user presses ``D'' after entering the first number. To indicate that the program is performing division, it should print a ``/'' between the two numbers. The program should display the result with two digits to the right of the decimal point. It should not print leading zeros.

Report (15 points)

The report should contain the following sections in accordance with the Formal Lab Report format: Purpose, Theory, Results and Appendix. Note the omission of the Procedure section.

Paper Option

In lieu of completing the required class project, you may elect to write a paper discussing a topic related to this course. If you choose this option, please have your topic approved by me in advance so that we can agree on the scope of your paper. Some possible topics for a paper relating to microprocessors or embedded systems are suggested below:

Together, the working project on disk with accompanying report or paper submission is due on December $\underline{\ \ \ \ }$, 1998 at 5:00 PM in my mailbox, lest your project grade will automatically suffer 10 points.

About this document ...

This document was generated using the LaTeX2HTML translator Version 97.1 (release) (July 13th, 1997)

Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.

The command line arguments were:
latex2html -split 0 -no_navigation -dir /home/sunflash1/grad/sperandi/public-html/EEL4743/calc calc.tex.

The translation was initiated by John Sperandio (EE) on 11/4/1998


John Sperandio (EE)
11/4/1998