Searched Projects

Tags: computer

project.name
0 Stars     47 Views
User:

8-bit computer simplified v2

A computer made completely out of logic gates. Version 2. V1 can be found here: https://circuitverse.org/users/13948/projects/49969

Because of the limitations of the circuitverse.org simulator, and for easier use, some inbuilt components are used (like the 256-byte RAM module), but most of it is made up of OR, AND, NOT, XOR, NOR and NAND.

This project was originally made for my profile project. This is (or will be) version 2 of the 8-bit computer.


project.name
0 Stars     124 Views
User:

CPU Microprocessor

Working CPU with eight 8-bit registers and eleven commands. Instructions in the project, command list below.

Commands:

LDA r - loads value from register r into accumulator
STA r - stores accumulator value in register r
CLR r - clears register r
INC r - increments the value of register r and replaces into r
DEC r - decrements the value of register r and replaces into r
COM r - stores the complement of the value in register r in the accumulator
ADD r - adds value in register r to the accumulator
SUB r - subtracts accumulator value from value in register r, replaces into accumulator
AND r - stores value of (accumulator AND r) in accumulator
IOR r - stores value of (accumulator OR r) in accumulator [inclusive or]
XOR r - stores value of (accumulator XOR r) in accumulator [exclusive or]

*Eight 8-bit registers: r must be a value between 0 and 7 and refers to the address of the register, not its contents*


project.name
1 Stars     47 Views
User:

Play Roulette / Programable Computer

WELCOME TO MY PROGRAMMABLE COMPUTER! 

DESCRIPTION:

You can code your own program or play a precoded game named "Play Roulette!"

It is a working CPU using fifteen 16-bit instructions that can by coded to develop a reasonable program containing up to 256 rows of machine code.  I have also made some input/output features to make using of the computer as comfortable as possible. 

There are two 16Byte Registers named "General Register A", "General Register B" and two 16bit registers named "Status Register A" and "Status Register B". Thanks to given instructions you can manipulate DATA in the registers (write, read, copy, delete etc.), You can make some calculations (adding, subtraction, multiplication, comparation etc.) You can also do some logic operations (and, or, not etc..) 

You can make a list of this instructions (program rows) and thanks to implemented Program Counter you can run them as programs. For this reason there are also instructions to jump in your program rows (You can make any combination of absolute jump, relative jump forwards or backwards, unconditional jump, conditional jump etc..) 

Last but not least: There are instructions that will PRINT given data to TTY display component in numeric or ASCII format. And there is also a numeric keyboard designed for easiest possible user input while the program is running.  


HOW TO PLAY ROULETTE:

"Play Roulette" is an easy program "simulating" the roulette. The source code could be found in the "Play Roulette" Sub-circuit. 


Story: 

You are a hazard player. At the begining you have cash 100 dollars . Then you can bet to a number or to a color. If you hit the right number, you triple the amount of money, you have bet. If you dont hit, you lose all the money, you have bet. If you hit the right color (red or black) you double the amount of money you have bet and so on.. 


Before you play:

Make sure the "POWER" value is set to "1"

Make sure the "STOP CLOCK" is set to "0" 

Make sure the "CHOOSE SOURCE" value is set to "1".  

In case of unexpected behaviour press the RESET button


When you play:

If the program runs properly, it should first load some data, then it will give you some instructions like: Choose a number to bet or choose how much money are you going to bet and so on..  All this tasks could be done via the numeric keyboard below. 

The game ends when your cash is under 0 or over 255. If you want to play again, just press RESET button. 

The speed of game depends on the clock time. Unfortunately even if the best frequency is set (50 ms), the game is very slow. So be patient please. 

The game have some bugs for sure. Sorry for them! It is not designed to entertain somebody :D It is designed to test abilities of my Computer.  


HOW TO CODE YOUR OWN PROGRAM:

On the left side in the project you can see 256 16bit inputs connected to the CPU. There you can code your own program using 16 bit instructions.

  • First 4 bits contain the code for the instruction (0000 to 1111)
  • Other 12 bits contain given PARAMETERS or DATA that could be encoded in 6 possible ways depending on what instruction you currently use


INSTRUCTION SET: 

0000: WRITE (writes given 8bit DATA to a given ADRESS of General Register A)  

0001: READ (reads 8bit DATA from given ADRESS of given REGISTER)

0010: DEL (deletes DATA from given ADRESS of given REGISTER) 

