{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSCE 3612 ch5-1 - Program design and analysis Software...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Program design and analysis Software components. Representations of programs. Assembly and linking.
Image of page 1

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

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Software state machine State machine keeps internal state as a  variable, changes state based on inputs. Uses: control-dominated code; reactive systems.
Image of page 2
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. State machine example idle buzzer seated belted no seat/- seat/timer on no belt and no timer/- no belt/timer on belt/- belt/ buzzer off Belt/buzzer on no seat/- no seat/ buzzer off
Image of page 3

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

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. C implementation #define IDLE 0 #define SEATED 1 #define BELTED 2 #define BUZZER 3 switch (state) { case IDLE: if (seat) { state = SEATED; timer_on = TRUE; } break; case SEATED: if (belt) state = BELTED; else if (timer) state = BUZZER; break; }
Image of page 4
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Signal processing and circular buffer Commonly used in signal processing: new data constantly arrives; each datum has a limited lifetime. Use a circular buffer to hold the data  stream. d1 d2 d3 d4 d5 d6 d7 time t time t+1
Image of page 5

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

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Circular buffer x1 x2 x3 x4 x5 x6 t 1 t 2 t 3 Data stream x1 x2 x3 x4 Circular buffer x5 x6 x7
Image of page 6
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Circular buffers Indexes locate currently used data,  current input data: d1 d2 d3 d4 time t1 use input d5 d2 d3 d4 time t1+1 use input
Image of page 7

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

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Circular buffer implementation: FIR filter int circ_buffer[N], circ_buffer_head = 0; int c[N]; /* coefficients */ int ibuf, ic; for (f=0, ibuff=circ_buff_head, ic=0; ic<N; ibuff=(ibuff==N-1?0:ibuff++), ic++) f = f + c[ic]*circ_buffer[ibuf];
Image of page 8
© 2008 Wayne Wolf
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern