element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Blog Entering The World Of FPGA's with a DEO-NANO P0082 - Part 5 (modelling a M74HC590)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 24 Aug 2017 7:17 PM Date Created
  • Views 4481 views
  • Likes 6 likes
  • Comments 28 comments
  • p0082
  • terasic
  • deo-nano p0082
  • de0-nano
  • enterfpga
  • p0082(terasic)
  • terasic p0082 de0-nano fpga development kit
Related
Recommended

Entering The World Of FPGA's with a DEO-NANO P0082 - Part 5 (modelling a M74HC590)

Former Member
Former Member
24 Aug 2017

Ive been recently using an M74HC590 binary counter to capture some data from an opto-encoder and thought that since I'd modelled a basic binary counter into the FPGA, why don't I go the whole hog and model this real world component into it too and make a final blog post in this series.

 

Here's the front page and the pinout  in the datasheet for the M74HC590 that I'll be modelling:

image

image

 

 

 

 

 

 

 

 

 

So we know what the inputs and outputs are of the device are but what about the way it functions internally? Well I looked through the datasheet and found a truth table that I could work things out from.

 

image

 

 

Using this data, I made up the following Verilog file:

 

image

 

 

 

 

 

 

 

 

 

 

As you can see Ive copied the pin labels etc.. and used nested if's to do most of the logic.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

image

 

 

 

Once were happy with the Verilog file, we generate the board symbol shown here. Theres the corresponding input pins and the output pins QA throught to QG are shown as a single wire representing the 8bit output bus.

 

 

 

 

 

In the following schematic, Ive added the symbol for the Verilog file and made some connections to it:

 

image

 

 

 

The CCKEN and G pins have been connected to an internal Ground and CCLR has been connecting to an internal voltage source (VCC). These could have been broken out to real pins on the DE0-NANO P0082 board and connected manually but I did it this way for simplicity.

 

The RCK and CCK pins have both been connected to a push button on the development board.

 

The QA - QG outputs have all been connected to the LED's on the development board and the RCO pin has been left unconnected for the time being. This output would be connected to another 8-bit counter if they were being cascaded into a 16-bit counter.

 

 

 

From here it was just a case of assigning the LED's and pushbutton to the correct pins and the device is ready to test. The video at the bottom of this shows the final programmed development board. Because the CCK and RCK pins were attached to a push button, simply pressing that button causes the device to count up press by press.

 

Heres the compiler summary for the above component, very few of the actual resources were used (in most cases less than 1%):

 

image

 

 

Hopefully this gives an insight into how fpga's can be utilised by modelling existing components that we already know, this is the final blog post in this mini-series but I will be posting occasional updates of my progress on an rgb led matrix driver that Im working towards with the DE0-NANO. I intend to cheat a little bit to start with and initialise some registers with a test pattern while I work out how to drive the signal properly. Once that's done I can work backwards into a more complex design.
image

 

 

 

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 8 years ago in reply to rachaelp +5
    Yes Im planning on doing another post or 2 when I get underway with the led matrix display driver and then who knows maybe some other project in the future too. Hopefully others will stumble across this…
  • Former Member
    Former Member over 8 years ago in reply to michaelkellett +3
    Thanks for explaining! It does appear to function as expected so I'm going to call it a partial win, although I'm plenty sure that your explanation for why it's not the best way to go about it will become…
  • michaelkellett
    michaelkellett over 8 years ago in reply to Former Member +3
    Good luck - it's good for me to be forced to think about Verilog. I'll try to repeat your code in VHDL in the next few days and post it here so you can see the difference. MK
  • michaelkellett
    michaelkellett over 8 years ago in reply to rachaelp

    rachaelp wrote:

     

    completely free from all the main FPGA vendors and they all have a version of ModelSim bundled for simulation s

     

    Actually, TBP (To Be Pedantic) Lattice bundle a cut down version of Aldec HDL - I think it's much nicer to use than Modelsim. Xilinx Vivado has X's own simulator - it's quite usable too, and I think faster than the Lattice version of Aldec.

     

    On a tight budget and just starting I would recommend Lattice - hand solderable (well hotplate anyway) 48 pin parts with 4k LUTs and soon with a big embedded memory and about £5 for a chip as well as free tools and cheap dev boards (and open source tools as well if that's important to you).

     

    MK

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • johnbeetem
    johnbeetem over 8 years ago in reply to rachaelp

    rachaelp wrote:

     

    II think it would be great if the FPGA section of the forum became more lively and we got a lot more FPGA design related discussions going. I'm sure there is plenty of scope for some learning materials being produced and/or some sort of academy as you suggest if the subject starts to become more popular on the forums again.

    Thanks to Lucie's 'blogs, I think we've had more FPGA activity in the last month than in the previous two years.  Kudos!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rachaelp
    rachaelp over 8 years ago in reply to Former Member

    It seems there are quite a few people who are experienced FPGA designers on here and with the availability of low cost FPGA dev boards such as the one you are testing, and the free toolsets available from all the FPGA vendors, it's getting much easier for people to learn and use FPGA's than it's ever been before. I think it would be great if the FPGA section of the forum became more lively and we got a lot more FPGA design related discussions going. I'm sure there is plenty of scope for some learning materials being produced and/or some sort of academy as you suggest if the subject starts to become more popular on the forums again.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • johnbeetem
    johnbeetem over 8 years ago in reply to Former Member

    lucie tozer wrote:

     

    Heya! Thanks for the feedback

     

    Its actually really good to see a discussion around FPGA's that newbies to them can at least start to comprehend. I wonder if there room for an FPGA academy?

    Compared to microprocessors, FPGAs are a pretty esoteric subject.  When I look at how much success FPGAs have had over the decades I think of William Hogarth's father who had the brilliant idea of opening a coffee shop in London (early 1700s) where customers could only converse in Latin.  He spent 5 years in debtors' prison.

     

    I also think of the Old Professor in The Lion, the Witch, and the Wardrobe who said: "Logic!  Why don't they teach logic in these schools?"  It's my favorite line in the book, and they dropped it from the recent movie with the great Jim Broadbent as the Old Professor. image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rachaelp
    rachaelp over 8 years ago in reply to johnbeetem

    John Beetem wrote:

     

    From what I can tell, Verilog and VHDL are pretty equivalent for FPGA synthesis (and probably simulation). If you're designing FPGAs for a company, the choice is usually made for you based on what the company has done in the past. There used to be an East/West split in the USA with New England going for Verilog and California going for VHDL, which had to do with where Verilog and VHDL were first developed.

    In the UK and Europe, I think there is a much larger portion of companies using VHDL rather than Verilog. When I was looking at other opportunities for FPGA design (quite a few years ago now I admit) the vast majority of jobs specified VHDL as their requirement. But you are right, both languages are very capable and each have their strengths and weaknesses.

    John Beetem wrote:

     

    As an individual you have the luxury of taking a balanced look to see which is likely to suit your needs better. Sometimes it's availability of textbooks and/or web sites to get you started. Sometimes it's the availability of tools. For example, the open-source IceStorm tool chain for Lattice iCE40 has a Verilog synthesizer (yocto) but doesn't have a VHDL synthesizer.

    These days you can get the tools to do FPGA's in either Verilog or VHDL completely free from all the main FPGA vendors and they all have a version of ModelSim bundled for simulation so you shouldn't be restricted by tool availability when choosing which language to learn. They also all offer both Windows and Linux installs (but sadly not macOS).

     

    Best Regards,


    Rachael

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube