{"id":30594965,"url":"https://github.com/kyriosaa/sap-1","last_synced_at":"2025-08-29T20:33:38.359Z","repository":{"id":308250275,"uuid":"1019784314","full_name":"kyriosaa/sap-1","owner":"kyriosaa","description":"A fully functional 8-bit computer built entirely from scratch using basic logic chips \u0026 breadboards","archived":false,"fork":false,"pushed_at":"2025-08-19T10:31:51.000Z","size":54598,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T23:47:26.000Z","etag":null,"topics":["8-bit-computer","computer-architecture","cpu-design"],"latest_commit_sha":null,"homepage":"","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/kyriosaa.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,"zenodo":null}},"created_at":"2025-07-14T21:43:26.000Z","updated_at":"2025-08-19T10:31:54.000Z","dependencies_parsed_at":"2025-08-05T00:52:17.048Z","dependency_job_id":null,"html_url":"https://github.com/kyriosaa/sap-1","commit_stats":null,"previous_names":["kyriosaa/sap-1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kyriosaa/sap-1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyriosaa%2Fsap-1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyriosaa%2Fsap-1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyriosaa%2Fsap-1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyriosaa%2Fsap-1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyriosaa","download_url":"https://codeload.github.com/kyriosaa/sap-1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyriosaa%2Fsap-1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272758441,"owners_count":24988239,"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-08-29T02:00:10.610Z","response_time":87,"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":["8-bit-computer","computer-architecture","cpu-design"],"created_at":"2025-08-29T20:33:36.099Z","updated_at":"2025-08-29T20:33:38.354Z","avatar_url":"https://github.com/kyriosaa.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src='./images/display.JPG'\u003e\n\n# SAP-1 8-bit Breadboard Computer\n\n[![Assembly](https://img.shields.io/badge/Assembly-525252?style=flat\u0026logo=assemblyscript\u0026logoColor=white)](https://en.wikipedia.org/wiki/Assembly_language)\n[![C++](https://img.shields.io/badge/C%2B%2B-00599C?style=flat\u0026logo=c%2B%2B\u0026logoColor=white)](https://isocpp.org/)\n[![Arduino](https://img.shields.io/badge/Arduino-00979D?style=flat\u0026logo=arduino\u0026logoColor=white)](https://www.arduino.cc/)\n[![Electronics](https://img.shields.io/badge/Electronics-008C4A?style=flat\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGlkPSJDaXJjdWl0LUJvYXJkLS1TdHJlYW1saW5lLUx1Y2lkZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ij4KICA8ZGVzYz4KICAgIENpcmN1aXQgQm9hcmQgU3RyZWFtbGluZSBJY29uOiBodHRwczovL3N0cmVhbWxpbmVocS5jb20KICA8L2Rlc2M+CiAgPHBhdGggZD0iTTUgM2gxNHMyIDAgMiAydjE0czAgMiAtMiAySDVzLTIgMCAtMiAtMlY1czAgLTIgMiAtMiIgc3Ryb2tlLXdpZHRoPSIyIj48L3BhdGg+CiAgPHBhdGggZD0iTTExIDloNGEyIDIgMCAwIDAgMiAtMlYzIiBzdHJva2Utd2lkdGg9IjIiPjwvcGF0aD4KICA8cGF0aCBkPSJNNyA5YTIgMiAwIDEgMCA0IDAgMiAyIDAgMSAwIC00IDAiIHN0cm9rZS13aWR0aD0iMiI+PC9wYXRoPgogIDxwYXRoIGQ9Ik03IDIxdi00YTIgMiAwIDAgMSAyIC0yaDQiIHN0cm9rZS13aWR0aD0iMiI+PC9wYXRoPgogIDxwYXRoIGQ9Ik0xMyAxNWEyIDIgMCAxIDAgNCAwIDIgMiAwIDEgMCAtNCAwIiBzdHJva2Utd2lkdGg9IjIiPjwvcGF0aD4KPC9zdmc+\u0026logoColor=white)]()\n\nSAP-1 (Simple As Possible - 1) is a fully functional 8-bit computer built entirely from scratch using basic logic chips and breadboards. My version is based on Ben Eater's design with power distribution changes along with IC placement and wiring differences.\n\nThe computer works without any code and can be manually programmed by using DIP switches. Arduino code is used to program EEPROM lookup tables so numbers can be displayed properly. More complex programs such as multiplication or sequencing are written in Assembly and manually entered via DIP switches.\n\n🎥 [Demo video](https://www.youtube.com/shorts/4pfi_eUA4II) // [Countdown](https://youtu.be/wu7tkiY4CAg) // [Powers of 2](https://www.youtube.com/watch?v=veCdd8PZPOk) // [Multiples of 3](https://youtu.be/clsH6ASg8Kw) 🎥\n\n\n| Sections  |\n|-----------|\n| 🔧 [Core Components](#core-components) |\n| 📊 [Instruction Set](#instruction-set) |\n| ⚡ [Operation Cycle](#operation-cycle) |\n| 💻 [Programming](#programming) |\n| 📸 [Images](#images) |\n\n## Core Components\n\n**CPU Architecture**\n- **A Register (Accumulator) -** The main register that stores data for math operations\n- **B Register -** The secondary register to hold the second operand for ALU operations\n- **Arithmetic Logic Unit (ALU) -** Does the addition and subtraction\n- **Instruction Register -** Stores the current instruction being executed\n- **Flags Register -** Checks for overflow or underflow values\n- **Program Counter -** Keeps track of which instruction to execute next\n- **EEPROM Programmer -** For CPU microcode \u0026 display programming\n\n**Memory \u0026 I/O**\n- **16-byte RAM -** Stores both the program instructions and data\n- **4-bit address -** Can access 16 memory locations (can store either instructions or data)\n- **7-segment display -** Decimal display for output\n- **Clock control -** Includes a potentiometer for controlling clock speed along with the option to set the clock to automatic or manual\n- **Reset button -** Includes a button to reset the computer and rerun any loaded programs\n- **Control switches -** Includes DIP switches and buttons for manual programming\n\n## Instruction Set\n\nI've programmed a complete instruction set in the [CPU microcode](./programs/sap1_cpu_microcode/sap1_cpu_microcode.ino)\n```text\n0000    NOP - No operation\n0001    LDA - Load from memory to A register\n0010    ADD - Add memory to A register\n0011    SUB - Subtract memory from A register\n0100    STA - Store A register to memory\n0101    LDI - Load immediate value to A register\n0110    JMP - Jump to address\n0111    JC  - Jump if carry (overflow)\n1000    JZ  - Jump if zero  (underflow)\n1110    OUT - Output A register to display\n1111    HLT - Halt computer\n```\n\nFor info on how to input the assembly program, look at [Programming](#programming)\n\n## Operation Cycle\n\n1. **Fetch -** The program counter addresses memory, then instruction is loaded into the instruction register\n2. **Decode -** Control logic interprets the opcode to figure out which operation to perform\n3. **Execute -** The control signals are activated to do the instruction\n4. **Increment -** If there's no jump, the program counter advances to the next instruction\n\n## Programming\n\n**SAP-1 Programs**\n- Programs (like multiplication, powers of 2, etc.) are written in Assembly and manually entered via DIP switches into the RAM\n\n```text\nManual Programming Instructions\n\n1. Switch to the memory address you want to program the instruction on\n2. Input the instruction opcode (first 4 bits) and the operand/target address (last 4 bits)\n3. For data storage locations, just input the 8-bit binary value directly\n\nExamples: \nLoad number from address 15: 0001 1111\nOutput:                      1110 0000\nJump to address 3:           0110 0011\nData storage (123):          0111 1011\n```\n\n**Display Setup**\n- [Arduino EEPROM programmers](./programs/sap1_decimal_counter_programmer/sap1_decimal_counter_programmer.ino) are used to prepare lookup tables for decoding the 7-segment display\n\n**Example Programs**\n- [Assembly examples](./programs/assembly/) are in the Assembly folder\n\n## Images\n\n\u003cimg src='./images/sap1.JPG'\u003e\n\u003cimg src='./images/control_word.JPG'\u003e\n\u003cimg src='./images/eeproms.JPG'\u003e\n\u003cimg src='./images/programmer2.JPG'\u003e\n\u003cimg src='./images/display_side.JPG'\u003e\n\u003cimg src='./images/ic.JPG'\u003e\n\u003cimg src='./images/program_counter.JPG'\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyriosaa%2Fsap-1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyriosaa%2Fsap-1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyriosaa%2Fsap-1/lists"}