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 3016 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…
  • morgaine
    morgaine over 11 years ago in reply to johnbeetem

    John Beetem wrote:

     

    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.

     

    Yep, email provides the same kind of "vectored interrupt" mechanism, and even more efficiently if you use SMTP delivery to a personal MTA at home since that will then avoid polling at any stage of the message flow.  Unfortunately most people these days use mail offered by web sites of one kind or another, so it typically gets polled with a MUA or a browser and so the flow pattern is effectively the same as in RSS.

     

    Lots of good ways to swing the cat ...  all of them better than manually grabbing it by the tail. image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • 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
  • shabaz
    shabaz over 11 years ago in reply to DAB

    Hi DAB,

    Thanks! The BBB is perfect whenever some pulse train or control signals are needed to test out some hardware. Once it is on the network and wired up to the hardware then its convenient to work from further away on the laptop in a bit more comfort than USB-RS232 hard-wiring the PC to a circuit.

    Some cape that can do high-res data logging for a couple of channels would be nice, I hope someone creates one.

    • 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
  • 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
>
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