{"id":16861374,"url":"https://github.com/rumpl/nand2tetris","last_synced_at":"2025-03-18T20:41:55.170Z","repository":{"id":66257905,"uuid":"255451262","full_name":"rumpl/nand2tetris","owner":"rumpl","description":"NAND to Tetris coursera course","archived":false,"fork":false,"pushed_at":"2020-04-14T17:10:14.000Z","size":613,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T23:14:32.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Assembly","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/rumpl.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":"2020-04-13T22:03:47.000Z","updated_at":"2020-04-14T18:58:50.000Z","dependencies_parsed_at":"2023-02-21T09:01:07.022Z","dependency_job_id":null,"html_url":"https://github.com/rumpl/nand2tetris","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/rumpl%2Fnand2tetris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumpl%2Fnand2tetris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumpl%2Fnand2tetris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumpl%2Fnand2tetris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rumpl","download_url":"https://codeload.github.com/rumpl/nand2tetris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244305578,"owners_count":20431735,"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-10-13T14:31:43.282Z","updated_at":"2025-03-18T20:41:55.135Z","avatar_url":"https://github.com/rumpl.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boolean logic\n\n...\n\n# Boolean function synthesis\n\nBoolean function synthesis is going from a truth table to a boolean function.\n\n1. take the table and go row by row\n2. take only the rows where the function is 1\n3. we have a bunch of expressions where the function is 1\n4. we OR them together\n5. the function is constructed\n\nExample :\n\n| x | y | z | f |\n|---|---|---|---|\n| 0 | 0 | 0 | 1 |\n| 0 | 0 | 0 | 0 |\n| 0 | 1 | 0 | 1 |\n| 0 | 1 | 1 | 0 |\n| 1 | 0 | 0 | 1 |\n| 1 | 0 | 1 | 0 |\n| 1 | 1 | 0 | 0 |\n\n* for the first row: `not(x) and not(y) and not(z)`\n* for the third row: `not(x) and y and not(z)`\n* for the fifth row: `x and not(y) and not(z)`\n\nThe function is then:\n```\nf(x,y,z) = (not(x) and not(y) and not(z)) or (not(x) and y and not(z)) or (x and not(y) and not(z))\n```\n\n## NAND\n\nThruth table:\n\n| x | y | nand |\n|---|---|------|\n| 0 | 0 | 1    |\n| 0 | 1 | 1    |\n| 1 | 0 | 1    |\n| 1 | 1 | 0    |\n\nAny boolean function can be represented using just NAND.\nFor example: `nand(x, x) == not(x)`, or `and(x, y) == not(nand(x,y))`.\n\n\n# Logic gates\n\nWe are going to implement bollean functions using logic gates. A composite logic gate is a gate made up from elementary logic gates.\n\nFunctionnal specification of the nand gate:\n\n```vhdl\nif (a == 1 and b ==1)\nthen out=0 else out1\n```\n\nA gate interface answers \"what\" the gate is doing, it's implementation answers the question \"how\". The interface of a gate is unique, it's implementation is not.\n\n# Hardware description language\n\nExample for the XOR gate:\n```vhdl\nCHIP Xor {\n    IN a, b;\n    OUT out;\n\n    PARTS:\n    Not (in=a, out=nota);\n    Not (in=b, out=notb);\n    And (a=a, b=notb, out=aAndNotb);\n    And (a=nota, b=b, out=notaAndb);\n    Or (a=aAndNotb, b=notaAndb, out=out);\n}\n```\n\nWeek 1 gates:\n\n* [x] Not\n* [x] And\n* [x] Or\n* [x] Xor\n* [x] Mux\n* [x] DMux\n* [x] Not16\n* [x] And16\n* [x] Or16\n* [x] Mux16\n* [x] Or8Way\n* [x] Mux4Way16\n* [x] Mux8Way16\n* [x] DMux4Way\n* [x] DMux8Way\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumpl%2Fnand2tetris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frumpl%2Fnand2tetris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumpl%2Fnand2tetris/lists"}