Giter Site home page Giter Site logo

1bit-cpu's Introduction

1bit-CPU

1bit CPU using 74HC series logic IC.

Overview

This is a 1bit CPU KiCad file. You can make a CPU using the 74HC series logic IC.

Circuit Diagram

1bit-cpu.jpg

Description

Left switch: Controls MUX to choose whether to update Reg A or PC
Right switch: Controls second XOR operand or sets destination PC address

LR
00: MUX=0, RA=RA^0=RA,  PC=!PC
01: MUX=0, RA=RA^1=!RA, PC=!PC
10: MUX=1, RA=RA,       PC=0
11: MUX=1, RA=RA,       PC=1

In regular words:
OFF, OFF will preserve the value of A and advance PC (0->1, 1->0)
OFF, ON will invert the value of A (0->1, 1->0) and advance PC (0->1, 1->0)
ON, OFF will preserve the value of A and set PC to 0
ON, ON will preserve the value of A and set PC to 1

01 23 | Function | Looped C equivalent | Description
----------------------------------------------------------------------------
00 00 | NOP, NOP | void; void;         | Do nothing
00 01 | NOP, INV | void; a=!a;         | Half frequency blink
00 10 | NOP, NOP | void; void;         | Do nothing
00 11 | NOP, HLT | void; while(1);     | Halt forever
01 00 | INV, NOP | a=!a; void;         | Half frequency blink
01 01 | INV, INV | a=!a; a=!a;         | Maximum frequency blink
01 10 | INV, NOP | a=!a; void;         | Half frequency blink
01 11 | INV, HLT | a=!a; while(1);     | Usually one state change, then halt
10 00 | HLT, NOP | while(1); void;     | Halt forever
10 01 | HLT, INV | while(1); a=!a;     | At most one state change, then halt
10 10 | HLT, NOP | while(1); void;     | Halt forever
10 11 | HLT, HLT | while(1); while(1); | Halt forever
11 00 | NOP, NOP | void; void;         | Do nothing
11 01 | NOP, INV | void; a=!a;         | Half frequency blink
11 10 | NOP, NOP | void; void;         | Do nothing
11 11 | NOP, HLT | void; while(1);     | Halt forever

Video

1bit-CPU

1bit-cpu's People

Contributors

naoto64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

1bit-cpu's Issues

Add a truth table to explain switch positions

I've had a quick look to reverse-engineer the circuit to understand what each of the switches does.

The below table explains the actions taken when the instruction is executed.
I think it would be helpful to add this to the documentation.

Left switch: Controls MUX to choose whether to update Reg A or PC
Right switch: Controls second XOR operand or sets destination PC address

LR
00: MUX=0, RA=RA^0=RA,  PC=!PC
01: MUX=0, RA=RA^1=!RA, PC=!PC
10: MUX=1, RA=RA,       PC=0
11: MUX=1, RA=RA,       PC=1

In regular words:
OFF, OFF will preserve the value of A and advance PC (0->1, 1->0)
OFF, ON will invert the value of A (0->1, 1->0) and advance PC (0->1, 1->0)
ON, OFF will preserve the value of A and set PC to 0
ON, ON will preserve the value of A and set PC to 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.