0011: COPY (copies DATA from given ADRESS of given REGISTER to an other given ADRESS of given RESTER

0100: IS EQUAL (compares DATA from given ADRESS of given REGISTER with an other DATA from given ADRESS of given REGISTER. If both are equal, then it writes "1" to ADRESS 1000 of Status Register B. Otherwise it writes "0". - This specific adress is reserved for RESULT of "IS EQUAL" instruction. 

0101: IS BIGGER (compares DATA from given ADRESS of given REGISTER with an other DATA from given ADRESS of given REGISTER. If DATA from the first one are bigger than from the second one, then it writes "1" to ADRESS 1001 of Status Register B. Otherwise if writes "0". This specific adress is reserved for RESULT of "IS BIGGER" instruction

0110: AND (makes logic AND with DATA from given ADRESS of given REGISTER and an other DATA from given ADRESS of given REGISTER. If the logic AND is true, then it writes "1" to ADRESS 1010 of Status Register B. Otherwise it writes "0".  This specific adress is reserved for RESULT of "AND" instruction.

0111: OR (makes logic OR with DATA from given ADRESS of given REGISTER and an other DATA from given ADRESS of given REGISTER. If the logic OR is true, then it writes "1" to ADRESS 1011 of Status Register B. Otherwise it writes "0". This specific adress is reserved for RESULT of "OR" instruction.

1000: ADD (adds DATA from given ADRESS of given REGISTER to DATA from an other given ADRESS of given REGISTER. The RESULT is then stored to ADRESS of the first one of this two. (The DATA from the first one given ADRESS of given REGISTER are overwrited by the RESULT of adding). If the result is bigger than 255 (11111111), then "1" is written to ADRESS 1100 of Status Register B and the RESULT of adding is not provided and the Program Counter is not incremented so the program STOPS!!!  Also the red diode "ERR OVF" should be enlightened. This ADRESS  (1100 od Status Register B) named ERROR OVERFLOW is reserved for  all error overflow situations. 

1001: SUB (substracts DATA from given ADRESS of given REGISTER from DATA from given ADRESS of given REGISTER. (The second one is substracted from the first one).  The RESULT is then stored to ADRESS of the first one of this two.  (The DATA from the first one given ADRESS of given REGISTER are overwrited by the RESULT of substraction).  If the result is lower than 0 (00000000) , then "1" is written to ADRESS 1100 of Status Register B and the RESULT of substraction is not provided. The Program Counter is not incremented so the program STOPS!!! Also the red diode"ERR OVF" should be enlighted. This  specific ADRESS  (1100 od Status Register B) named ERROR OVERFLOW is reserved for  all error overflow situations. 

1010: MULTIPLY (multiplies DATA from given ADRESS of given REGISTER with data from an other given ADRESS of given REGISTER. The RESULT is then stored to adress of the first one of this two. (The DATA from the first one given ADRESS of given REGISTER are overwrited by the RESULT of multiplication) If the result is bigger  than 256 (11111111) , then "1" is written to ADRESS 1100 of Status Register B and the RESULT of multiplication is not provided. The Program Counter is not incremented so the program STOPS!!! Also the red diode"ERR OVF" should be enlighted. This  specific ADRESS  (1100 od Status Register B) named ERROR OVERFLOW is reserved for  all error overflow situations. 

1011: JUMP (canges the value of Program Counter variable that defines what row of program should be performed. 

There are 4 possible MODES of jumping depending on given parameter and format of code: It is: 

  • 1/ ABSOLUTE JUMP to given position saved on given ADRESS of given REGISTER,
  • 2/ ABSOLUTE JUMP to given position  
  • 3/ RELATIVE JUMP to given amount of rows forward
  • 4/ RELATIVE JUMP to given amount of rows backward

There are also 4 possible CONDITIONS that coud be combinated with each MODE 

  • 1/ NO CONDITON - the JUMP is provided every time
  • 2/  JUMP if IS EQUAL is true - the JUMP is provided only if on ADRESS 1000 of Status Register B is stored "1" (Result of "IS EQUAL" instruction is always stored on this ADRESS)
  • 3/ JUMP if IS BIGGER is true - the JUMP is provided only if on ADRESS 1001 of Status Register B is stored "1" (Result of "IS BIGGER" instruction is always stored on this ADRESS)
  • 4/ JUMP if AND is true - the JUMP is provided only if on ADRESS 1010 of Status Register B is stored "1" (Result of "AND" instruction is always stored on this ADRESS)

1100: RANDOM (writes a random number of given maximal value to given ADRESS of given REGISTER 

1101 NOT USED

1110:  LOAD EXT (provides HALT function - the Program Counter is not incremented until user inputs some DATA using the numeric keyboard.  This user DATA are then written to given ADRESS of given REGISTER

1111: PRINT EXT (prints DATA from given ADRESS of given REGISTER to the TTY display. This 8bit DATA could be represented as number (0-255) or as ASCII sign. It depends on given parameter

Detailed formats how to compose the 16bit instruction for each of this 15 cases is described inside the project. In the Play Roulette Sub-circuit you coud find inspiration.  

 

EXAMPLE OF MACHINE CODE:


0000 0001 01010101 

This will write DATA  "01010101" to ADRESS 0001 in General Register A.


0011 0001 00 0001 01 

This will copy DATA from ADRESS 0001 of General Register A (00) to ADRESS 0001 of General Register B (01)


1000 0001 00 0001 01 

Then this will ADD DATA from ADRESS 0001 of General Register A (00) to ADRESS 0001 of General Register B (01) and the RESULT is then stored to ADRESS 0001 of General Register A (The original DATA in first given REGISTER are overwriten by the RESULT) 


FEEL FREE to ask questions and give me feedback. You can contact me via [email protected] 


THANKS AND NOTES:

I would like to THANK to the team of developers of Circuit Verse. It is a fntastic product and I learned a lot! 

Two months ago my knowledge of logic gates was ZERO.. Literally ZERO. I have no other education in this area. Everything what is done in this project I have Iearned during two months of recent Coronavirus quarantine... :))   Thanks to Circuit Verse, Youtube and Wikipedia! 

I am not an IT professional at all. Actually I am a journalist. I did not study any IT school, I did not systematicaly study existing CPUs or computer architectures. Everything in this project is more or less my own invention. It means there are many mistakes and bad solutions. Therefore I will be extremly glad to get any feedback from anyone who really understands this area. 

Thank you and sorry for my weak english!

Martin




project.name
1 Stars     94 Views
User:
User Image me

This is a CPU witch is capable of executing a lot of stuff in one clock cycle, and this CPU can shift left up to 7 times and shift right up to 7 times witch means that it is possible to  multiply and divide in one clock cycle if you program a table in the program memory. it has a 32 bit instruction width and a 8 bit address. it also has 

The ALU has the following operations:

  • ADD
  • SUBTRACT
  • SHIFT_LEFT (up to 7 times per cycle 3 bit)
  • SHIFT_RIGHT (up to 7 times per cycle 3 bit)
  • XOR
  • OR
  • NOT


project.name
0 Stars     21 Views

But How Do It Know


project.name
0 Stars     69 Views
User:
User Image SDC

Bitwise-only computer

A new addition to my computer design collection, with a few ideas I've toyed around with for CPU design. I'll probably implement these ideas in my Simple Computer design later this summer, 2020.


project.name
0 Stars     51 Views
User:

super simple 8 bit computer

that's nice

project.name
0 Stars     55 Views
User:

simplecpu1

WIP

project.name
1 Stars     289 Views

project.name
0 Stars     110 Views

project.name
0 Stars     131 Views
A Computer. Kind of.

This version is setup to demonstrate a program that puts input A to the power of input B This version has been specifically modified to make demonstrating the program easier. This was done by making operand A for the first two instructions depend on user input, which allows the user to easily test the program with different values. Note: X^0 does not work due to the fact the the output value (address 5) is never written to. 
The code is as follows:
00: LOAD Input A into Address 00
01: LOAD Input B into Address 01
02: LOAD1F into Address 02
03: XOR Addresses 00 and 02
04: LOAD XOR Result into Address 03
05: XOR Addresses 01 and 02
06: LOAD XOR Result into Address 04
07: LOAD 01 into 00
08: LOAD 00 into 08
09: LOAD 01 into 02
0A: LOAD 01 into 06
0B: ADD 04 and 06
0C: IF ADD Result = 00, GOTO 1B, ELSE GOTO 0D
0D: LOAD 00 into 05
0E: LOAD 01 into 07
0F: ADD Addresses 03 and 07
10: IF ADD Result = 00, GOTO 16, ELSE GOTO 11
11: ADD Addresses 00 and 05
12: LOAD ADD Result into 05
13: ADD 02 and 07
14: LOAD ADD Result into 07
15: GOTO 0F
16: ADD 02 and 06
17: LOAD ADD Result into 06
18: ADD 05 and 08
19: LOAD ADD Result into 00
1A: GOTO 0C
1B: RETURN Address 05

Features:
32-Bits of 5-bit RAM,
32 Lines for Instructions,
ADD, AND and XOR Functions.
Go To Functionality
Can do IF = Statements

OP Codes:
0000 = Nothing
0001 VVVVV AAAAA = LOAD VVVVV into address AAAAA
0010 AAAAA 00000 = LOAD Add result into address AAAAA
0011 DDDDD VVVVV = ADD DDDDD and VVVVV together
0100 AAAAA BBBBB = ADD address AAAAA and address BBBBB together
0101 DDDDD VVVVV = AND DDDDD and VVVVV together
0110 AAAAA BBBBB = AND address AAAAA and address BBBBB together
0111 DDDDD VVVVV = XOR DDDDD and VVVVV together
1000 AAAAA BBBBB = XOR address AAAAA and BBBBB together
1001 AAAAA 00000 = LOAD AND result into address AAAAA
1010 AAAAA 00000 = LOAD XOR result into address AAAAA
1011 AAAAA 00000 = GOTO address AAAAA (in instruction memory) 
1100 AAAAA BBBBB = If add result = 0 (ignoring carry), GOTO address AAAAA else go to address BBBBB (in instruction memory)
1101 VVVVV 00000 = Return VVVVV (Stops the program)
1110 AAAAA 00000 = Return the value at address AAAAA (Stops the program)
1111 = Nothing

project.name
1 Stars     341 Views
User:
SAP-1 ("Simple As Possible")

A simple 8-bit processor. It has a simple instruction set:
  • LDA - 0 - Load RAM data into accumulator
  • ADD - 1 - Add RAM data to accumulator
  • SUB - 2 - Subtract RAM data from accumulator
  • OUT - e - Load accumulator data into output register
  • HLT - f - Stop processing
Credits to the book "Digital Computer Electronics" by Albert Paul Mauvino, where he invented the educational processor.

project.name
2 Stars     94 Views
User:

Computer

wip computer i doubt ill finish

project.name
0 Stars     84 Views

SC-8

WIP computer!

project.name
12 Stars     3447 Views
User:
User Image SDC

SIMPLE COMPUTER

If you have any questions about this or other designs, feel free to shoot me an email at [email protected] I don't check it very often (since it's a secondary account), and you may not receive a reply for around a week.

A simple computer with an added RAM module. A work in progress, with much more I want to add, such as bitwise operators, a larger bus size, data type support including unsigned and signed integers, floating point numbers, conditional instructions, and more. There are two programmed versions, one that calculates the fibonacci sequence, and the other uses conditional instructions to determine whether it should increment a number, or halt the program. And there is also the first design I've made, which has a lot of unneeded parts in it.


UPDATE 1: added a jump instruction to allow loops and other useful applications.

UPDATE 2: Made a second version of the design, and made a better instruction set for it, removed the Memory register, since it's totally unnecessary with a RAM module. The second version also calculates the Fib sequence.

UPDATE 3: Added signed integer addition and subtraction support to version 2. Of course, this limits the positive range of integers to 127, rather than 255, but c'est la vie, I'm going to expand the size of the bus anyway.

UPDATE 4: Version 2 is temporarily down, since I'm finally adding bitwise operator functions to the ALU.

UPDATE 5: Version 2 is now back in action, with some added functions such as increment and decrement by 1, as well as left bit shifting. The ALU still needs some more work, since I'm having trouble implementing a right bit shift function. Once I have bit shifting working, I might make a program that can multiply using the shift/add method.

UPDATE 6: Version 2 now has magnitude comparison and bit-shifting functions. Conditional jumps still in the works.

UPDATE 7: Version 2 finally has a conditional jump register. It can be loaded with a Boolean from either RAM or the ALU, or directly set to either 1 or 0 by way of a set instruction. I still need to add a flag register to the design, so it can detect overflows (and maybe in the future, interrupts).

BONUS UPDATE: After a few months of studying processor and computer design, I discovered that I've unwittingly designed a Von-Neumann architecture computer (as opposed to the Harvard architecture. Reference Wikipedia if these terms are unfamiliar). Frankly, I went into this project relatively blind, and just a week ago discovered that this kind of design had a name. Well, the more you know.

UPDATE 8: I've created a new CPU design, some of which I will implement into this main circuit later this summer.  Here's the link to that design: https://circuitverse.org/users/3464/projects/19687. Also, I plan to overhaul the entire design to minimize cycle inefficiencies.