cpe229_lec19

cpe229_lec19 - CPE 229 Course Notes Lecture 19 Copyright...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CPE 229 Course Notes: Lecture 19 Copyright: 2005 Bryan Mealy This set of notes represents the third lecture dealing with the PicoBlaze and its associated assembly language. In reality, based on the programming required by CPE 269 Experiment 7 and the various examples we’ve done in class, we’ve come a long way in the last few sets of notes. As you’ll soon be noticing, there’s really not that much to say about PicoBlaze due to its relative simplicity compared to other microcontrollers. The instruction set is relatively small and operations it can perform are relatively simple so that after a few times reading through the manual, there’s not a lot more to talk about. This being the case, we’ll focus our attention to the bigger picture of programming in general. Though the discussion that follows is in the context of an assembly language, the concepts apply to any programming assignment you may face in your present and/or future careers. This set of notes introduces a standard structured approach to programming. As the programs you write become more complex, it becomes important for you to take a healthy and sane approach to designing and writing programs. The use of flowcharts has many advantages and should become an important initial step in any software project you partake in. We’ll be looking at the basics of flowcharts and briefly discuss the theory behind it. With the pertinent examples provided, you’ll without doubt be convinced that the use of flowcharts will expedite any software project you embark upon. The underlying theme of this discussion will be the production of modular code whenever humanly possible. The other part of this set of notes will explore some of the details regarding the carry flag. We’ll see that the carry flag also doubles as the borrow flag. There a few standard tricks that use the carry/borrow flag and we’ll looking at a few examples in that area. The Basics of Flowcharting The writing of any useful software (or firmware) can be viewed as a solution to some problem. In other words, any worthwhile program that has ever been written was done so in order to do something useful. This usefulness can be characterized as providing a meaningful result. This being the case, the solution could be further characterized or labeled as an algorithm . As you’ve probably read somewhere before, an algorithm is a computational or logical method of producing a desired result. The development and visual representation of an algorithm is facilitated by a flowchart. The flowchart is the software analog to the block diagram used to describe hardware subsystems. Remember that hardware block diagrams were used to quickly convey an understanding of the circuit at hand. You’ll find that flowcharting an algorithm serves the same purpose. Keep in mind that both flowcharts and block diagrams worked well with hierarchical design to further promote understanding of the items they represent. A flowchart has two basic purposes. It is the best idea to consider it a design tool which is how we’ll be
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/27/2009 for the course CPE 229 taught by Professor Smith during the Spring '09 term at Cal Poly.

Page1 / 9

cpe229_lec19 - CPE 229 Course Notes Lecture 19 Copyright...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online