Computer Organization - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Computer Organization

Description:

... to the location in the parsed string where a delimiter was found. ... What is the String To Parse: Now iCeciclEs Descend From thE sky. Result: Now i. ecicl ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 10
Provided by: jb20
Category:

less

Transcript and Presenter's Notes

Title: Computer Organization


1
Computer Organization
  • Project 4
  • Prof. Jerry Breecher
  • CSCI 140
  • Spring 2005

2
What You Will Do In This Project
  • The purpose of this project is to take the next
    steps in writing a more complex program.
  • You are working toward writing a program that can
    take in the following input
  • ADQltwsgtstring1ltwsgt.ltwsgtstringN
  • Where
  • ADQ means Sort in Ascending order, Descending
    order or Quit.
  • ltwsgt whitespace space or tab.
  • There is a considerable amount of work to do
    here, and so it makes sense to divide this into
    smaller pieces.
  • Project 3 Handling arbitrary number of strings.
  • Project 4 Parsing a long string looking for
    arbitrary characters.
  • Project 5 Putting it all together.

3
What You Will Do In This Project
  • This week in more detail.
  • A really difficult task in any language is to
    parse a string of characters looking for
    particular patterns. In this case a pattern is
    easy looking for one of several characters.
  • And when you find these patterns, you must take
    the action of splitting the string youre
    searching on into a number of smaller strings.
  • As always, getting your head around the code is
    the hardest part of the job. And so we require
    good coding techniques to do this task.

4
What You Will Do In This Project
  • Groundrules
  • Credit for Projects
  • Is based on deliverables.
  • You will be expected to e-mail me a High Level
    Design Program AND a test plan by noon on
    Thursday.
  • You will be expected to do a Show and Tell one
    week after the project is assigned. See the
    evaluation sheet.
  • You will also be expected to turn in your
    assignment, placing it in the CS140 submissions
    directory. To do this, name your completed code
    as proj4.s, and then from the directory in which
    the code currently resides, type the following
  • jbreecher/turnin.pl 140 proj4.s

5
What You Will Do In This Project
  • LookForDelimiters
  • Writing the interfaces and specs for routines
    goes a long way toward breaking up the project.
    One way to do this is to define the routine
    look_for_delimiters with the following interface

  • look_for_delimiters
  • Inputs
  • a0 - contains the address of the
    delimiter string.
  • a1 - contains the address of the start
    of the string to be parsed.
  • The delimiter string has the following
    properties
  • lt0 or more characters that are
    delimitersgtltThe NL chargtlt0gt
  • The string to be parsed has the following
    properties
  • lt0 or more characters, some of which
    MAY be delimitersgtltThe NL chargtlt0gt

6
What You Will Do In This Project
  • LookForDelimiters
  • Heres the continuation of the interface spec.
  • Outputs
  • a0 (unmodified) - contains the address
    of the delimiter string.
  • a1 (unmodified) - contains the address
    of the start of the string that was parsed.
  • v0 - A pointer to the location in the
    parsed string where a delimiter was found.
  • v1 The delimiter character that was
    found.


7
What You Will Do In This Project
  • So the interface for the next part of the
    assignment will look like this
  • What are the delimiter(s) CEF
  • What is the String To Parse Now iCeciclEs
    Descend From thE sky
  • Result
  • Now i
  • ecicl
  • s Descend
  • rom th
  • sky
  • What are the delimiter(s)

The string of characters between each of the
delimiters is printed out.
8
A Test Plan
  • Here are some possible inputs that you can check
    for. I have attempted to give you some
    interesting and unusual conditions. You will
    want to continue this test plan to find other
    possible cases.

9
Project 4 Evaluation Sheet
  • Name____________________________________________
    _____________
  •  
  • Is there a complete set of test cases?
  •  
  •  
  • Is there functioning High Level Language Program
    emulating this Assignment? Do the test cases
    given work on this program?
  •  
  •  
  • Does the MIPS program work as expected on student
    test cases?
  •  
  •  
  • Does the MIPS program work as expected on
    professor test cases?
  •  
  •  
  • Is the code organized as a set of functions
    rather than as one big chunk of main code?
  •  
  •  
  • Is the code readable and well commented?
  •  
Write a Comment
User Comments (0)
About PowerShow.com