Home |
Search |
Today's Posts |
![]() |
|
Electronic Schematics (alt.binaries.schematics.electronic) A place to show and share your electronics schematic drawings. |
Reply |
|
LinkBack | Thread Tools | Display Modes |
|
#1
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
For a simulation situation I need a random number generator with a
twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#2
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson
wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? |
#3
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 13:27:06 -0500, John Fields
wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? John, What are you saying... take the outputs of the LFSR broadside to drive the address lines of the 'HC154? I think that would do it. Thanks also to Lasse for the same suggestion. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#4
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 11:53:10 -0700, Jim Thompson
wrote: On Wed, 01 Apr 2015 13:27:06 -0500, John Fields wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? John, What are you saying... take the outputs of the LFSR broadside to drive the address lines of the 'HC154? I think that would do it. Thanks also to Lasse for the same suggestion. ...Jim Thompson I was puzzling over how to get 0000, but then it dawned... just use an 8-bit LFSR and use the last 4-bits. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#5
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 12:10:24 -0700, Jim Thompson
wrote: On Wed, 01 Apr 2015 11:53:10 -0700, Jim Thompson wrote: On Wed, 01 Apr 2015 13:27:06 -0500, John Fields wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? John, What are you saying... take the outputs of the LFSR broadside to drive the address lines of the 'HC154? I think that would do it. Thanks also to Lasse for the same suggestion. ...Jim Thompson I was puzzling over how to get 0000, but then it dawned... just use an 8-bit LFSR and use the last 4-bits. ...Jim Thompson --- There's really nothing quite like that thrilling flash of discovery, is there? If you need 0000 out and you only want to use a 4 bit LFSR, then use XNOR feedback to force the lockup state to 1111 instead of 0000 and you'll magically jump over 1111 once per cycle. If you need an LFSR with a maximal length of 2^n instead of 2^n-1, then a pulse-stuffer is called for. If there's any interest I'll post a schematic. |
#6
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
Jim Thompson
Wrote in message: On Wed, 01 Apr 2015 11:53:10 -0700, Jim Thompson wrote: On Wed, 01 Apr 2015 13:27:06 -0500, John Fields wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? John, What are you saying... take the outputs of the LFSR broadside to drive the address lines of the 'HC154? I think that would do it. Thanks also to Lasse for the same suggestion. ...Jim Thompson I was puzzling over how to get 0000, but then it dawned... just use an 8-bit LFSR and use the last 4-bits. It would be less than random because 0000 is still less likely. Better to use a fast counter and latch it before the 154. Because it's not physical maybe you'd have to jiggle the fast clock with a large resistor to one of the bits, if Spice would have a tendency to make one clock an exact multiple of the other. -- |
#7
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 27 Apr 2016 15:19:18 -0400 (EDT), Tom Del Rosso
wrote: Jim Thompson Wrote in message: On Wed, 01 Apr 2015 11:53:10 -0700, Jim Thompson wrote: On Wed, 01 Apr 2015 13:27:06 -0500, John Fields wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? John, What are you saying... take the outputs of the LFSR broadside to drive the address lines of the 'HC154? I think that would do it. Thanks also to Lasse for the same suggestion. ...Jim Thompson I was puzzling over how to get 0000, but then it dawned... just use an 8-bit LFSR and use the last 4-bits. It would be less than random because 0000 is still less likely. Better to use a fast counter and latch it before the 154. Because it's not physical maybe you'd have to jiggle the fast clock with a large resistor to one of the bits, if Spice would have a tendency to make one clock an exact multiple of the other. Did you notice you're replying to a YEAR OLD post ?:-) ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | The touchstone of liberalism is intolerance |
#8
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic
|
|||
|
|||
![]()
Tom Del Rosso wrote:
I was puzzling over how to get 0000, but then it dawned... just use an 8-bit LFSR and use the last 4-bits. OK, you don't want to just use the last N bits of the LFSR, as they will shift over VERY predictably. So, if you want to use N bits, you need to allow the LFSR to advance N clocks and then latch the N parallel bits for use. Jon |
#9
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 11:53:10 -0700, Jim Thompson
wrote: On Wed, 01 Apr 2015 13:27:06 -0500, John Fields wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson --- If you use something like an HC154 with an LFSR driving its address inputs to generate random one-hots on its outputs, will that work for you? John, What are you saying... take the outputs of the LFSR broadside to drive the address lines of the 'HC154? --- Yes. --- I think that would do it. --- OK :-) --- Thanks also to Lasse for the same suggestion. --- He posted earlier than I did, so the "win" is really his. Also, perhaps not immediately apparent is that he also posted that the length of the LFSR will determine the repeat of the one-hot sequence out of the demux. For example, if you use a maximal length 4 bit LFSR, the sequence will repeat every 15 clocks, while if you use a maximal length 8 bit LFSR the sequence will repeat every 255 clocks, and so on... John Fields |
#10
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson
wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Do you want to build hardware, or just Spice this? LT Spice has random signal generators. You could quantize one of them, and drive a decoder. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com |
#11
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 12:06:00 -0700, John Larkin
wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Do you want to build hardware, or just Spice this? LT Spice has random signal generators. You could quantize one of them, and drive a decoder. "For a simulation situation..." ;-) John F and Lasse have provided how to do it. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#12
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 12:08:34 -0700, Jim Thompson
wrote: ...snip... "For a simulation situation..." ;-) John F and Lasse have provided how to do it. ...Jim Thompson For simulation I'd use the built-in rand() function of LTspice, if you want gaussian instead of uniform distribution, use five rand()'s summed appropriately. You said you like to use PSpice only, so create a text file to use in a PWL type thingy THEN you can get completel control, likw distribution and the elusive 1/f etc, any type statistics you want. For Hardware to not have to go buy much, use the Soundcard and run it directly with either a repeating pattern of random values, or from a random number generator to get very long runs. The method of converting FROM the audio output [BW is 10Hz to approx 100kHz] is left to the 'student'] The point here is that you can get repeatable random sequences that are completely under your control. |
#13
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 14:07:40 -0700, RobertMacy
wrote: On Wed, 01 Apr 2015 12:08:34 -0700, Jim Thompson wrote: ...snip... "For a simulation situation..." ;-) John F and Lasse have provided how to do it. ...Jim Thompson For simulation I'd use the built-in rand() function of LTspice, if you want gaussian instead of uniform distribution, use five rand()'s summed appropriately. You said you like to use PSpice only, so create a text file to use in a PWL type thingy THEN you can get completel control, likw distribution and the elusive 1/f etc, any type statistics you want. For Hardware to not have to go buy much, use the Soundcard and run it directly with either a repeating pattern of random values, or from a random number generator to get very long runs. The method of converting FROM the audio output [BW is 10Hz to approx 100kHz] is left to the 'student'] The point here is that you can get repeatable random sequences that are completely under your control. I'm after "random" as in numbers 1-16, which will turn on specific I/Q components of a modulation "constellation", such as 16-QAM... building a carrier extractor with AGC and needed a stimulus ;-) ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#14
![]()
Posted to alt.binaries.schematics.electronic
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 12:06:00 -0700, John Larkin
wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... http://www.theregister.co.uk/2015/04...andom_numbers/ -- Boris --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com |
#15
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On 04/01/2015 02:00 PM, Jim Thompson wrote:
For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net |
#16
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs
wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#17
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Thu, 02 Apr 2015 05:14:13 +1000, Jim Thompson
wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson there is a bias with the 8-bit just use the last 4 bit idea. With 255 'clocks' all states but 0000 will occur 16 times while 0000 will only appear 15 - the cycle then repeats. The lack of the extra 0000 may cause the bias point to continually drift high. |
#18
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Thu, 02 Apr 2015 07:26:29 +1000, "David Eather"
wrote: On Thu, 02 Apr 2015 05:14:13 +1000, Jim Thompson wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson there is a bias with the 8-bit just use the last 4 bit idea. With 255 'clocks' all states but 0000 will occur 16 times while 0000 will only appear 15 - the cycle then repeats. The lack of the extra 0000 may cause the bias point to continually drift high. I was wondering about that myself... I'll see if there's a cure. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#19
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On 4/1/2015 6:31 PM, Jim Thompson wrote:
On Thu, 02 Apr 2015 07:26:29 +1000, "David Eather" wrote: On Thu, 02 Apr 2015 05:14:13 +1000, Jim Thompson wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson there is a bias with the 8-bit just use the last 4 bit idea. With 255 'clocks' all states but 0000 will occur 16 times while 0000 will only appear 15 - the cycle then repeats. The lack of the extra 0000 may cause the bias point to continually drift high. I was wondering about that myself... I'll see if there's a cure. Do a search on the Xilinx web site for app notes on LFSR. Peter Alfke published one which adds a few gates to specifically inject the zero state.... or you can just use a much larger LFSR so that the small bias is in the noise. If you use a short sequence LFSR you may see the artifacts in your signal anyway. Remember this is only pseudo-random. Is 255 length sequence long enough for your needs? -- Rick |
#20
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On 2.4.15 01:31, Jim Thompson wrote:
On Thu, 02 Apr 2015 07:26:29 +1000, "David Eather" wrote: On Thu, 02 Apr 2015 05:14:13 +1000, Jim Thompson wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson there is a bias with the 8-bit just use the last 4 bit idea. With 255 'clocks' all states but 0000 will occur 16 times while 0000 will only appear 15 - the cycle then repeats. The lack of the extra 0000 may cause the bias point to continually drift high. I was wondering about that myself... I'll see if there's a cure. ...Jim Thompson A longer LFSR is the simplest cure. 20 bits will give you a bias of one per million. Another possibility is to use a congruential generator, but it needs quite a lot of arithmetic, one multiply and one add. -- -Tauno Voipio |
#21
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On 2015-04-01, Jim Thompson wrote:
On Thu, 02 Apr 2015 07:26:29 +1000, "David Eather" wrote: On Thu, 02 Apr 2015 05:14:13 +1000, Jim Thompson wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson there is a bias with the 8-bit just use the last 4 bit idea. With 255 'clocks' all states but 0000 will occur 16 times while 0000 will only appear 15 - the cycle then repeats. The lack of the extra 0000 may cause the bias point to continually drift high. I was wondering about that myself... I'll see if there's a cure. r=(75*r+74)%65537 visits 0-65535 with no gaps. not that i'd want to build it using 74LS logic. -- umop apisdn |
#22
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 15:31:25 -0700, Jim Thompson
wrote: On Thu, 02 Apr 2015 07:26:29 +1000, "David Eather" wrote: On Thu, 02 Apr 2015 05:14:13 +1000, Jim Thompson wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: On 04/01/2015 02:00 PM, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson there is a bias with the 8-bit just use the last 4 bit idea. With 255 'clocks' all states but 0000 will occur 16 times while 0000 will only appear 15 - the cycle then repeats. The lack of the extra 0000 may cause the bias point to continually drift high. I was wondering about that myself... I'll see if there's a cure. ...Jim Thompson --- The cure is to force the counter into the all-zeros state (the lockup state if you're using EXOR feedback) once per cycle and then to force it back out again, like this: https://www.dropbox.com/s/r7ea52axx6q6fny/LFSR.asc?dl=0 which'll give you a bias-free sequence since the counter will step through all 256 states instead of just 255 John Fields |
#23
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 12:14:13 -0700, Jim Thompson
wrote: On Wed, 01 Apr 2015 15:07:54 -0400, Phil Hobbs wrote: ...snip.... How random? You could use a 16-bit PRBS made from two HC299 and an HC86. Feed back Q14 XOR Q13, and tap out four stages to a HC154 demux. If you need better randomness, use four PRBSes of different length. Cheers Phil Hobbs I just need semi-random enough to test a fast AGC. ...Jim Thompson Uniform distribution sounds like a great 'first' test. However, often modulators are not always set up to 'scramble' the data to create uniform distribution. Does that mean you should also check some weird distributions reflecting fixed/sloppy modulation? Especially if the 16 level space has any type of one to one relationship, like text, mime format, or images which have repeating patterns [don't they?] Anyway, just to be sure, you may want to try some weird distributions just to make certain the AGC doesn't respond to these 'patterns'. |
#24
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Thu, 02 Apr 2015 04:00:25 +1000, Jim Thompson
wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Jim do you have a model of a 7483? |
#25
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Tue, 14 Apr 2015 07:15:50 +1000, David Eather wrote:
On Thu, 02 Apr 2015 04:00:25 +1000, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Jim do you have a model of a 7483? or 74 x 283 |
#26
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Tue, 14 Apr 2015 07:20:03 +1000, "David Eather"
wrote: On Tue, 14 Apr 2015 07:15:50 +1000, David Eather wrote: On Thu, 02 Apr 2015 04:00:25 +1000, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Jim do you have a model of a 7483? or 74 x 283 Yes, also. I have a 16-long LFSR already running. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#27
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Tue, 14 Apr 2015 08:22:07 +1000, Jim Thompson
wrote: On Tue, 14 Apr 2015 07:20:03 +1000, "David Eather" wrote: On Tue, 14 Apr 2015 07:15:50 +1000, David Eather wrote: On Thu, 02 Apr 2015 04:00:25 +1000, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Jim do you have a model of a 7483? or 74 x 283 Yes, also. I have a 16-long LFSR already running. ...Jim Thompson Just if you ever need one again - this is a 3 chip LCG that I have mentioned before N1 = 5*n0 + 1 It has all 16 states and valid data is clocked in on the falling edge of clock. They are PNG files. Sorry to be so late to the party http://www.datafilehost.com/d/c37024f6 http://www.datafilehost.com/d/a0730ba3 |
#28
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Tue, 14 Apr 2015 07:15:50 +1000, "David Eather"
wrote: 7483 Yep. A PSpice model. Unfortunately I think it will only run on PSpice. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice ![]() | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food. |
#29
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson
wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Only vaguely on-topic, here is a noise generator experiment. The mess on the left makes 1-bit digital noise clocked at 1 MHz, like a linear shift register, just easier to draw. The issue at hand is what kind of lowpass filter to use to get approximately Gaussian noise. The 200 KHz filter is right out of AoE3 p 559. It looks fine in the audio frequency domain, but it's nothing like Gaussian. The 3-pole filter is a lot nicer. We're actually going to use a LFSR in an FPGA and do the serious filtering digitally, and drive a DAC with a little analog filtering afterwards. Version 4 SHEET 1 1316 680 WIRE 912 -64 848 -64 WIRE 1056 -64 912 -64 WIRE 1200 -64 1136 -64 WIRE 1248 -64 1200 -64 WIRE 1312 -64 1248 -64 WIRE 1200 -16 1200 -64 WIRE 368 64 208 64 WIRE 480 64 368 64 WIRE 208 96 208 64 WIRE 1200 96 1200 48 WIRE 720 112 656 112 WIRE 752 112 720 112 WIRE 432 128 400 128 WIRE 480 128 432 128 WIRE 208 208 208 176 WIRE 848 208 848 -64 WIRE 912 208 848 208 WIRE 1056 208 992 208 WIRE 1200 208 1136 208 WIRE 1248 208 1200 208 WIRE 1312 208 1248 208 WIRE 848 240 848 208 WIRE 400 256 400 128 WIRE 1200 256 1200 208 WIRE 400 368 400 336 WIRE 848 368 848 320 WIRE 1200 368 1200 320 FLAG 208 208 0 FLAG 368 64 NOISE FLAG 400 368 0 FLAG 720 112 SH FLAG 848 368 0 FLAG 912 -64 COMP FLAG 1200 368 0 FLAG 1248 208 LPF2 FLAG 432 128 CLK FLAG 1200 96 0 FLAG 1248 -64 LPF1 SYMBOL bv 208 80 R0 WINDOW 0 -63 105 Left 2 WINDOW 3 -131 174 Left 2 SYMATTR InstName B1 SYMATTR Value V=random(1.83e7*time) - 0.5 SYMBOL SpecialFunctions\\sample 560 96 R0 SYMATTR InstName A1 SYMBOL voltage 400 240 R0 WINDOW 0 -85 76 Left 2 WINDOW 3 -323 114 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value PULSE(0 1 0 0 0 500n 1u) SYMBOL bv 848 224 R0 WINDOW 0 -120 42 Left 2 WINDOW 3 -187 87 Left 2 SYMATTR InstName B2 SYMATTR Value V=sgn(v(sh)) SYMBOL res 1152 192 R90 WINDOW 0 69 58 VBottom 2 WINDOW 3 75 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 1K SYMBOL cap 1184 256 R0 WINDOW 0 51 15 Left 2 WINDOW 3 50 51 Left 2 SYMATTR InstName C1 SYMATTR Value 5n SYMBOL res 1152 -80 R90 WINDOW 0 69 58 VBottom 2 WINDOW 3 75 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 5K SYMBOL cap 1184 -16 R0 WINDOW 0 51 15 Left 2 WINDOW 3 50 51 Left 2 SYMATTR InstName C2 SYMATTR Value 150p SYMBOL ind 896 224 R270 WINDOW 0 -33 54 VTop 2 WINDOW 3 -39 51 VBottom 2 SYMATTR InstName L1 SYMATTR Value 17m TEXT 552 -48 Left 2 !.tran 25m TEXT 216 -72 Left 2 ;Noise Generator Test TEXT 208 -32 Left 2 ;J Larkin April 28, 2015 TEXT 432 240 Left 2 ;1 MHz CLOCK TEXT 640 352 Left 2 ;COMPARATOR TEXT 1056 48 Left 2 ;200 KHz TEXT 1056 312 Left 2 ;20 KHz TEXT 864 56 Left 2 ;DIGITAL TEXT 864 88 Left 2 ;NOISE -- John Larkin Highland Technology, Inc picosecond timing laser drivers and controllers jlarkin att highlandtechnology dott com http://www.highlandtechnology.com |
#30
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
Er, well.. surely an LFSR will be flat, not Gaussian, no?
Fortunately, there is an app\\\ transform for that: http://www.design.caltech.edu/erik/Misc/Gaussian.html shouldn't be too bad to implement on FPGA. Log can be very crudely obtained as the highest active ('1') bit position, and can be improved iteratively (by repeated squarings and bit-shifts, or Taylor series polynomial approximation methods). Obviously, to shoot it out of a DAC, the bounds must be strictly limited, so part of your spec will be how many sigma of Gaussian it's good for (usually 3 or so?). Which, in turn, implies that the argument of the log can't be near zero (which is what produces the peaky outliers), and certainly can't be zero exactly (which would be undefined), so perhaps the LFSR's inherent bias could be tuned to match the dynamic range of the desired output? Nah, probably not, not for any reasonable sequence length. So you'll have to do something ugly (and hopefully not badly behaved), like RND * scale + offset. There are also methods for that -- ensuring that an output of truncated, arbitrary range is calculated correctly from an even distribution in some other range. The geometric form is interesting, too; a random time delay could trigger a S&H of complementary (90 degree phase shifted) sine waves, and the other random number could feed a suitable arrangement of matched diode junctions or OTAs which computes the sqrt(ln(x)) function, and simultaneously controls the gain on the S&H buffers. The "random" time delay has a strictly bounded range, so it could be triggered on a fixed clock, 'computed', then 'registered' with a second S&H on the following clock pulse, to give regularly sampled outputs (same as you'd use extra D-flops to neaten up the transitions in a digital logic circuit). Who even needs a DAC? ![]() Or you could randomly sample a sin/cos table and vary the VREF into an MDAC, or... Tim -- Seven Transistor Labs, LLC Electrical Engineering Consultation and Contract Design Website: http://seventransistorlabs.com "John Larkin" wrote in message ... On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Only vaguely on-topic, here is a noise generator experiment. The mess on the left makes 1-bit digital noise clocked at 1 MHz, like a linear shift register, just easier to draw. The issue at hand is what kind of lowpass filter to use to get approximately Gaussian noise. The 200 KHz filter is right out of AoE3 p 559. It looks fine in the audio frequency domain, but it's nothing like Gaussian. The 3-pole filter is a lot nicer. We're actually going to use a LFSR in an FPGA and do the serious filtering digitally, and drive a DAC with a little analog filtering afterwards. Version 4 SHEET 1 1316 680 WIRE 912 -64 848 -64 WIRE 1056 -64 912 -64 WIRE 1200 -64 1136 -64 WIRE 1248 -64 1200 -64 WIRE 1312 -64 1248 -64 WIRE 1200 -16 1200 -64 WIRE 368 64 208 64 WIRE 480 64 368 64 WIRE 208 96 208 64 WIRE 1200 96 1200 48 WIRE 720 112 656 112 WIRE 752 112 720 112 WIRE 432 128 400 128 WIRE 480 128 432 128 WIRE 208 208 208 176 WIRE 848 208 848 -64 WIRE 912 208 848 208 WIRE 1056 208 992 208 WIRE 1200 208 1136 208 WIRE 1248 208 1200 208 WIRE 1312 208 1248 208 WIRE 848 240 848 208 WIRE 400 256 400 128 WIRE 1200 256 1200 208 WIRE 400 368 400 336 WIRE 848 368 848 320 WIRE 1200 368 1200 320 FLAG 208 208 0 FLAG 368 64 NOISE FLAG 400 368 0 FLAG 720 112 SH FLAG 848 368 0 FLAG 912 -64 COMP FLAG 1200 368 0 FLAG 1248 208 LPF2 FLAG 432 128 CLK FLAG 1200 96 0 FLAG 1248 -64 LPF1 SYMBOL bv 208 80 R0 WINDOW 0 -63 105 Left 2 WINDOW 3 -131 174 Left 2 SYMATTR InstName B1 SYMATTR Value V=random(1.83e7*time) - 0.5 SYMBOL SpecialFunctions\\sample 560 96 R0 SYMATTR InstName A1 SYMBOL voltage 400 240 R0 WINDOW 0 -85 76 Left 2 WINDOW 3 -323 114 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value PULSE(0 1 0 0 0 500n 1u) SYMBOL bv 848 224 R0 WINDOW 0 -120 42 Left 2 WINDOW 3 -187 87 Left 2 SYMATTR InstName B2 SYMATTR Value V=sgn(v(sh)) SYMBOL res 1152 192 R90 WINDOW 0 69 58 VBottom 2 WINDOW 3 75 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 1K SYMBOL cap 1184 256 R0 WINDOW 0 51 15 Left 2 WINDOW 3 50 51 Left 2 SYMATTR InstName C1 SYMATTR Value 5n SYMBOL res 1152 -80 R90 WINDOW 0 69 58 VBottom 2 WINDOW 3 75 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 5K SYMBOL cap 1184 -16 R0 WINDOW 0 51 15 Left 2 WINDOW 3 50 51 Left 2 SYMATTR InstName C2 SYMATTR Value 150p SYMBOL ind 896 224 R270 WINDOW 0 -33 54 VTop 2 WINDOW 3 -39 51 VBottom 2 SYMATTR InstName L1 SYMATTR Value 17m TEXT 552 -48 Left 2 !.tran 25m TEXT 216 -72 Left 2 ;Noise Generator Test TEXT 208 -32 Left 2 ;J Larkin April 28, 2015 TEXT 432 240 Left 2 ;1 MHz CLOCK TEXT 640 352 Left 2 ;COMPARATOR TEXT 1056 48 Left 2 ;200 KHz TEXT 1056 312 Left 2 ;20 KHz TEXT 864 56 Left 2 ;DIGITAL TEXT 864 88 Left 2 ;NOISE -- John Larkin Highland Technology, Inc picosecond timing laser drivers and controllers jlarkin att highlandtechnology dott com http://www.highlandtechnology.com |
#31
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Wed, 29 Apr 2015 02:16:52 -0500, "Tim Williams"
wrote: Er, well.. surely an LFSR will be flat, not Gaussian, no? Single bit digital noise has a PDF with two big impulses, about the worst approximation to Gaussian (or flat) imaginable. So you need to sum a LOT of them to get something sort of Gaussian... the Central Limit Theorem thing. Hence the 20 KHz filter. Higher-order filters work way better than single-pole ones. If you nab 16-bit words from the shift register, and not the single bit, you start with a basically flat histogram. Summing a modest number of them gets Gaussian pretty fast. That's harder to Spice. Fortunately, there is an app\\\ transform for that: http://www.design.caltech.edu/erik/Misc/Gaussian.html shouldn't be too bad to implement on FPGA. Log can be very crudely obtained as the highest active ('1') bit position, and can be improved iteratively (by repeated squarings and bit-shifts, or Taylor series polynomial approximation methods). Obviously, to shoot it out of a DAC, the bounds must be strictly limited, so part of your spec will be how many sigma of Gaussian it's good for (usually 3 or so?). We have a +-10 volt DAC range, and we figure that 1 volt RMS is a good number, and our 15-tap FIR filter will give us a crest factor of about 5.5. That sounds OK; I don't think our customers would want truly Gaussian noise with infinite voltage spikes. Which, in turn, implies that the argument of the log can't be near zero (which is what produces the peaky outliers), and certainly can't be zero exactly (which would be undefined), so perhaps the LFSR's inherent bias could be tuned to match the dynamic range of the desired output? Nah, probably not, not for any reasonable sequence length. So you'll have to do something ugly (and hopefully not badly behaved), like RND * scale + offset. There are also methods for that -- ensuring that an output of truncated, arbitrary range is calculated correctly from an even distribution in some other range. The geometric form is interesting, too; a random time delay could trigger a S&H of complementary (90 degree phase shifted) sine waves, and the other random number could feed a suitable arrangement of matched diode junctions or OTAs which computes the sqrt(ln(x)) function, and simultaneously controls the gain on the S&H buffers. The "random" time delay has a strictly bounded range, so it could be triggered on a fixed clock, 'computed', then 'registered' with a second S&H on the following clock pulse, to give regularly sampled outputs (same as you'd use extra D-flops to neaten up the transitions in a digital logic circuit). Who even needs a DAC? ![]() Or you could randomly sample a sin/cos table and vary the VREF into an MDAC, or... A tapped analog delay line is easy to Spice. If you poke in random values and evenly sum the taps, that amounts to summing a sucession of samples, so it does the Central Limit thing for you. And it's also a finite-impulse-response filter. Everything turns out the be the same thing, just looked at from different angles. I really need a histogram back end for LT Spice. Snarl, snap, I guess I'll have to make one. -- John Larkin Highland Technology, Inc picosecond timing laser drivers and controllers jlarkin att highlandtechnology dott com http://www.highlandtechnology.com |
#32
![]()
Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.basics
|
|||
|
|||
![]()
On Tue, 28 Apr 2015 21:38:58 -0700, John Larkin
wrote: On Wed, 01 Apr 2015 11:00:25 -0700, Jim Thompson wrote: For a simulation situation I need a random number generator with a twist... What I need to simulate is a "random" selection of one-of-16 outputs. Clock "speed" is 12.5kHz ;-) Built of 74HCxx parts is preferred... I have a full ensemble of those device in my PSpice library. Thanks in advance. ...Jim Thompson Only vaguely on-topic, here is a noise generator experiment. The mess on the left makes 1-bit digital noise clocked at 1 MHz, like a linear shift register, just easier to draw. The issue at hand is what kind of lowpass filter to use to get approximately Gaussian noise. The 200 KHz filter is right out of AoE3 p 559. It looks fine in the audio frequency domain, but it's nothing like Gaussian. The 3-pole filter is a lot nicer. We're actually going to use a LFSR in an FPGA and do the serious filtering digitally, and drive a DAC with a little analog filtering afterwards. I have a Daqarta "mini-app" for converting a uniform to an arbitrary distribution. I use Gaussian as the example. The Help page is at http://www.daqarta.com/dw_0oaa.htm. It includes a "Theory" section, plus the complete macro script (it's in Daqarta's own macro language, but I've added lots of comments). The basic method uses the inverse Cumulative Distribution Function (iCDF) with a lookup table. The trick is to create the proper table. Best regards, Bob Masta DAQARTA v7.60 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE Signal Generator, DaqMusiq generator Science with your sound card! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|