{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW4soln-3750

HW4soln-3750 - 1 EE 3750 HW 4 solutions EE 3750 Homework 4...

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

View Full Document Right Arrow Icon
EE 3750 — HW 4 solutions 1 EE 3750 — Homework 4 solutions Fall 2001 1. Write an 8086 instruction sequence to control a simple car radio tuner. Use program- controlled I/O. The tuner is to receive inputs from two buttons to change to preset station frequencies, an up/down signal to increment/decrement the frequency, and a reset button to change one of the station presets. The tuner is to output the new frequency whenever a change has occurred. For simplicity, assume that radio station frequencies are 16-bit integers. There are three input ports (preset, up/down, and reset) and one output port (freq). Each input from a data or status port is to be a single byte; the output to a data port is to be a word. Assume that three word variables have been initialized: PREFREQ1, PREFREQ2, and CURRFREQ, holding the preset frequency for station 1, the preset frequency for station 2, and the current radio frequency. Your program is to poll the preset buttons port to determine when to change the frequency to a preset station. The data port will hold 1 (2) when preset button 1 (button 2) has been pressed and the tuner is to change the frequency to preset frequency 1 (preset frequency 2). Your program is to poll the up/down button port to determine whether to increment (1) or decrement (2) the frequency (that is, the data port will hold 1 for increment and 2 for decrement). Your program is to poll the reset button port to determine whether to reset a station preset frequency (1) or not (0). If so, then when the next preset button is pressed, change that preset frequency to the current radio frequency. When a frequency changes, the tuner is to write the new frequency to the output frequency port. You may assume that this port is always ready. Bit 2 is the ready bit in each status register. Describe the priority structure you have assigned to the various ports. Your program is to always be ready to handle any button pushed by the user. Explicitly state any other assumptions that you make in writing this program. The table below gives status and data port addresses. device status port data port preset 21H 20H up/down 31H 30H reset 41H 40H freq 50H Assume that byte variable RESETFLAG has been defined and initialized to 0. This is a flag with value 1 indicating that the reset button has been pushed and when the next preset button is pressed, it should change the preset frequency; value 0 indicates otherwise.
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
Image of page 2
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