Professional Documents
Culture Documents
Joseph Lubars(jpl754)
Objectives:
This lab was largely designed to teach us how to interface with a few key software and
hardware tools for the embedded systems lab. In particular on the software side, in this lab, we
learned how to operate the Keil development platform and standard C coding methodologies/
development standards. On the hardware side, we learned how to flash programs to the
Stellaris kit for an OLED fixed point display.
Questions:
In the following lab, we developed some basic fixed point display operations for OLED display.
In particular, we wrote routines for outputting fixed point numbers in a variety of precisions
and formats.
1. The call graph for an embedded software system graphically shows how all the associated
modules of the system are interconnected with procedural calls for inputs and outputs. Good
software design should seek to modularize as many components of the system as possible for
ease of debugging and implementation. the rit128x96x4.c module is the driver for the OLED
display on the hardware kit. While the fixed.c module is the software for handling input and
output for fixed point representation. Because the OLED display driver exclusively deals with
the hardware graphical interface of the system, it should not need any direct knowledge of how
fixed.c is operating. Rather, it should only seek to display whatever formatted string is passed in
as input through the printf function. This represents good modularized design and
2.This property aligns numbers for clarity in viewing and observing large amounts of data.
3. Ideally you would want to use fixed point operations over floating point operations if you
know a priori what the valid range of values should be. In addition, the fixed point standard
gives accuracy over the floating point standard in base 10. Finally, for the ARM cortex M3, fixed
point operations can be done in hardware and are therefore faster than floating point
operations which must be done on a software level.
4. Binary fixed point has the advantage of yielding quick bit shift operations while decimal fixed
point is ideal when you are exclusively dealing with decimal numbers and want to accurately
represent the numbers without floating point protocols.
5. In financial operations such as cash registers, we know beforehand that the smallest
denomination of currency is the penny. Multiple transactions of buying and selling goods must
be done quickly and accurately. Therefore, decimal fixed point arithmetic is ideal for this
situation with the resolution equal to .01.
6. Yes we can, however, the cost is additional software processing because there is no built-in
hardware suppport for floating point operations. *MMX instruction set reuses existing floating
point registers making the CPU unable to work on both floating point and SIMD data at the
same time without a slow switching operation.
Software
Test.c
#include <stdio.h>
#include "fixed.h"
0, " 0.00" }, //
0/256 = 0.00
4, " 0.01" }, //
4/256 = 0.01
outTestCaseType outTests3[8]={
{-10000, "***.**" },
{ -9999, "-9.999" },
{ -1000, "-1.000" },
{ -50, "-0.050" },
{
0, " 0.000" },
outTestCaseType outTests2[8]={
0, " 0.00" },
9, " 0.09" },
if (Errors == 0) {
printf("All tests passed!");
}
for( ; ; ) {}
}
Fixed.h
No changes were made from the starter fixed.h file.
Fixed.c
#include "fixed.h"
#include <stdio.h>