CSE403 HOMEWORK#1

Due: Fri., Apr. 17, in class

(Class policy: No late homeworks accepted.)

(Three Questions)

1. Consider a supermarket check-out system that handles the sale of bar-coded items through a standard check-out stand. Draw a data flow diagram (DFD) that specifies a reasonable set of functions, data stores, inputs, outputs, and data flows for part of such a system. Inputs should include bar-coded items, and commands to start and end a customer transaction. Outputs should include a display of each item with its cost as it is recognized by the system, an itemized bill at the end of a transaction (ie., after a customer’s grocery cart has been emptied), and a low-inventory notice whenever an item’s stock gets lower than a given theshhold. The system should also maintain data files on current inventory (stock on-hand) of all items, daily store sales, and the current transaction, at least.

2. A single button mouse is used for generating Morse code, an old coding scheme employed for telegraph communications. A dot is defined by a depress-button event (D) followed by a release-button event (U) separated by no more than td time units. A dash is a D followed by a U separated by more than td. Write an extended fsm for a dot/dash recognizer. Input events are D, U, and a tick every unit of time. Outputs should be dot, dash, and eol. The eol output is an end-of-line indicator and should be generated after every 40 dots and dashes have been recognized.

3. A VCR can operate in three different modes:

i) Play: Commands or buttons are available to play, pause or stop, rewind, or eject a tape.

ii) Program: A user can set the machine to record the TV signal on tape from a given channel, starting at a particular time, and for a given duration.

iii) Record: The TV signal from a given channel can be recorded on tape, either manually in real-time or automatically as specified by a program ( ii) above).

Draw a statechart for the VCR. Your statechart should have at least three levels of structure, and use “interrupts” to describe mode changes.