MIPS Assembly: Simple TV Controller for CDA 3100, Assignments of Electrical and Electronics Engineering

Homework assignment #4 for cda 3100, computer organization i, spring 2008. Students are required to implement a simple tv controller using mips assembly programming. The controller accepts various commands like power on/off, channel up/down, volume up/down, sleep timer, and digit input. Specifications for handling each command and optional extra requirements for earning extra credits.

Typology: Assignments

Pre 2010

Uploaded on 08/30/2009

koofers-user-90s
koofers-user-90s 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework Assignment #4 – MIPS Assembly Programming
CDA 3100, Computer Organization I, Spring 2008
Due: Midnight, February 29, 2008
Submission: Email the code to the TA and the instructor.
The purpose of this assignment is to practice the implementation of a typical embedded
controller.
In this assignment, you are asked to implement a simple TV controller. It accepts
simple commands like vol+/-, channel +/-, channel digit input (0-9), sleep timer,
and power on/off.
Power key: ‘p’ on the keyboard
Channel +/- : ‘u’ as + and ‘d’ as –
Vol +/- : ‘l’ as + and ‘k’ as –
Digit input: 0-9
Sleep timer: ‘s’
The specifications are:
1. When there is no input, roughly every 3 seconds, print out the current state
of the TV, including: Current second, Power On (of Off), Channel (current
channel watching), volume (current volume), Sleep timer remaining. For
example, “100 sec -- Power On! Channel 10, Volume 30, sleep timer 120.” If
power is off, only output “100 sec -- Power off!”
2. Power key. When power key is pressed, if the power is currently off, turn on
the TV immediately by printing “Power On!” When power key is pressed, if
the power is currently on, turn off the TV immediately by printing “Power
Off!”
3. Channel +/-.Once pressed, change the current watching channel accordingly
within a range of 0-99 and print out, for example, “Channel 30.”
4. Volume +/-.Once pressed, change the volume accordingly within a range of
0-99 and print out, for example, “Volume 30.”
pf3

Partial preview of the text

Download MIPS Assembly: Simple TV Controller for CDA 3100 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Homework Assignment #4 – MIPS Assembly Programming

CDA 3100, Computer Organization I, Spring 2008 Due: Midnight, February 29, 2008 Submission: Email the code to the TA and the instructor.

The purpose of this assignment is to practice the implementation of a typical embedded

controller.

In this assignment, you are asked to implement a simple TV controller. It accepts simple commands like vol+/-, channel +/-, channel digit input (0-9), sleep timer, and power on/off.

  • Power key: ‘p’ on the keyboard
  • Channel +/- : ‘u’ as + and ‘d’ as –
  • Vol +/- : ‘l’ as + and ‘k’ as –
  • Digit input: 0-
  • Sleep timer: ‘s’ The specifications are:
  1. When there is no input, roughly every 3 seconds, print out the current state of the TV, including: Current second, Power On (of Off), Channel (current channel watching), volume (current volume), Sleep timer remaining. For example, “100 sec -- Power On! Channel 10, Volume 30, sleep timer 120.” If power is off, only output “100 sec -- Power off!”
  2. Power key. When power key is pressed, if the power is currently off, turn on the TV immediately by printing “Power On!” When power key is pressed, if the power is currently on, turn off the TV immediately by printing “Power Off!”
  3. Channel +/-.Once pressed, change the current watching channel accordingly within a range of 0-99 and print out, for example, “Channel 30.”
  4. Volume +/-.Once pressed, change the volume accordingly within a range of 0-99 and print out, for example, “Volume 30.”
  1. Sleep timer. When sleep timer key is pressed, if the sleep timer is off, set the sleep timer to be 5 sec. If the sleep timer is on, increment the sleep timer by 5 sec. If the sleep timer exceeds 200 sec after the increment, set the sleep timer to be off. Show the status of the sleep timer after processing the input immediately, for example, “Sleep timer 150.” If the sleep timer is on, it decrements by 1 every second. Once it becomes 0, turn the TV off immediately and print out “Power off due to sleep timer!”
  2. Digit input. Once a digit key is pressed, print out the intended channel immediately. For example, 1’ is pressed, print out “Channel 1-” immediately. The controller should be expecting another digit input for another 2 seconds. If any other key is pressed during these two seconds, abort the digit input. For example, if1’ is pressed at 1000 second and channel +’ is pressed at 1001 second, the controller should perform the channel + function and “forget” about the digit input. If no other key is pressed during the two seconds, the controller switches to channel 1. If another digit key is pressed within the two seconds, for example,2’ is pressed, the controller switches to channel 12 immediately.
  3. When the power is off, the controller responds to no key input except the Power key.
  4. Pay attention when the sleep timer turns off the TV when the controller is expecting the second digit input. The controller should abort the digit input. Okay, these are the basic requirements. Use the code developed during Monday’s class as a frame work to implement your code. Extra requirements to earn extra credits:
  5. When hitting the sleep timer key, at the first time, do not change the status of the sleep timer and just show the current status. If the sleep timer key is pressed again within 3 seconds, then starts to modify the status of the sleep timer.
  6. The “Go-back” key (the `b’ key on the keyboard). When pressed, the TV should automatically switch back to current channel after 10 seconds. You may pick one you like to implement, and will earn extra 1 point toward the course grade.