{"id":16829685,"url":"https://github.com/rtfb/logisim-tiny-cpu","last_synced_at":"2025-10-14T13:41:03.816Z","repository":{"id":221333131,"uuid":"752962890","full_name":"rtfb/logisim-tiny-cpu","owner":"rtfb","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-08T07:34:29.000Z","size":320,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T20:54:11.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/rtfb.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":"2024-02-05T07:42:49.000Z","updated_at":"2024-02-05T07:44:36.000Z","dependencies_parsed_at":"2024-02-07T12:40:03.964Z","dependency_job_id":"2e914730-1dce-48f1-bf41-2df9a6bfa5be","html_url":"https://github.com/rtfb/logisim-tiny-cpu","commit_stats":null,"previous_names":["rtfb/logisim-tiny-cpu"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rtfb/logisim-tiny-cpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Flogisim-tiny-cpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Flogisim-tiny-cpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Flogisim-tiny-cpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Flogisim-tiny-cpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtfb","download_url":"https://codeload.github.com/rtfb/logisim-tiny-cpu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Flogisim-tiny-cpu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018724,"owners_count":26086612,"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-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-10-13T11:35:09.126Z","updated_at":"2025-10-14T13:41:03.798Z","avatar_url":"https://github.com/rtfb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tiny CPU in Logisim\n===================\n\nThis repository contains a very tiny CPU implemented in [Logisim][1]. How tiny?\nWell, _very_ tiny. It's restricted to 256-byte ROM and 256-byte RAM and has only\na handful arithmetic-logic instructions, just enough to write toy programs like\nFibonacci number calculator to prove the concept.\n\nIt implements a custom instruction set (described in [`ISA.md`][2]). The\ninstruction set is a fixed-with 8-bit ISA, which imposes severe restrictions on\nwhat is possible to achieve.\n\nThe goal of this project was self-education, and I learned a ton. The project is\n\"complete\": I don't intend to expand on it in any way, or even fix the design\nblunders. Let the sore thumbs stick. (Although I might get around to replicating\nit on a physical silicon one day).\n\n# Contents\n\n![Cover pic](images/cpu-cover.png)\n\n## The CPU\n\n[`8b_cpu_isa2.circ`][3] contains the entire CPU in one drawing. It's not large,\nalmost workable in a fit-to-screen zoom level if the screen is big enough. You\nwill need [Logisim Evolution][1] for working with it (or navigating\ncomfortably). [Here](images/cpu-full.png) is a screenshot of the entire design.\n\n## ISA spec\n\n[`ISA.md`][2] contains a copy of the instruction set document I was using for\nfleshing out the ideas.\n\n## Assembler and disassembler\n\n[`assembler/`][4] contains Go code for the assembler and disassembler. Pass an\nassembly file on the command line to assemble. This will produce a ROM dump that\nyou can load in Logisim:\n\n```\n$ go run main.go fib.s\nv3.0 hex words addressed\n00: 09 4f 4e 08 1e 89 1f 89 4d 57 4a 56 7f 4f 52 4e\n10: 09 e2 fa 55 1f 89 4d 08 e0 f9 00 00 00 00 00 00\n20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\na0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\nb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\nc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\nd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\ne0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\nf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n```\n\nPass `-d` argument to disassemble:\n\n```\n$ go run main.go -d fib.rom\n  0:\t09\tli\t 0x1\n  1:\t4f\tgetacc\t r7\n  2:\t4e\tgetacc\t r6\n  3:\t08\tli\t 0x0\n  4:\t1e\tst\t r6\n  5:\t89\tinc\t 0x1\n  6:\t1f\tst\t r7\n  7:\t89\tinc\t 0x1\n  8:\t4d\tgetacc\t r5\n  9:\t57\tsetacc\t r7\n 10:\t4a\tgetacc\t r2\n 11:\t56\tsetacc\t r6\n 12:\t7f\tadd\t r7\n 13:\t4f\tgetacc\t r7\n 14:\t52\tsetacc\t r2\n 15:\t4e\tgetacc\t r6\n 16:\t09\tli\t 0x1\n 17:\te2\tsjf\t 0x2\n 18:\tfa\tjmphi\t 0x2\n 19:\t55\tsetacc\t r5\n 20:\t1f\tst\t r7\n 21:\t89\tinc\t 0x1\n 22:\t4d\tgetacc\t r5\n 23:\t08\tli\t 0x0\n 24:\te0\tsjf\t 0x0\n 25:\tf9\tjmphi\t 0x1\n```\n\n[1]: https://github.com/logisim-evolution/logisim-evolution\n[2]: https://github.com/rtfb/logisim-tiny-cpu/blob/master/ISA.md\n[3]: https://github.com/rtfb/logisim-tiny-cpu/blob/master/8b_cpu_isa2.circ\n[4]: https://github.com/rtfb/logisim-tiny-cpu/blob/master/assembler/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtfb%2Flogisim-tiny-cpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtfb%2Flogisim-tiny-cpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtfb%2Flogisim-tiny-cpu/lists"}