{"id":24377676,"url":"https://github.com/enescang/linear-feedback-shift-register","last_synced_at":"2025-10-26T18:16:24.280Z","repository":{"id":123948093,"uuid":"499661395","full_name":"enescang/linear-feedback-shift-register","owner":"enescang","description":"Base logic of LFSR. Simulated with an array to better understanding","archived":false,"fork":false,"pushed_at":"2022-06-03T22:05:02.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T17:06:06.757Z","etag":null,"topics":["javascript","lfsr","random-number"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enescang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-03T21:54:17.000Z","updated_at":"2024-11-22T15:42:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac96c882-e8cb-4a29-8a57-a15bae49c9b7","html_url":"https://github.com/enescang/linear-feedback-shift-register","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/enescang/linear-feedback-shift-register","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enescang%2Flinear-feedback-shift-register","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enescang%2Flinear-feedback-shift-register/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enescang%2Flinear-feedback-shift-register/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enescang%2Flinear-feedback-shift-register/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enescang","download_url":"https://codeload.github.com/enescang/linear-feedback-shift-register/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enescang%2Flinear-feedback-shift-register/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281148243,"owners_count":26451709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","lfsr","random-number"],"created_at":"2025-01-19T06:16:34.069Z","updated_at":"2025-10-26T18:16:24.252Z","avatar_url":"https://github.com/enescang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Getting Started\nMy aim was just simulating the LFSR logic with flip-flops. So, i didn't use any operator other than ^ (XOR) operator.\nI am using a basic array to represent flip-flops. After clock tick we are pop out the last element from array and adding new bit to that array. \n\n\u003e In real we don't need array. Actually we shouldn't use. We are using bitwise operator to shifting bits. That's why bitwise are there.\n\n![Linear Feedback Shift Register](https://raw.githubusercontent.com/enescang/linear-feedback-shift-register/main/imgs/LFSR.png)\n## What is LFSR?\n \"(LFSR) is a shift register whose input bit is a linear function of its previous state.\" And XOR is a most commonly used linear function in LFSR. In theory we have several flip-flops and as known as every flip-flop has 1 bit. In every clock tick we are shifting whole bits. Then calculating the new bit based on some math function. Generally irreducible polynomials are using.\n\n\u003e There are different types of implementation. In this repo i am using\n\u003e Many-to-One type.\n\n## Example Output\nFlip-flops: [1, 0, 1, 1, 1, 0, 1, 1]\nTaps: [1, 2, 3, 7]\n| (index) | 0   | 1   | 2   | 3  | 4   | 5  | 6   | 7  | 8   | 9  |\n|---------|-----|-----|-----|----|-----|----|-----|----|-----|----|\n| 0       | 221 | 238 | 119 | 59 | 157 | 78 | 167 | 83 | 169 | 84 |\n## Basic Steps\n 1. Seed Flip-flops and set taps\n 2. Calculate new bit using XOR\n 3. Pop-out the last element from array\n 4. Add the new bit to beginning of array\n\n## XOR  Table\n| F1 | F2 | XOR |\n|--|--|--|\n|  0|1 | 1 |\n|  1|0 | 1 |\n|  0|0 | 0 |\n|  1|1 | 0 |\n\n## Conclusion\nThere are many applications of LFSR. I think LFSR is a great approach to create pseduo numbers. In this example i tried to simulate how LFSR works. \n\n\u003e Written with [StackEdit](https://stackedit.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenescang%2Flinear-feedback-shift-register","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenescang%2Flinear-feedback-shift-register","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenescang%2Flinear-feedback-shift-register/lists"}