POV-Ray : Newsgroups : povray.off-topic : The computer project Server Time
4 Sep 2024 15:22:22 EDT (-0400)
  The computer project (Message 1 to 10 of 180)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: The computer project
Date: 10 Jun 2010 09:24:49
Message: <4c10e7a1@news.povray.org>
OK, so this is what I have. I'm still debugging it, but it should more 
or less work now.

It's an 8-bit processor. All data paths are 8 bits wide. There are three 
general-purpose registers, named X, Y and Z. They're all 8 bits wide. 
Since the address bus is also 8-bit, the processor is limited to a 
piffling 256 bytes of addressible memory (unless you go implement 
banking). There are 17 valid opcodes (plus more which may or may not 
produce predictable results.)

All instructions are exactly 2 bytes long. The first byte is an opcode, 
and the second is a memory address (which may or may not actually be 
used for anything). It's merely simpler to design if all instructions 
use an identical addressing mode. Similarly, all instructions are 
exactly 6 clock cycles long, even if some of them could actually be done 
faster.

There are basically 4 instructions:

- Unconditional load.
- Conditional load.
- Save.
- Math-op.

A conditional load does exactly the same thing is an unconditional load 
*if* the last math-op produced a result exactly equal to zero. Otherwise 
an unconditional load does nothing at all.

Either way, a load copies the contents of the specified memory register 
into one of the internal registers. Since the target register can be the 
Program Counter, an unconditional load instruction can be used to 
perform an unconditional jump (to an absolute address). Similarly, a 
conditional load can perform a conditional jump.

A save instruction does the reverse: it copies the contents of the 
specified register (including the PC) to the specified memory address.

There are 5 possible math-ops. They all take X and Y as their operands, 
and store their result in Z. (They also set or clear the "zero flag" 
that the conditional load instruction tests.) The available operations 
are bit-wise AND, OR, XOR, binary addition and binary subtraction.

Currently math-ops generate several flags, but it is impossible to 
access any of them except the zero flag. In particular, this means that 
16-bit addition would be spine-tinglingly difficult to implement in 
software. What I probably need to do is utilise some of the unused bits 
in the opcode to select what condition the conditional load instruction 
tests. (Which means *another* binary decoder in the control matrix...)

As you can see, the CPU itself is quite simple; just a bunch of 
registers attached to a single common data bus. The complexity comes 
from the maze of control busses eminating from the control matrix. And 
when you look inside the control matrix itself... woah. OK, that's 
pretty complicated! o_O

Now, if I can just figure out a reasonable way of getting Logisim to 
test the damned thing...


Post a reply to this message


Attachments:
Download 'processor.png' (13 KB) Download 'control matrix.png' (23 KB)

Preview of image 'processor.png'
processor.png

Preview of image 'control matrix.png'
control matrix.png


 

From: nemesis
Subject: Re: The computer project
Date: 10 Jun 2010 15:25:01
Message: <web.4c113b1a9d5e91c5d467c99c0@news.povray.org>
and you say you're a retard... o_O


Post a reply to this message

From: Orchid XP v8
Subject: Re: The computer project
Date: 10 Jun 2010 15:40:15
Message: <4c113f9f@news.povray.org>
nemesis wrote:
> and you say you're a retard... o_O

Well, I _did_ just spend several weeks building a simulated model of a 
trivially simple computer when I could just, uh, use a real one...

