need two more instructions

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Hi guys,

I am currently deciding on the instructions for my new 4bit hybrid. Now, here is what i have so far:

0000 NOP
0001 ADD
0010 SUB
0011 AND
0100 EXOR
0101 OR
0110 NOT
0111 Display reg (A) (REG defines display)
1000 If (REG = 0001, A < B) (REG = 0010, A=B) (REG = 0011, A > B)
1001
1010
1011 Goto (A and B)
1100 Pause (clock A cycles)
1101 Shift (left (B = 0001) Right (B = 0010))
1110 Take user input (A) and then store in (B)
1111 Move (A) to (B)

But i want to use it all. Now, are there any important ones i need or can you think of something usefull (like make a noise at a frequency)
 

hgmjr

Joined Jan 28, 2005
9,029
A couple of useful instructions are conditional branch instructions.
For example,

SGE "Skip if Greater than or Equal"
SLT "Skip if less than"

hgmjr
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
err...thats a little complicated so..

There are two four bit words (A and B), there is a four bit word (REG) that tells it where to store the info, there is a four bit instruciton and a two bit definer( never mind about that).

Now, the goto jump uses word A, B and REG turning it into a 12 bit meaning i can have up to 4096 lines.

ALU functions are four bit

registers hold four bit word
 

Wendy

Joined Mar 24, 2008
22,146
So it is a 12 bit address line with a 4 bit data buss.

I tried looking up an old chip, the CD4500, that I thought you might like to see. It was a single bit processor. It was most of a CPU on a 16 pin chip. The address line was a simple 8 bit ripple counter, another 4500 series chip. To loop the CPU chip would go passive until the counter reached the address it was looping to. Very crude, but it worked, and with 256 iterations a loop didn't take that long, and 256 was the total max length of a program.

Unfortunately it is so obsolete all information seems to have disappeared off the web, which I find surprising.
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Ok, 1001 is now HCF haha
What does the empty the bit bucket do?

1001 Might be a block statemen for the if - could ignore or do everything within the block, very useful for loops. For example:

IF (a < B)
{
Do
Do
Do
}
 

Wendy

Joined Mar 24, 2008
22,146
Empty bit bucket?

It erases it's program, then turns itself off, preferably in a manner it can't be turned on again.
 

Wendy

Joined Mar 24, 2008
22,146
I like the novel where programmers went to a dimension where magic worked, and men were loosing. They wrote a compiler that treated magic as a programming language, instantly making a lot of humans major magicians. One of the error codes (I liked) was EOI, Execute Operator Immediately.

Put a whole new dimension on video games.
 
Top