5. Write a retro version of the 1970s classic kill the bit computer game for the DE...

Question:

5. Write a retro version of the 1970’s classic kill the bit computer game for the DE board.

The goal in the kill the bit game is to turn off all of the four LEDs using the four pushbuttons. The game starts with an initial non-zero pattern displayed in the LEDs. The pattern constantly does a circular shift moving through the LEDs in a loop with a time delay to slow down the shifts. If you hit one of the four pushbuttons exactly when the the same number LED is turned on, it will turn off one LED in the pattern. If you hit a pushbutton and it’s LED is off another LED turns on.

Here is how the program works. Each time just before the pattern shifts, the pattern is bitwise exclusive or’ed with one input sample from the pushbuttons to generate a new pattern. When both the pushbutton is pushed and its corresponding bit in the pattern are High, one less bit will be High in the new pattern after the exclusive or (i.e., 1 xor 1 is 0).

After the shift, one less LED will be turned on since there is one less “1” in the new pattern. If your timing is off and the LED is not turned on when you hit the pushbutton, a new high bit will be generated in the pattern (i.e., 1 xor 0 is 1). When this happens, the new “1” bit in the pattern lights another LED. Note that you need a “1”

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Rapid Prototyping Of Digital Systems

ISBN: 9780387726700

2nd Edition

Authors: James O Hamblen, Tyson S Hall, Michael D Furman

Question Posted: