User:Cuddlyable3/Sandbox

From Wikipedia, the free encyclopedia

~

Proof of Pythagorean theorem by rearrangement of 4 identical right triangles. Since the total area and the areas of the trianges are all constant, the total black area is constant. But this can be divided into squares delineated by the triangle sides a, b, c, demonstrating that a² + b² = c² .
Proof of Pythagorean theorem by rearrangement of 4 identical right triangles. Since the total area and the areas of the trianges are all constant, the total black area is constant. But this can be divided into squares delineated by the triangle sides a, b, c, demonstrating that a² + b² = c² .
Example of generating an 8-bit CRC. The generator is a Galois type shift register with  xor gates placed according to powers (white numbers) of x in the generator polynomial. The message stream may be any length. After it has been shifted through the register, followed by 8 zeroes, the result in the register is the checksum.
Example of generating an 8-bit CRC. The generator is a Galois type shift register with xor gates placed according to powers (white numbers) of x in the generator polynomial. The message stream may be any length. After it has been shifted through the register, followed by 8 zeroes, the result in the register is the checksum.
Checking received data with checksum. The received message is shifted through the same register as used in the generator, but the received checksum is attached to it instead of zeroes. Correct data yields the all-zeroes result; a corrupted bit in either the message or checksum would give a different result, warning that an error has occurred.
Checking received data with checksum. The received message is shifted through the same register as used in the generator, but the received checksum is attached to it instead of zeroes. Correct data yields the all-zeroes result; a corrupted bit in either the message or checksum would give a different result, warning that an error has occurred.
A 4-bit Fibonacci LFSR with its state diagram. The xor gate provides feedback to the register that shifts bits from left to right. The maximal sequence consists of every possible state except the "0000" state.
A 4-bit Fibonacci LFSR with its state diagram. The xor gate provides feedback to the register that shifts bits from left to right. The maximal sequence consists of every possible state except the "0000" state.
A 16-bit Fibonacci LFSR. The feedback tap numbers in white correspond to a primitive polynomial in the table so the register cycles through the maximal number of 65535 states excluding the all-zeroes state. The state ACE1 hex shown will be followed by 5679 hex.
A 16-bit Fibonacci LFSR. The feedback tap numbers in white correspond to a primitive polynomial in the table so the register cycles through the maximal number of 65535 states excluding the all-zeroes state. The state ACE1 hex shown will be followed by 5679 hex.
A 16-bit Galois LFSR. The register numbers in white correspond to the same primitive polynomial as the Fibonacci example but are counted in reverse to the shifting direction. This register also cycles through the maximal number of 65535 states excluding the all-zeroes state. The state ACE1 hex shown will be followed by E270 hex.
A 16-bit Galois LFSR. The register numbers in white correspond to the same primitive polynomial as the Fibonacci example but are counted in reverse to the shifting direction. This register also cycles through the maximal number of 65535 states excluding the all-zeroes state. The state ACE1 hex shown will be followed by E270 hex.

Contents

[edit] Uses as Counters

The repeating sequence of states of an LFSR allows it to be used as a divider, or as a counter when a non-binary sequence is acceptable as is often the case where computer index or framing locations need to be machine-readable. LFSR counters have simpler feedback logic than natural binary counters or Gray code counters, and therefore can operate at higher clock rates. However it is necessary to ensure that the LFSR never enters an all-zeros state, for example by presetting it at start-up to any other state in the sequence. The table of primitive polynomials shows how LFSR's can be arranged in Fibonacci or Galois form to give maximal periods. One can obtain any other period by adding to an LFSR that has a longer period some logic that shortens the sequence by skipping some state(s), e.g. as tabulated in [1].

[edit] Uses in Cryptography

An LFSR can generate an extremely long sequence which can be used to encrypt valuable information, for example by combining bits from the LFSR with information bits in an xor gate. The resulting bit stream can only be decrypted by a receiver equipped with the same LFSR, atarting at the same state. Although an attacker might know or discover the LFSR construction, as long as the starting state is kept as a secret key the attacker confronts a monstrous search problem.

Given an output sequence you can construct an LFSR of minimal size by using the Berlekamp-Massey algorithm.

[edit] Uses in Radio

  • GPS satellite radionavigation
  • CDMA cellular radio telephony


Bits Feedback polynomial Period
n 2n − 1
4 x4 + x3 + 1 15
5 x5 + x3 + 1 31
6 x6 + x5 + 1 63
7 x7 + x6 + 1 127
8 x8 + x6 + x5 + x4 + 1 255
9 x9 + x5 + 1 511
10 x10 + x7 + 1 1023
11 x11 + x9 + 1 2047
12 x12 + x11 + x10 + x4 + 1 4095
13 x13 + x12 + x11 + x8 + 1 8191
14 x14 + x13 + x12 + x2 + 1 16383
15 x15 + x14 + 1 32767
16 x16 + x14 + x13 + x11 + 1 65535
17 x17 + x14 + 1 131071
18 x18 + x11 + 1 262143
19 x19 + x18 + x17 + x14 + 1 524287
25 to 168 [2]


[edit] Approximations

Image:normal_gen_approximations.gif

Any digital generator of Gaussian pseudo-random samples must make these approximations.

    • Truncate the tails that extend to infinite sample values. Two ways to do this are:
      • see Fig. a). The result is part of a Gaussian distribution plus a uniform distribution with the same range
      • see Fig. b). The result is a distorted (when normalised) part of a Gaussian distribution
    • see Fig. c). Sample values must be quantised to fit the finite length of binary numbers in use.

The sizes of these approximations must be chosen with regard to the intended use of the samples. Thus there is no single "right" choice.

[edit] Ziggurat algorithm

The motivation behind the ziggurat algorithm is that the majority of the samples of a non-uniform distribution such as the Gaussian that would be generated by calculating a transcendental (costly) can be provided instead by combining uniform distributions from PRNGs (cheap).

The PRNGs are assigned to layers of the area under the intended distribution curve. After above approximations, the layer areas on the left of the curve should be equal. They will be selected randomly by index and over long time each layer is selected the same number of times. (One may conveniently use a maximal-length n-bit PRNG shift register to select (2n-1) layers.)

A version of the algorithm described by Marsaglia, Tsang, Doornik et al. establishes a set of points on the curve using the approximation

xn(yn+1-yn) = A constant

These are equal-area rectangles that are larger, by varying degrees, than the curve-bounded areas that they include. The disproportionality means that corrresponding ranges of sample values are relatively under-represented in the output, whose distribution is distorted as shown in Fig. d). That distortion may be reduced (but not eliminated) by using more layers. The diagram shows the case of the coordinates provided here by anonymous user 71.41.210.146 .

[edit] Distortionless Ziggurat Algorithm

Two conditions together allow the distortion in Fig. c) to be avoided:

    • Select layer coordinates that satisfy

erf(xn)-erf(xn+1)-yn(xn-xn+1)+xn+1(yn+1-yn)

    • Whenever a sample is rejected at a layer, try again using a new PR sample to the same layer. Due to the rarity of such cases they do not slow the algorithm significantly.

[paste starts] This article would greatly benefit from illustrations. Also, are the injectors ever mounted directly over the cylinder head (replacing intake valves)? What is their injection pressure? What does an injector look like? Does it have a single or multiple outlet holes? I assume the output is an atomized mist, right?

