{"id":22975805,"url":"https://github.com/jc-ll/rtl","last_synced_at":"2025-07-25T16:41:50.959Z","repository":{"id":56893081,"uuid":"338544106","full_name":"JC-LL/rtl","owner":"JC-LL","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-16T20:52:53.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T13:46:57.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/JC-LL.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}},"created_at":"2021-02-13T09:58:32.000Z","updated_at":"2021-02-16T20:52:56.000Z","dependencies_parsed_at":"2022-08-21T01:50:12.419Z","dependency_job_id":null,"html_url":"https://github.com/JC-LL/rtl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Frtl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Frtl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Frtl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Frtl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JC-LL","download_url":"https://codeload.github.com/JC-LL/rtl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246777833,"owners_count":20832032,"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","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-12-15T00:39:26.290Z","updated_at":"2025-04-02T08:14:11.300Z","avatar_url":"https://github.com/JC-LL.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RTL Circuit\n\n## What is it ?\n**rtl_circuit** is a simple Ruby gem that helps me manipulate simple digital circuits. It is used essentially as a _library_ and as such, used by other tools of my own (like my experimental [Synchrony DSL](https://github.com/JC-LL/synchrony))\n\n### features :\n- basic library components (logic gates, DFF, mux,...)\n- port-based interconnect\n- hierarchical composition (building a circuit based on existing )\n- json serialization\n- viewing : graphviz\n- ambryonic SVG place \u0026 route\n\n## How to use\n\nHere the programmatic construction of a Half Adder, followed by a Full-adder.\nThis can be seen as a 'hello world' of digital circuits.\n\n```(ruby)\nrequire 'rtl'  # note that the library is named 'rtl' while the gem is _rtl_circuit_\n\ninclude RTL    # module loaded\n\nha=Circuit.new(\"ha\")\nha.add a =Port.new(:in,\"a\")\nha.add b =Port.new(:in,\"b\")\nha.add s =Port.new(:out,\"s\")\nha.add co=Port.new(:out,\"co\")\nha.add and_=And.new\nha.add xor_=Xor.new\n\na.connect and_.port(\"i1\")\nb.connect and_.port(\"i2\")\na.connect xor_.port(\"i1\")\nb.connect xor_.port(\"i2\")\nxor_.port(\"f\").connect s\nand_.port(\"f\").connect co\n\nprinter=Printer.new\nprinter.print ha\n```\n\u003cimg src=\"./doc/ha.png\" width=\"50%\"\u003e.\n\nNow, let's try a Full-adder (made of two Half-adders).\n\n```\nfa=Circuit.new(\"fa\")\nfa.add a =Port.new(:in,\"a\")\nfa.add b =Port.new(:in,\"b\")\nfa.add ci=Port.new(:in,\"ci\")\nfa.add s= Port.new(:out,\"s\")\nfa.add co=Port.new(:out,\"co\")\n\nfa.add ha_1=ha.new_instance\nfa.add ha_2=ha.new_instance\n\nfa.add or_=Or.new\na.connect  ha_2.port('a')\nb.connect  ha_1.port('a')\nci.connect ha_1.port('b')\nha_1.port('s').connect ha_2.port('b')\nha_2.port('co').connect or_.port('i1')\nha_1.port('co').connect or_.port('i2')\nor_.port('f').connect fa.port('co')\nha_2.port('s').connect fa.port('s')\n\nprinter.print fa\n\n```\n\u003cimg src=\"./doc/fa.png\" width=\"100%\"\u003e.\n## How to install ?\n\n```\ngem install rtl_circuit\n```\n\n## Contact\n\nemail : jean-christophe.le_lann at ensta-bretagne dot fr.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjc-ll%2Frtl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjc-ll%2Frtl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjc-ll%2Frtl/lists"}