element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 Programmable Logic Project: Pseudo-Random Noise Generator
  • 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: shabaz
  • Date Created: 18 Oct 2013 2:07 PM Date Created
  • Views 3017 views
  • Likes 4 likes
  • Comments 11 comments
  • programmablelogicch
  • cpld
  • xilinx
  • beginners
  • beginner
Related
Recommended

Programmable Logic Project: Pseudo-Random Noise Generator

shabaz
shabaz
18 Oct 2013

Introduction

In the desire to search for an interesting project involving programmable logic, this one seemed attractive – it is a two-stage design and it is low cost and has fast results (less than an hour to build this current stage 1 if that is all you’re interested in), easy to demonstrate with just a pair of headphones or a lamp, and depending on how far you want to take the extended circuit (covered in another post since that circuit is not directly relevant to programmable logic), it covers many diverse domains such as digital logic, programmable logic, digital and analog signal processing (including digital filtering), op-amp math, filters and frequency analysis.

image

What is needed?

At a minimum, a CPLD (complex programmable logic device) board and an oscillator are needed. Total cost is less than about £20 or $30USD and you can reuse the CPLD board for other projects if a socket is used. A few other parts are commonly available and you may already have them.

 

To program the CPLD, a BeagleBone Black (BBB) is needed (there have been lots of discussions in the forum on using a BBB as a general-purpose test instrument, and I often use it to generate high speed pulses among other tasks. Here, the BBB is used as a Xilinx programmer).  A Raspberry Pi if you have one could also work as a programmer but I did not try it.

 

What does it do?

It generates reasonable quality noise. An oscilloscope trace here shows the output and frequency spectrum described later. This is highly useful for test purposes and some example uses are shown. When you don’t need noise the CPLD can be reprogrammed. So, the circuit is useful as a development board for programmable logic learning too.

image

How can the CPLD be programmed for custom tasks?

There are a few ‘hardware description languages’ (HDLs) that can be used for this. A later post will detail step-by-step how to go about this. For now, the compiled file is attached that can be instantly downloaded onto the CPLD and prove that the board works.

 

The Circuit

The circuit shown here can be simplified further if desired. It is possible to remove the regulator U2 and the surrounding capacitors, and it may be possible to power the circuit from two AA batteries (this is slightly outside the threshold for the oscillator but it worked for me). The FB1 inductor is desirable but optional, if you don’t have it just replace with a wire.

image

After construction, the board is programmed with a BBB as shown here.  If you want to connect headphones to the output as a test, insert a resistor of about 1k in series.

Here are photos of the constructed circuit. The holes on the right are where the BBB temporarily connects for programming.

image

 

Here is the underside showing the oscillator. Square-pad board is preferable to stripboard for this project and sometimes for many other surface mount projects too. The oscillator is surface mount (unfortunately it’s not easy to find a through-hole 3.3V oscillator) but the pads on it are about as large as the prototyping board, so it is easy to solder as shown in the photo below.

image

 

Once it has been assembled and programmed (it should take just 3 or 4 seconds with the BBB) you should see a pseudo-random sequence egressing from the Digilent CPLD board. You can see it on an oscilloscope, or clearly hear it with headphone in series with a 1k resistor as mentioned. The oscilloscope view earlier shows the signal and the frequency spectrum (stretching out to infinity).

 

Other Ideas

Here is an alternative use for the noise:

image

The oscillator has been replaced with a 7555 timer (not 555, since it needs to operate at a lower voltage) for a slow clock of about 100Hz. The output is connected to any driver (e.g. an N-channel MOSFET) and then to a lamp in this example. Here a slow clock was used to simulate a flickering candle type effect perhaps for Halloween. CPLDs are cheap but microcontrollers like PICs are cheaper, so a flickering candle effect is more cost-effective with a microcontroller of course. In this video, I just used the BBB to generate the clock since it was handy, instead of wiring up a 7555 (quicker writing some code than wiring up the chip :-)

 

<video missing : ( >

image

 

That’s it. Not sure how long the lamp will last :-) I ran it from 9V instead of 12V to look after it a bit. Perhaps it could be pre-heated with some current in the off state.

You could now perhaps try the extended circuit in the next post (which uses the same programmed CPLD with no modifications but just extends the circuit further), or start planning a new project using the board. A step-by-step walk-through of the code will be the subject of another post.

 

The bitfile is attached below, but if desired the source is available here: Pseudo-Random Noise; Using it and How to Create it

Attachments:
out.zip
  • Sign in to reply

Top Comments

  • morgaine
    morgaine over 11 years ago in reply to shabaz +1
    shabaz wrote: Oh, very cool. I've downloaded QuiteRSS and it's very fast. I'm subscribing up to feeds.. :-) To keep it fast (and more secure), disable Javascript in QuiteRSS's Options. Since you can always…
