All About Circuits Forum  

Go Back   All About Circuits Forum > Electronics Forums > Homework Help

Notices

Homework Help Stuck on a textbook question or coursework? Cramming for a test and need help understanding something? Post your questions and attempts here and let others help.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 12-29-2010, 11:23 AM
ankur3000 ankur3000 is offline
New Member
 
Join Date: Dec 2010
Posts: 9
Default Digital Logic Design Project game

Hey guys, this is my first post on this website, so please excuse any mistakes.

Ok, now here is the problem:
I have to make a final project for my DLD course at college, and most students in this course end up making a clock (kind of a tradition for some reason), but I want to do something a little more challenging and different. Having looked around for quite some time about project ideas, I think i have found something, (see attached video link):

http://www.youtube.com/watch?v=0SG-Ftnpjns


I find this project really interesting but I am a little confused about how some of it will work:

*First, how can I generate random bytes for the top line of LEDs, so that the game is fair and somewhat challenging? My first thought is using counters but obviously they will be too predictable.

*Secondly, how can I make the same byte scroll down until the end? For this part, I was thinking flip flops but I am not sure.


Any kind of help would be appreciated. I know you guys would prefer if I had shown you some kind of effort before, but all I need is some guidance or just some kind of an idea for the afore mentioned problems.

Also any other project ideas of similar difficulty will be great.
Reply With Quote
  #2  
Old 12-29-2010, 01:58 PM
hgmjr's Avatar
hgmjr hgmjr is offline
Super Moderator
 
Join Date: Jan 2005
Location: Tennessee, USA (GMT-6)
Posts: 9,030
Blog Entries: 11
Default

This project is certainly feasible with generic digital logic.

I envision a 555 as the clock source that feeds a 3-bit binary counter. The three outputs of the 3-bit binary counter feed 3 shift registers. The output of the 3 shift registers go to 8 3-bit to 1-of-8 decoders. The output of the decoders feed the 8 by 8 LED matrix.

The paddle row is handled by a 3-bit up/down counter so that the paddle can move both left and right. The output of the paddle counter feeds its own 3-bit to 1-of-8 decoders. You can use a dual 4-bit digital comparator to test for hits.

To achieve some sense of randomness you can jam the counter feeding the top-row with a scambled version of the value of the paddle at the time it is sampled by the 555 timer.

These are just some stream-of-consciousness thoughts on one implementation of your project.

These ideas do not address the score keeping feature.

hgmjr
Reply With Quote
  #3  
Old 12-29-2010, 01:59 PM
Kermit2's Avatar
Kermit2 Kermit2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 2,385
Default

Some micro's now have a random function output available. If you search around the web(google) I'm sure you'll find it. (like I did several months ago)

The TETRIS game would be easy to do but difficult to explain if you don't already have an idea of how to accomplish the various tasks involved.

Counters, shift registers, logic comparison sections in several places (times) involving the users button pushes.

All simple things that are combined into one larger project. It should be a fun project.

Google up what you can about TETRIS and game programming. Those subjects might get you some good info.
__________________
I'm too old.
Reply With Quote
  #4  
Old 12-29-2010, 02:13 PM
ankur3000 ankur3000 is offline
New Member
 
Join Date: Dec 2010
Posts: 9
Default

Thanks for the help guys...I will look into it and get back to you abt it....

@hgmjr could you please explain how the scrolling will work...and the purpose of shift registers...I had completely forgotten abt decoders...make things much more simpler now...thanks

@Kermit2 I will look into Tetris as soon as possible...i am just having a hard time finding a good link for it..most links use a microcontroller....but we are not allowed to use it yet....
Reply With Quote
  #5  
Old 12-29-2010, 02:33 PM
hgmjr's Avatar
hgmjr hgmjr is offline
Super Moderator
 
Join Date: Jan 2005
Location: Tennessee, USA (GMT-6)
Posts: 9,030
Blog Entries: 11
Default

Quote:
Originally Posted by ankur3000 View Post
@hgmjr could you please explain how the scrolling will work...and the purpose of shift registers...
Scrolling is handled by a common clock source that feeds the 3 shift registers. That way the 3-bit value that is loaded into the top of the 3 shift registers will ripple down the matrix feeding each of the 8 3-bit decoders as it travels. The LSB of the counter at the top of the matrix will feed one of the shift registers, the middle bit will feed one of the shift register and the MSB out of the counter will feed the 3rd shift register.

I imagine that a second 555 will be needed to serve as the clock for the 3 shift registers. That way you can tweak the fall speed in proportion to the length of the game.

hgmjr
Reply With Quote
  #6  
Old 12-29-2010, 05:15 PM
Kermit2's Avatar
Kermit2 Kermit2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 2,385
Default

Two 555's at slightly different Freq's provide a clock signal for the project AND combined with some SR FF's provide a 3 bit quasi random number generator.



__________________
I'm too old.
Reply With Quote
  #7  
