1 / 14

Bus-Based Computer Systems

Bus-Based Computer Systems. Example: alarm clock. Alarm clock interface. Alarm on. Alarm off. buzzer. PM. Alarm ready. light. set time. set alarm. hour. minute. button. Operations. Set time: hold set time, depress hour, minute.

velvet
Télécharger la présentation

Bus-Based Computer Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bus-Based Computer Systems • Example: alarm clock Overheads for Computers as Components 2nd ed.

  2. Alarm clock interface Alarm on Alarm off buzzer PM Alarm ready light set time set alarm hour minute button Overheads for Computers as Components 2nd ed.

  3. Operations • Set time: hold set time, depress hour, minute. • Set alarm time: hold set alarm, depress hour, minute. • Turn alarm on/off: depress alarm on/off. Overheads for Computers as Components 2nd ed.

  4. Alarm clock requirements Overheads for Computers as Components 2nd ed.

  5. Alarm clock class diagram 1 1 1 1 Lights* Display Mechanism 1 1 1 Buttons* Speaker* 1 Overheads for Computers as Components 2nd ed.

  6. Alarm clock physical classes Lights* Buttons* Speaker* digit-val() digit-scan() alarm-on-light() PM-light() set-time(): boolean set-alarm(): boolean alarm-on(): boolean alarm-off(): boolean minute(): boolean hour(): boolean buzz() Overheads for Computers as Components 2nd ed.

  7. Display class Display time[4]: integer alarm-indicator: boolean PM-indicator: boolean set-time() alarm-light-on() alarm-light-off() PM-light-on() PM-light-off() Overheads for Computers as Components 2nd ed.

  8. Mechanism class Mechanism Seconds: integer PM: boolean tens-hours, ones-hours: boolean tens-minutes, ones-minutes: boolean alarm-ready: boolean alarm-tens-hours, alarm-ones-hours: boolean alarm-tens-minutes, alarm-ones-minutes: boolean scan-keyboard() update-time() Overheads for Computers as Components 2nd ed.

  9. Update-time behavior update seconds with rollover display.set-time(current time) F Time >= alarm and alarm-on? F Rollover? T T update hh:mm with rollover alarm.buzzer(true) PM->AM AM->PM PM=true PM=false Overheads for Computers as Components 2nd ed.

  10. Scan-keyboard behavior Set-time and not set-alarm and hours compute button activations Increment time tens w. rollover and AM/PM Alarm-on alarm-ready= true Alarm-off alarm-ready= false alarm.buzzer(false) Increment time ones w. rollover and AM/PM save button states Set-time and not set-alarm and minutes Overheads for Computers as Components 2nd ed.

  11. System architecture • Includes: • periodic behavior (clock); • aperiodic behavior (buttons, buzzer activation). • Two major software components: • interrupt-driven routine updates time; • foreground program deals with buttons, commands. Overheads for Computers as Components 2nd ed.

  12. Interrupt-driven routine • Timer probably can’t handle one-minute interrupt interval. • Use software variable to convert interrupt frequency to seconds. Overheads for Computers as Components 2nd ed.

  13. Foreground program • Operates as while loop: while (TRUE) { read_buttons(button_values); process_command(button_values); check_alarm(); } Overheads for Computers as Components 2nd ed.

  14. Testing • Component testing: • test interrupt code on the platform; • can test foreground program using a mock-up. • System testing: • relatively few components to integrate; • check clock accuracy; • check recognition of buttons, buzzer, etc. Overheads for Computers as Components 2nd ed.

More Related