All About Circuits Forum Digital Logic Design Project game
 Register Blogs FAQ Members List Today's Posts Search Today's Posts Mark Forums Read

 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.

#1
12-29-2010, 11:23 AM
 ankur3000 New Member Join Date: Dec 2010 Posts: 9
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):

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.
#2
12-29-2010, 01:58 PM
 hgmjr Super Moderator Join Date: Jan 2005 Location: Tennessee, USA (GMT-6) Posts: 9,030 Blog Entries: 11

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
#3
12-29-2010, 01:59 PM
 Kermit2 Senior Member Join Date: Feb 2010 Posts: 2,420

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.
#4
12-29-2010, 02:13 PM
 ankur3000 New Member Join Date: Dec 2010 Posts: 9

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....
#5
12-29-2010, 02:33 PM
 hgmjr Super Moderator Join Date: Jan 2005 Location: Tennessee, USA (GMT-6) Posts: 9,030 Blog Entries: 11

Quote:
 Originally Posted by ankur3000 @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
#6
12-29-2010, 05:15 PM
 Kermit2 Senior Member Join Date: Feb 2010 Posts: 2,420

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.
#7
12-30-2010, 08:41 AM
 ankur3000 New Member Join Date: Dec 2010 Posts: 9

@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?

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

Thanks guys!
#8
12-30-2010, 01:19 PM
 hgmjr Super Moderator Join Date: Jan 2005 Location: Tennessee, USA (GMT-6) Posts: 9,030 Blog Entries: 11

Quote:
 Originally Posted by ankur3000 @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
#9
12-30-2010, 03:58 PM
 Georacer Super Moderator Join Date: Nov 2009 Location: Athens, Greece (GMT +2) Posts: 4,875

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.
#10
12-31-2010, 03:43 AM
 ankur3000 New Member Join Date: Dec 2010 Posts: 9

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.

 Tags design, digital, digital logic, dld, game, led game, logic, project

 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 excess-3 Homework Help 3 04-20-2010 03:41 AM svaibh Homework Help 1 08-18-2009 10:22 AM ferdi Homework Help 3 08-12-2009 12:43 PM yagmai Homework Help 1 05-19-2005 06:01 PM

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Electronics Forums     General Electronics Chat     The Projects Forum     Homework Help     Electronics Resources Software, Microcomputing, and Communications Forums     Programmer's Corner     Embedded Systems and Microcontrollers     Computing and Networks     Radio and Communications Circuits and Projects     The Completed Projects Collection Abstract Forums     Math     Physics     General Science All About Circuits Commmunity Forums     Off-Topic     The Flea Market     Feedback and Suggestions

All times are GMT. The time now is 12:22 AM.