As per your request I have drawn and uploaded a diagram to the front page of the article. An injector looks like a small syringe made of tough metal about 80mm long with a single outlet although theres a device in it so when it sprays the fuel comes out in tiny atomised globules rather than one continous stream of fluid. If there are any issues with the diagram please let me know here, I will be watching the page for approximately one month. ta --WikipedianProlific </wiki/User:WikipedianProlific>(Talk) </wiki/User_talk:WikipedianProlific> 18:23, 13 July 2006 (UTC) Please replace the label "GAS" with "FUEL". Objections to "GAS" have been thoroughly discussed in connection with the diagram of the Carburetor and they apply equally to the Fuel injector.Cuddlyable3 </w/index.php?title=User:Cuddlyable3&action=edit> 18:49, 8 February 2007 (UTC) I agree wholeheartedly. That has been bugging me for some time. The fual will not necessarily be petrol (gasoline). The intro of the autogas </wiki/Autogas> article also gives some background to why this is a problem. --Athol Mullen </wiki/User:AtholM> 21:58, 8 February 2007 (UTC) I have replaced the diagram with an animated one that receives FUEL, shows the solenoid winding and has removed unhelpful lines and legends.Cuddlyable3 </w/index.php?title=User:Cuddlyable3&action=edit> 15:56, 6 March 2007 (UTC) It's an excellent diagram you've put up, but I fear it will probably be deleted unless you re-upload it with proper copyright tagging. Just a note in the comment section saying you created it generally isn't sufficient to prevent such deletion, and it'd be a shame to lose this and the other images you've put together. It looks as if you've been alerted to this issue on your talk page, for pretty much every image you've uploaded. What is the difficulty you're experiencing selecting the applicable copyright tag from the dropdown menu on the upload screen...? --Scheinwerfermann </wiki/User:Scheinwerfermann> 19:14, 6 March 2007 (UTC) Thank you. I am not happy about some white spots that became evident to me after the animation was uploaded and resized. For each diagram I have loaded, I have checked "Public domain" but that has not prevented the automatic "untagged" warning that appears a little later. I am willing to try again. Cuddlyable3 </w/index.php?title=User:Cuddlyable3&action=edit> 21:11, 11 March 2007 (UTC) I have reverted the new animated diagram to the older static one. Please disregard the animated diagram until such a time as the mechanism it shows is more detailed and correct, if it is a point of contention then I shall do it myself. At the moment its[sic] an animated bastardisation of one of my diagrams: </wiki/Image:Fuelinjector.png> </wiki/Image:Fuelinjector.png>. There seems to be confussion[sic] about where compression occurs and the complex solenoid system is rather simplified. (WP:RPA) Even under the free license agreement I should still be credited on the images page for creating it, not just 'an improvement on another wikipedia diagram', the free license agreement allows one to edit my work shamelessly, but it doesn't permit one to take work without proper credit. I was unhappy with the quality of the two new diagrams, which I do not feel is up to wikipedia's standards. As a result I have redrawn them myself, Gas has been changed to Fuel by popular demand. WikipedianProlific </wiki/User:WikipedianProlific>(Talk) </wiki/User_talk:WikipedianProlific> 02:18, 18 March 2007 (UTC) Wikipedia warns anyone submitting work that it may be viewed critically and edited by anyone. I don't think a reversion becomes justified by the kind of language that WikipedianProlific is using here - words like "shamelessly" and "bastardisation" are ad hominem. Wikipedia provides traceability of contributions but is not the place to build a gallery of anyone's own art. I consider neither </wiki/Image:FuelInjector2.gif> </wiki/Image:FuelInjector2.gif>nor </wiki/Image:Fuelinjector.png> </wiki/Image:Fuelinjector.png>as beyond improvement and it may become necessary to ask for arbitration between them. I intend to wait a few days, and then possibly revert to whichever diagram gets more consensus. There is nothing to say here about "some rather unpleasent postings" that WP has since withdrawn from his user page.Cuddlyable3 </w/index.php?title=User:Cuddlyable3&action=edit> 15:59, 19 March 2007 (UTC) First off I mean no offense by use of words like bastardisation, it just means something thats the product of many different sources. Also I hope you don't mind but I resized those two images above just to save scrolling space and load times. I wish to point out that this isn't a revert war case. There was my original diagram. Then there was your animated version. Then there was my second diagram which was revised from the first diagram to resolve the issues that you had with it. The main reason I did this was because I had a few problems with your animation; 1.) There appears to be explusion of fuel from the nozzle prior to the spring moving forward, this isn't mechanically the case. 2.) I felt that the animation was not of a high enough level of quality compared with the static diagram to warrant is placement in the article. 3.) I was unhappy that although my work was submited under a free license agreement that it was not probably cited in your version. I am still entitled to be credited for its inception. However I realised at the time that you probably didn't know this and so let it slide, in future please be careful though. I wish to find a mutual resolution to this as I feel the need to point out that I really have no personal interest in it, I simply wish the article to be the best it can be, and I have no wish nor intention to upset you in that process. How would you feel about using both a corrected animated version and the static version? I Think they both add something to the article in there own way and that this may be a good solution? As for what has been said on my user page, (WP:RPA) I do not use wikipedia as an art gallery. I use deviantart.com and my own website as a gallery and none of these images are on either. What I do for wikipedia I do for free. The gallery on my userpage isn't a pompous exhibition of my 'skill', but rather a way for me to rapidly click on and access diagrams I've uploaded. It's like a list of quick links. It also serves as examples to people looking to request that I draw diagrams. Most of the work I do is by request, generally I don't seek out pages in need of art. WikipedianProlific </wiki/User:WikipedianProlific>(Talk) </wiki/User_talk:WikipedianProlific> 16:24, 19 March 2007 (UTC) [paste ends]

Regarding WikipedianProlific's comments:

There seems to be confussion[sic] about where compression occurs

No compression of fuel occurs in the injector depicted. It is a valve not a pump.

the complex solenoid system is rather simplified.

A solenoid-operated injector (not a piezo-operated injector) is depicted. The solenoid comprises
  • A winding of insulated wire. The windings are shown in [2] consistently with the cut-away view but in [1] they are presumably meant to be understood by a draughtsman's shortcut of two crossed diagonal lines.
  • A movable, spring-loaded ferromagnetic slug, shown blue in [2]

1.) There appears to be explusion of fuel from the nozzle prior to the spring moving forward, this isn't mechanically the case.

The actual operating sequence is:
  • i) No current in solenoid, spring relaxed, valve closed
  • ii)Current in solenoid, spring compresses, valve opens
  • iii)Fuel spray emitted
  • iv) Return to i)

I agree that the 3-step animation looks ambiguous and that this is room for improvement.

Please disregard the animated diagram until such a time as the mechanism it shows is more detailed and correct, if it is a point of contention then I shall do it myself...How would you feel about using both a corrected animated version and the static version?

You may copy freely anything of my work in Wikipedia that you find useful. When do you propose showing a new version?