Computer Exponential Code Demo
2 Stars     330 Views

Author: Sanderokian Stfetoneri

Project access type: Public

Description:

A Computer. Kind of.

The 256-Series, my new collection of simulated computers: https://circuitverse.org/users/4699/projects/256-series

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:

03: XOR Addresses 00 and 02

05: XOR Addresses 01 and 02

0C: IF ADD Result = 00, GOTO 1B, ELSE GOTO 0D

10: IF ADD Result = 00, GOTO 16, ELSE GOTO 11

15: GOTO 0F

1A: GOTO 0C

Features:

32-Bits of 5-bit RAM,

32 Lines for Instructions,

Go To Functionality

Can do IF = Statements

OP Codes:

0000 = Nothing

0011 DDDDD VVVVV = ADD DDDDD and VVVVV together

0101 DDDDD VVVVV = AND DDDDD and VVVVV together

0111 DDDDD VVVVV = XOR DDDDD and VVVVV together

1000 AAAAA BBBBB = XOR address AAAAA and BBBBB together

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

Created: Sep 21, 2019

Updated: Jun 30, 2023