UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor jasonyen
Visitor
3,679 Views
Registered: ‎01-23-2013

modeling 74191 counter on a Coolrunner 2

Jump to solution

Hello. First time poster here and a student in my 2nd term of Electronics Engineering Technology. I just got a Coolrunner 2 and am hoping to start building more circuits on it using VHDL rather than breadboarding (as fun as that can be). We've started learning a little VHDL in class but not much more than writing code to turning on some LEDs.

 

I was hoping that there was a library of code to emulate the 74xx series of ICs. I've done some Googling but haven't found anything regarding the chip I need for an upcoming lab which is a 74191 up/down counter. Any leads?

 

Also, can anyone recommend a good starter book for VHDL? Our Digital Systems textbook contains an HDL section in each chapter, but it's not a dedicated HDL instructional guide. Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
4,807 Views
Registered: ‎05-12-2011

Re: modeling 74191 counter on a Coolrunner 2

Jump to solution

You probably won't find anything specific to a 74191, or a library of 74 series logic parts either for that matter.  The logic itself is what you describe with VHDL, and the tools synthesize what you describe.  To describe a 3-input NAND gate for example, you describe something along the lines of outsignal <= not( insignal1 and insignal2 and insignal3);  That hardly requires a library. :-)

 

A counter is a very common construct, and essentially according to an input clock does the equivalent of count <= count + 1; (or -1 if you want a down-counter).  Of course you can get funky with the preset, reset, load, clear, enable and all that too, but it's just a bit more VHDL to describe the functionality you want.

 

So the counter itself is fairly trivial, the purpose of the exercise is to get you to learn enough VHDL to describe the logic you're after.  I would be very surprised if whatever VHDL book you picked up didn't have more than one example of a counter in it.  If you're impatient you could just hit up teh Googlez for "vhdl counter", just be careful you don't pick up any bad practices from random people who like to post code while you're still learning.

 

The best way to learn this stuff is to jump in and start doing it.  You don't even need any hardware, you can get started with a project and run it in the simulator and see all of the signals changing state.  Even the simplest of projects will give you good experience using the tools, which is half of the battle at least when you're starting out.  So find some tutorials or a book or two, and start in.  Then when you have specific questions about something you're trying to do that isn't working the way you expect it to, you can come here and give a detailed description of what you did, what you expected, and what actually happened and someone will help you out.

 

Let the learning begin!

 

Cheers,

-Doug

View solution in original post

0 Kudos
4 Replies
Visitor jasonyen
Visitor
3,677 Views
Registered: ‎01-23-2013

Re: modeling 74191 counter on a Coolrunner 2

Jump to solution

ok. I should have read the README first. Bob Elkind (eeteam00) has written a very helpful intro for newbies with tons of resource links including "VHDL/Verilog tutorials and book recommendations". So for book recs, I'll look into the linked threads. However, I've had less luck finding references to emulating the 74191 with VHDL code.

0 Kudos
Highlighted
Explorer
Explorer
4,808 Views
Registered: ‎05-12-2011

Re: modeling 74191 counter on a Coolrunner 2

Jump to solution

You probably won't find anything specific to a 74191, or a library of 74 series logic parts either for that matter.  The logic itself is what you describe with VHDL, and the tools synthesize what you describe.  To describe a 3-input NAND gate for example, you describe something along the lines of outsignal <= not( insignal1 and insignal2 and insignal3);  That hardly requires a library. :-)

 

A counter is a very common construct, and essentially according to an input clock does the equivalent of count <= count + 1; (or -1 if you want a down-counter).  Of course you can get funky with the preset, reset, load, clear, enable and all that too, but it's just a bit more VHDL to describe the functionality you want.

 

So the counter itself is fairly trivial, the purpose of the exercise is to get you to learn enough VHDL to describe the logic you're after.  I would be very surprised if whatever VHDL book you picked up didn't have more than one example of a counter in it.  If you're impatient you could just hit up teh Googlez for "vhdl counter", just be careful you don't pick up any bad practices from random people who like to post code while you're still learning.

 

The best way to learn this stuff is to jump in and start doing it.  You don't even need any hardware, you can get started with a project and run it in the simulator and see all of the signals changing state.  Even the simplest of projects will give you good experience using the tools, which is half of the battle at least when you're starting out.  So find some tutorials or a book or two, and start in.  Then when you have specific questions about something you're trying to do that isn't working the way you expect it to, you can come here and give a detailed description of what you did, what you expected, and what actually happened and someone will help you out.

 

Let the learning begin!

 

Cheers,

-Doug

View solution in original post

0 Kudos
Visitor jasonyen
Visitor
3,661 Views
Registered: ‎01-23-2013

Re: modeling 74191 counter on a Coolrunner 2

Jump to solution

Thanks a lot for your reply Doug. I suppose you're right. It's probably not as daunting as it looks and describing simple ICs in HDL does seem like a good way to learn HDL. Looking at the logic diagram on the 74191 data sheet immediately touched my ignorance and fear buttons but I'll man up and give it a go. I really appreciate the encouragement.

0 Kudos
Explorer
Explorer
3,655 Views
Registered: ‎05-12-2011

Re: modeling 74191 counter on a Coolrunner 2

Jump to solution

Everything relating to technology is daunting and difficult until you understand it, then once you do you wonder why you were ever intimidated in the first place.  Yes, jump in and start experimenting.  When you get stuck, ask good specific questions on here and someone will chime in and help you out.  You will find that the quality of the answers you get is entirely dependent upon the quality of the questions you ask, so make sure you include enough background info and details about what's got you stumped to make it easy for someone to give you a good answer.  We all had to start somewhere...

 

Cheers,

-Doug

0 Kudos