Old 12-30-2010, 08:41 AM
ankur3000 ankur3000 is offline
New Member
 
Join Date: Dec 2010
Posts: 9
Default

@hgmjr: Thanks a lot for the help, the whole project seems much simpler than I thought initially. I wanted to ask about the LED pattern, if you notice in the video, every OTHER byte fed into the LED matrix is a 0 (all LEDs off)...I think this is for giving the player enough time to move the paddle, for this I was thinking about using an AND gate with input1 as the output from the counter and the input2 as the output Qa (LSB from the counter). This way, at every other clock cycle, the output will be ANDed with 0, producing a 0 and hence the empty line.

I could do the same for all 3 bits of the top line. Would this work?

Thanks in advance!

@Kermit2: Thanks for your suggestion, I will definitely try it out in the final project.


Thanks guys!
Reply With Quote
  #8  
Old 12-30-2010, 01:19 PM
hgmjr's Avatar
hgmjr hgmjr is offline
Super Moderator
 
Join Date: Jan 2005
Location: Tennessee, USA (GMT-6)
Posts: 9,030
Blog Entries: 11
Default

Quote:
Originally Posted by ankur3000 View Post
@hgmjr: Thanks a lot for the help, the whole project seems much simpler than I thought initially. I wanted to ask about the LED pattern, if you notice in the video, every OTHER byte fed into the LED matrix is a 0 (all LEDs off)...I think this is for giving the player enough time to move the paddle, for this I was thinking about using an AND gate with input1 as the output from the counter and the input2 as the output Qa (LSB from the counter). This way, at every other clock cycle, the output will be ANDed with 0, producing a 0 and hence the empty line.

I could do the same for all 3 bits of the top line. Would this work?
In a 3-bit to 1-of-8 decoder "0" is a legitimate input. It would result in the left most or right most LED being illuminated.

An alternate approach that would work would be to add a 4th shift register to the 3 already being used. Each of the outputs of the 4th shift register would be fed to the enable pin on the corresponding 3-bit decoder. To get the alternate blank row you would then load the 4th shift register with alternating 1's and 0's. All four shift registers would share the same clock source. A significant benefit from the 4th shift register is that you could even use it to add 1 or more blank lines between active LED rows in order to change the game level accommodate beginners. All you would need to do is change the pattern of 1's and 0's fed into the 4th shift register.

hgmjr
Reply With Quote
  #9  
Old 12-30-2010, 03:58 PM
Georacer's Avatar
Georacer Georacer is offline
Super Moderator
 
Join Date: Nov 2009
Location: Athens, Greece (GMT +2)
Posts: 4,782
Default

About keeping score:

Suppose you have 8 columns, just like the video. You can wire each bit of the lower red line with the green line through a XOR gate. This way you can test if RedLED0 and GreenLED0 are both lit and one on top of the other. Duplicate this for all of the rest 7 pairs of LEDs. This way you have 8 XOR outputs. If all outputs are 0, all is fine, and you can generate a HIGH pulse to feed a counter. If not, a HIGH pulse should feed the lives counter.
If the lower red row is blank (two 4-input ORs) you should inhibit the 2 above signals because it's the "break" line.

Is that clear?
__________________
.
I am a prisoner of high standards and low social skills
____________________________________

I wish I was the best at what I would do, and what I would do wouldn't be pretty.
Reply With Quote
  #10  
Old 12-31-2010, 03:43 AM
ankur3000 ankur3000 is offline
New Member
 
Join Date: Dec 2010
Posts: 9
Default

Thanks for all the help guys.

@Georacer: I think using a comparator as hgmjr suggested would be a little more convenient, I could use 2 4-bit comparators or an 8-bit comparator and hook up the output of the comparator to the counters for score and lives.

But here is my question, what happens during the time when I am trying to move the paddle in the right location. The comparator might keep changing outputs because of the moving position of the LED and this will cause the counters to increase value even though I have not done anything yet.

I was thinking maybe adding a flip-flop between the comparator and the scoring counters, and I am not so sure but if I add the flip-flop the clock frequency must be half of the 4 shift registers.
Reply With Quote
Reply   Post New Thread

Tags
, , , , , , ,


Related Site Pages
Section Title
Worksheet Microcontroller principles
Worksheet Memory devices
Worksheet Flip-flop circuits
Worksheet Digital communication
Worksheet Latch circuits
Worksheet Digital display circuits
Worksheet Multiplexers and demultiplexers
Worksheet Electromechanical relay logic
Worksheet CMOS logic gates
Worksheet Binary math


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital logic design with MSI - Please Help excess-3 Homework Help 3 04-20-2010 03:41 AM
digital design project svaibh Homework Help 1 08-18-2009 10:22 AM
digital logic project ferdi Homework Help 3 08-12-2009 12:43 PM
Digital logic design yagmai Homework Help 1 05-19-2005 06:01 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:45 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.