Jan 23, 2013
The way I have previously built pseudo random number generators is to take a register of some width and toggle some bits if the MSBit is 1. Then circular rotate left (MSBit becomes LSBit). The bits needed to be toggled, differ with the length of the register. That is: forever{ if( MSBit == 1) toggle some bits; circular rotate left }
This implementation has the problem that if the register value is zero, it remains zero. This means for an 8 bit register, you get pseudo random values between 1 and 255. Instead I changed the process so that the bits are toggled if the MSBit is 0. forever{ if( MSBit != 1) toggle some bits; circular rotate left } It can be implements with two of the datapath registers A0 = (A0 ^ D) <<1 (so conneted to si) A0 = A0 <<1 (so connected to si) Add two more states of A0=0 and you have a fix is case the register somehow gets a ff value.
Gawd I love datapaths!
Now the dead value is all ones and the PSoC logic starts up logic low. So for an 8 bit register, you get random values between 0 and 254. This is nicer for density signal generation. You do not have to initialize this hardware as it will start up with its initial values.
Rating:
Be the first to rate
Jan 10, 2013
Hasbro is about to retire a Monopoly marker and replace it with another. The new markers candidates are; a robot, helicopter, guitar, cat, or diamond rings. You can vote at their facebook page. Somehow they overlooked a PSoC token. I have taken the liberty of designing one and I ask you to contact Hasbro and give PSoC a write in vote. If the write in vote is not successful then maybe I can get Cypress to have a limited edition built. Your help is appreciated.
Rating:
Be the first to rate
|
||||||||||||||
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.


