Parents
  • morgaine
    morgaine over 11 years ago

    This is a nice article from shabaz --- it has become quite a habit! image

     

    A note for Drew though, and it's quite a worry actually.  I would never have found this blog post if shabaz hadn't accidentally posted it under BBB Blogs first, before it was moved by direct request to admins.  That accidental miss-post caused it to appear  in my RSS feed and so I had a permanent link to it despite the article having vanished from its original place.  If I had merely been visiting the various locations of interest manually I would never have found it at all.  (I am a member of the FPGA group but because it has so little traffic I never look there and I never even had it in my RSS feeds, until now).

     

    This really highlights a general issue here --- there is so much great information, but so many ways not to find it, or to lose it subsequently because search listings are truncated.  I'm not sure what the solution is, but I just want to note that information access here is not a solved problem.

     

    Perhaps some kind of site-wide visualization screen would help, not showing articles like in the many screens of recent activity (that's far too much data) but merely the number of new items under each area since it was last visited.  Something is needed to help us I think, although exactly what is a difficult question.  (This might be a good topic for Top Members.)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 11 years ago in reply to morgaine

    Hi Morgaine,

     

    Thanks!

    Yes, good point. I had originally placed a request at the top which Drew noticed, for an alternate group, and he noticed the fpga-group one, which I had not noticed before either but I have started to look at now, so it's true there is a lot of stuff on

    the site which we might miss.

    I don't use RSS feeds but your comment has made me think I should investigate that for my mobile; I'm currently

    under-using information capabilities I think - so, I agree, it is good if we share ideas/tips on how to find stuff on the site

    (and expecting it will be improved with the site upgrade that will occur.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • morgaine
    morgaine over 11 years ago in reply to shabaz

    RSS is perhaps the only way to keep tabs on Element14 without going totally nuts, currently. image

     

    With so many groups, communities, hierarchical levels which I'm not sure have a general name, and then blogs in each of them and for each user, this place delivers a very complex snowstorm of information, like a small version of Usenet.  Web browsers are not really set up to handle that by visiting areas through manual polling, not sensibly anyway.  RSS does the polling for you, and when something new appears then you notice it immediately without expending time and effort in manual scans.

     

    It's like a vectored interrupt for the human, and with a good client (I use QuiteRSS -- http://code.google.com/p/quite-rss/ ) it can deliver a real interrupt if you wish since it sounds a customizeable audio notification when something new appears.  It's vectored in two senses, not only because it provides a direct link instead of requiring a scan, but also because you can click on "Open in External Browser" if you wish and the exact item pops up.  Very efficient use of human time, as well as avoiding the sheer effort of wading through E14 manually.

     

    (And Jive is pretty good at providing RSS links in most places of interest.)

     

    So yes, I recommend RSS. image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • johnbeetem
    johnbeetem over 11 years ago in reply to morgaine

    Morgaine Dinova wrote:

     

    RSS is perhaps the only way to keep tabs on Element14 without going totally nuts, currently.                    

    I've had good luck with e-mail notification.  I use this to monitor my 'blog entry, the FPGA group, the OSHW group, Embedded group, and BBB.  E-mail notification gives you a link to the 'blog entry in question so it's easy to get to.  [Edit: I do sometimes have to put up with a spam-like influx, such as when e14 gave away 500 LPC800 boards.  But that's rare.  Usually lots of activity in the e-mail suggests that the topic is interesting.]

     

    But I still miss a lot -- it's hard to say how much, or whether it would be of interest to me.  I've suggested before that comments made to 'blog entries should appear in the main Discussion list or there's no way to see that they're happening unless you use e-mail notification (and know what to monitor) or RSS.

     

    I'm glad to see activity in the FPGA group!  Every bit helps (especially bits that are documented image).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 11 years ago in reply to morgaine

    Oh, very cool. I've downloaded QuiteRSS and it's very fast. I'm subscribing up to feeds.. :-)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • shabaz
    shabaz over 11 years ago in reply to morgaine

    Oh, very cool. I've downloaded QuiteRSS and it's very fast. I'm subscribing up to feeds.. :-)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • morgaine
    morgaine over 11 years ago in reply to shabaz

    shabaz wrote:

     

    Oh, very cool. I've downloaded QuiteRSS and it's very fast. I'm subscribing up to feeds.. :-)

     

    To keep it fast (and more secure), disable Javascript in QuiteRSS's Options.  Since you can always launch a news page in your external browser with a single click anyway, even devout JS fans lose nothing, and it keeps it zoomy.  (You can add a button for "Open in External Browser" using Customize Toolbar.)

    • Cancel
    • Vote Up +1 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 © 2025 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