EECS113 Assignment 3 Simple Calculator for Addition Operation


Category: You will Instantly receive a download link for .zip solution file upon Payment


5/5 - (5 votes)

You are required to implement a simple 8051-based calculator that supports addition of two
numbers. The two numbers can be entered using the EdSim51 keypad and are displayed on the
LCD as they are typed. The LCD should also display the result of the addition operation, as
shown in the figures below.

Rules and Guidelines:
1. The assignment code must be written in C-language and be fully compiled by either
SDCC or Keil compilers.
2. The Generated hex file should be fully functional on EdSim51.
3. The two added number should be in the range represented by 16 bits (unsigned int data
type in C).
4. You can use the “*” button of the keypad to represent the addition sign and the “#”
button of the keypad to represent the equal sign (you can also rename the symbol
drawn on each button by right clicking on it as shown below). To make your task easier,
you can change the keypad mode to pulse mode instead of the standard mode, so that
the keypad keys can be used as push buttons instead of switches.
5. You can start by studying the codes uploaded with this assignment (lcd.c and keypad.c)
to understand the operation of both the LCD and the keypad. You can also utilize these
codes in your assignment.
6. To be able to correctly compile any of your codes using SDCC compiler to work properly
on EdSim51, you need to do the following 3 steps (some of these commands options
may not be necessary as some of them are already the default values, you can refer to
the SDCC manual for more information):
>> sdcc –model-small -mmcs51 –Werror -I. -c FILENAME.c
>> sdcc –model-small -mmcs51 –Werror -I. –iram-size 0x100 \
–code-size 0x1000 –code-loc 0x0000 –stack-loc 0x30 \
–data-loc 0x30 –out-fmt-ihx FILENAME.rel
>> packihx FILENAME.ihx > FILENAME.hex
Turn In Requirements:
 You are required to turn in 2 files in the EEE dropbox set up for assignment-4:
– The C code (assignment4.c)
– The generated hex file (assignment4.hex) that is compatible with EdSim51.
 Please add comments to different parts of your file to describe your coding.