7-Seg Clock using only logic gates and Flip Flop

Thread Starter

kompteck

Joined May 4, 2010
8
OK this is my first post here and hope to contribute in the future. Right now hopefully someone here and help me out here.

Ok heres the project im trying to do and the problem Im having.

Idea:
Im trying to make a 7-segment clock using only logic gate and flip flops fully inside a CPLD.

Problem:
So far im doing the ones place for the minutes section of the clock. I got my basic next state equations and the combinatorial logic part built, example for the logic if I put in 1111110, then 0110000 comes out as expected from my equations. The problem lies when I add the flip flips to the logic part. In my set up the first state isnt 0000000 so I have to preset and clear the FF's to get the counter started but that said the FF's cant accept the next value because they are not set to accept the next values due to the preset and clear values set. The FF's present and clear need to be changed to VCC after the first clock edge and stay the way indefinitely. I have been trying to add things to the P/C's pin (where the GND is in the attached pic) but havent been able to get it to work.

Anyone have any ideas on how to fix this? I have one but it would require a whole new design.

I using the standard A,B,....,G as the labeling of the led's

Next State
A B C D E F G | A+ B+ C+ D+ F+ G+
------------------------------------
1 1 1 1 1 1 0 | 0 1 1 0 0 0 0 Zero => One
0 1 1 0 0 0 0 | 1 1 0 1 1 0 1 One => Two
1 1 0 1 1 0 1 | 1 1 1 1 0 0 1 ....
1 1 1 1 0 0 1 | 0 1 1 0 0 1 1
0 1 1 0 0 1 1 | 1 0 1 1 0 1 1
1 0 1 1 0 1 1 | 1 0 1 1 1 1 1
1 0 1 1 1 1 1 | 1 1 1 1 1 1 1 ....
1 1 1 1 1 1 1 | 1 1 1 1 0 1 1 Eight => Nine
1 1 1 1 0 1 1 | 1 1 1 1 1 1 0 Nine => Zero
 

Attachments

Thread Starter

kompteck

Joined May 4, 2010
8
Yes that sounds like a excellent idea but I haven't learned enough about VHDL to attack this problem that way yet.

I am using Quartus and just doing everything with the block diagrams and symbols.

If I could just figure out how to stick those pins to VCC after the first clock cycle this would work just fine.
 

Thread Starter

kompteck

Joined May 4, 2010
8
Well for those interested I as able to get it working but only after a total redesign. I ended up making a binary decoder. I have attached my design for those who might find it useful.

I have attached the design files. I used VHDL and some FF's. I did not supply the code but I did attach the block diagram realized from the VHDL and FF schematic diagram.
 

Attachments

kingdano

Joined Apr 14, 2010
377
yikes.

5 am verilog session...


edit: VHDL, not verilog, my bad.

in all seriousness though, you should try to avoid "coding" the CPLD using schematic entry in the future, it is an inefficient way to code things and may use more resources than required.

most compilers are smart enough to reduce your schematics complexity if possible though - but it is still not good practice.

kudos for the effort though, well done.
 

Thread Starter

kompteck

Joined May 4, 2010
8
Thanks. Im just learning this stuff. Ive only been using Quartus for a semester. The combinational logic was done in VHDL then I added the FF's. Im sure once I get more experience I'll be able to do the whole thing in code. So far though Quartus seems to do a pretty good job at reducing the cell count when I compile. I can watch it drop as it get compiled.

If anyone is interested I'll post the whole project when I complete it.
 

GopherT

Joined Nov 23, 2012
8,009
I suggest you download a digital circuits simulator. Such as digital works, which is rather easy to use.
Look at Post #1 again,

hey mate i and doing the same project could you please help me out
The OP didn't state how he was approaching the problem, how far along he was, where he was stuck... he just said, "...please help me out". Why teach a man to fish if he clearly wants to buy a tasty McDonald's Filet-O-Fish sandwich.

EDIT:
It is also possible that he is expecting someone to give him a tasty McDonald's Filet-O-Fish sandwich.
 
Top