When you think about the amount of _useful_ stuff I could have done with 
that much time and energy, you start to understand why I feel 
unfulfilled with my life. :-(

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: nemesis
Subject: Re: The computer project
Date: 10 Jun 2010 16:50:01
Message: <web.4c114f409d5e91c5d467c99c0@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> nemesis wrote:
> > and you say you're a retard... o_O
>
> Well, I _did_ just spend several weeks building a simulated model of a
> trivially simple computer when I could just, uh, use a real one...
>
> When you think about the amount of _useful_ stuff I could have done with
> that much time and energy, you start to understand why I feel
> unfulfilled with my life. :-(

is learning not useful?


Post a reply to this message

From: Tim Nikias
Subject: Re: The computer project
Date: 10 Jun 2010 18:10:46
Message: <4c1162e6$1@news.povray.org>
Am 10.06.10 22:46, schrieb nemesis:
> Orchid XP v8<voi### [at] devnull>  wrote:
>> nemesis wrote:
>>> and you say you're a retard... o_O
>>
>> Well, I _did_ just spend several weeks building a simulated model of a
>> trivially simple computer when I could just, uh, use a real one...
>>
>> When you think about the amount of _useful_ stuff I could have done with
>> that much time and energy, you start to understand why I feel
>> unfulfilled with my life. :-(
>
> is learning not useful?

Learning aside: Hobbies were invented for fun, not for "productive time 
management". ;-)


Post a reply to this message

From: John VanSickle
Subject: Re: The computer project
Date: 10 Jun 2010 18:50:46
Message: <4c116c46$1@news.povray.org>
Tim Nikias wrote:

> Learning aside: Hobbies were invented for fun, not for "productive time 
> management". ;-)

They were also invented for bragging rights.  Only a vanishingly small 
portion of the human race can claim to know how computers really work at 
the component level.

Regards,
John


Post a reply to this message

From: Invisible
Subject: Re: The computer project
Date: 11 Jun 2010 03:55:17
Message: <4c11ebe5$1@news.povray.org>
nemesis wrote:

> is learning not useful?

Depends on your point of view.

On the one hand, knowing stuff always holds the possibility that one day 
it'll somehow be useful.

On the other hand, what possible purpose could there be to knowing how 
to build an RS Flip-Flop from two NOR latches? I mean, unless I actually 
get hired by an IC design firm (which will never, ever happen), it's 
useless knowledge. It has no practical use of any kind. Hell, even 
learning to use regular expressions is theoretically more useful!

http://xkcd.com/208/


Post a reply to this message

From: Invisible
Subject: Re: The computer project
Date: 11 Jun 2010 04:10:54
Message: <4c11ef8e$1@news.povray.org>
Tim Nikias wrote:

> Learning aside: Hobbies were invented for fun, not for "productive time 
> management". ;-)

Sure. But spending weeks wiring together little black blobs in order to 
make a few LEDs flash in a pattern with hypothetically means something? 
Most people wouldn't regard that as "fun".


Post a reply to this message

From: Invisible
Subject: Re: The computer project
Date: 11 Jun 2010 04:12:16
Message: <4c11efe0@news.povray.org>
John VanSickle wrote:

> They were also invented for bragging rights.  Only a vanishingly small 
> portion of the human race can claim to know how computers really work at 
> the component level.

And an even smaller portion of the human race *care* how computers work.

Most people's reaction would be "you poor autistic weirdo, you should 
seek professional help".

The only minor consolation is that without losers like me, we wouldn't 
*have* computers in the first place...


...still trying to convince myself this makes up for it...


Post a reply to this message

From: scott
Subject: Re: The computer project
Date: 11 Jun 2010 04:17:16
Message: <4c11f10c$1@news.povray.org>
>> is learning not useful?
>
> Depends on your point of view.
>
> On the one hand, knowing stuff always holds the possibility that one day 
> it'll somehow be useful.

But if you spend your whole life learning, you'll run out of time to do 
anything useful with it :-)

> On the other hand, what possible purpose could there be to knowing how to 
> build an RS Flip-Flop from two NOR latches?

Those skills will be a useful base to learn more complex things, and also to 
use as part of more complex projects.

See how your knowledge of transistors helped you when you were first wiring 
up your logic gate? Ermm.. hang on... :-)

Well your skill of wiring up logic gates might one day help with something 
else.  If you want a real life example then on the LCDs we design here along 
one edge of the glass it is pretty much just a huge chain of logic gates 
that clock the display data into the DACs for each column of pixels, then 
each row is clocked active in turn to connect the output of each DAC to 
every pixel in that row.  Somebody has to design that, more people need to 
understand it in great detail, and even more people need to roughly 
understand how it works.  I'm sure there are a huge number of jobs where 
knowing the details of logic gates it a requirement.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.