CLU:My Computer Project.

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

CLU:My Computer Project.

Post by Mattigasz » Sun Mar 28, 2010 2:07 pm

Okay then, here it is! As promised I will keep you all up to date on what is happening and what my plans/troubles are. But first I might want to explain what this is all about..

Altough the second part of the forum title is pretty obvious the first part may not be. CLU stands for Calis Logic Unit, Calis is my backname so that should explain the acronym.

Okay with that said I am going to explain all the plans I have briefly and in layman's language. I however do assume you know how the binary system works and how to do basic logic calculations on it. Here we go then: The purpose of this project is to create a machine that has a instruction set that allow the device to be programmed. Version 1 of this project will be a machine that has X switches and each switch holds a specific value or function. There is a other switch that steps every instruction, since this is my first real big electronics project I do not want to implent a clock yet since that brings difficulties in like how responsive are my logic gates etc..

Here is how the input works:



A = Acummolator, 8 bits in size

B = Backup register, 8 bits in size

C = Counter register, 8 bits in size

F = Flag register, 8 bits in size

S = Stack pointer, 8 bits in size

EG = 16 bits accumolator

HI = 16 bits backup register

PC = program counter 16 bits in size

Instructions are the very first section this is very simple, every binary combination represents a instruction:

00 0000 = No Operation

00 0001 = ADD

00 0010 = SUB

etc.

lets give a example instruction: ADD

the syntax for ADD is: ADD { 8 bit register, literal 8 bit value or 8 bit register }

This ADDS the value of operand2 to operand1 and stores in operand1. E.g. ADD A, 8

This ADDS 8 (no prefix means decimal) to what is CURRENTLY in the A register. Lets say $02 was in A. Now add 8 decimal we get: $0A. After this instruction the A register holds $0A.

Well I think I keep it to this for the time beeing and oh, all the above is subject to change I might trow some more instructions in then 32 (I probaly will so I took 6 bits for the instruction instead of 5) or I might add or destroy a register...Well, we will see...

Greetings.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Sun Mar 28, 2010 2:08 pm

Man that is really cool.

I guess it might look something like the good ol' Altair 8800 in the end?

Image

I think that would be a great project and someday, I think I will give it a go. I definately dont have the time to dedicate to such a task at the moment though. So that's why you need to keep us all posted so we can see how yours comes along = )

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Mattigasz » Sun Mar 28, 2010 2:09 pm

Yes I think it might eventually look just like that!altough mine has more switches (either because it has more functions or because I can not grasp how a (de)Multiplexer works, probaly the latter ;) )
I'll make sure I'll post all the schemtacis here and since I have to bundle it all neatly for school why not post it here. Shortly said: you will be able to refer to my computer (if i can get it to work) for the moment however type (without quotes) "magic-1 CPU" you'll find a very informative site there and more important, in the bottom there is a WebRing so all CPU project sites are linked (i'll guess I'll add mine once it is done)!
ooh one more thing my 'coach' for this project showed me a very simple Relay adding machine it used (i am writing from memory now so bare with me) 14 double switch relays and can add up to 9+9 (it has 5 output leds so it could output to 32 theoretically).

To add even further to an unorganised post, I finally understand the carry bit now! What I understand it to be is that it is a one bit short term memory.
if we add 01 and 01 in binary we get 10, lets have a look at that further:

01
01
----- +
10

lets do this bit by bit:

0+0 = 0
1+0= 1
1+1 = 0 BUT "carry" a 1 to the next (More significant) bit.

so:

1
1
--- +
0

BUT remember (in the carry bit) a 1
Carry = 1

So we get:
1
1
---- +
10 this is the carry bit I have been talking about all the time!

Which makes it:
1 <--
|
(1)1
0 1
---- +
10

these are the same! (if you cant see it just figure it like this, the one next to the "<--" drops down by sheer gravity into the "(1)" )
but the carry does not end there,

supppose you have two 4 bit numbers with all set to 1's if we add them up we can not represent them in 4 bits because that would only be one half of the addition! We can bypass this problem by adding in the carry bit, this extends the 4-bit output to 5 bits. And in 5 bits we CAN represent 32+32 (which is 1111 + 1111).

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Sun Mar 28, 2010 2:11 pm

Yep, what you have just described is better known as the half adder. you can add two individual binary numbers together and it will give you the sum and carry outputs.

Here's one made out of an xor gate and an and gate:

Image

You can then go even further and make a full adder which again accepts two indivual binary digits PLUS it also accounts for the carry bit from the previous addition:

Image


This is fun stuff, going into the inner workings of a CPU with logic gates![/img]

Digg
decided to stick around...
decided to stick around...
Posts: 27
Joined: Sun Mar 28, 2010 1:27 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Digg » Sun Mar 28, 2010 2:12 pm

Now what I want to see you implement is a Hardware multiply like some of the pics have. This can be done, so I am not just pulling your leg. I just think it my cause you to loose your mind and start believing that the IC are alive and are beginning a revolt against you. LOL, best of luck to you man and please keep us posted with both your problems and your solutions. I am in school right now to be an EE so I may be able to help you with some of the smaller problem your run across or just give you a better way to look at the problem at hand. Everyone can use a good second opinion.

-Digg-

Digg
decided to stick around...
decided to stick around...
Posts: 27
Joined: Sun Mar 28, 2010 1:27 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Digg » Sun Mar 28, 2010 2:13 pm

Ok first off, the best way to things simple is to make things complicated. Yes I know that this does not make sense. When designing large circuits you need to work in pieces and build from that. Just look at a full adder IC. The inside of the Chip is something like this...

Image

This shows you each gate now again Each gate can be broken down into yet more components(I don't want to go into what they are made of). This is called a top down design.

So build your circuits to be reused. And then use the same components for different commands. For instance an alu can do almost anything so if you research these it will make your life easier. Another example is if you have an adding circuit set up so that it takes two registers and adds them and puts the final result into the accumulator and the carry bit then all you need to do is load the two register you want to add into the adding register and you know have multiple commands that run off the same hardware

Below is a picture of the highest level of the Z80. You can see that it consist of some type of control structure on the left that tells it what to do. A register bank in the middle and a ALU. Trust me I know this is confusing. In fact when I went over it I was thinking to myself, when will I ever go over this again. Well to be honest I am rusty on how the Z80 works exactly as I love the pic so much more due to the ease of use. Now there are two main types of possessors now days, neumann and harvard architectures. A z80 is neumann based and the pic is harvard based. The main difference is the memory setup of the two machines. A neumann has only one memory for both program instructions and data storage. The harvard has separate memory for both. What does this mean? Well its all about speed. At least for the most part. A neumann can only read or write to the memory in one clock cycle. The harvard can do both meaning that you can read an operation and store the result in the same clock cycle.

Now with our newfound knowledge I will suggest that you build a neumann machine as this is the most simple to do. You will only need an EPROM to store the program and the data you are working on. If you do some reading on the architecture of the z80 this should be an easier project for you.

You also had a question about how to use (de)multiplexers. I use them as an addressing devise but I will explain what they do to better explain. Lets say you have only three lines. This will give you three bits of data. So you can have 2^3=8 possible combination with these three lines. So lets say you have an 8 button keypad that you want to attach to a circuit with the fewest lines possible. You can use a multiplexer to shrink the number of lines needed to show what button is pressed to three. So if you press third button on the pad it will have the binary code of '00000100' the multiplexer will take this and make it '010'b or '2'dec. The reason that it is 2 and not three is that 0 is button 1 you can make 0 button 8 but this is not how most people do it. If you press the sixth button it is binary '00100000'. The multiplexer will output '101'b which is '5'dec. Now this is cool but you can only press one button at a time or you will get an error.

Now a demultiplexer does the exact opposite. It spreads apart data lines. This is what you use to address things with the smallest amount of lines. I will apply this to the z80 which has a 12 line address bus. 2^12 = 4096. This means that the z80 can address a maximum of 4096 devices or data locations. So with the 8-bit data bus you can address 1 GB of data. Understanding this is important for you because you will use demultiplexers to simplify your design.

So I mostly use multiplexers for input and demultiplexers for output.

I know this post will rise many questions. Please ask them as this is a great review for me. I am not gunna say that everything I wrote here is 100% correct as most of this I am pulling from memory. Again if you see something wrong let me know and I will change it.

-Digg-

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

A small update

Post by Mattigasz » Thu Apr 01, 2010 6:06 am

here is a small update:
>I managed to figure out how to multiply in binary!
>I got myslef a book called "Digital Electronics" from the Dutch 9which is my native language) company Elektor, it has over 50 breadboard expirements with logic IC's and tells stuff baout how to make NAND's to OR's and vice versa, really cool!
>I'll buy all the expirimenting stuff tomorow so I can train my self and get some hands on experience in Digittal Electronics...


That is about it for the time being!

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Thu Apr 01, 2010 12:52 pm

Very cool indeed.

I do remember reading somewhere that no matter what kind of mathematic function a digital computer does - it is always using addition :D

For example I know that to subtract one binary number from another, you actually add them together but you invert the number that you want to actually take away.

Basically it is the same with decimal, E.G.

10 - 4 = 6

is the same as:

10 + (-4) = 6

I really don't know about multiplication - but be sure to let us know!

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Mattigasz » Thu Apr 01, 2010 9:34 pm

Well I got the multiplication info from this http://www.asic-world.com/digital/arith ... ultipliers
site. It is a brilliant site! It has tons of information about digital electronics...I have no clue how I got there but I am glad I did.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Fri Apr 02, 2010 10:56 am

Mattigasz wrote:Well I got the multiplication info from this http://www.asic-world.com/digital/arith ... ultipliers
site. It is a brilliant site! It has tons of information about digital electronics...I have no clue how I got there but I am glad I did.
Nice site, thanks for the link,

looks like you have some gates to put together :D

Chuckt
I practically live here!
I practically live here!
Posts: 1127
Joined: Sun Mar 28, 2010 1:36 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Chuckt » Sun Apr 04, 2010 1:02 pm

brad wrote:Man that is really cool.

I guess it might look something like the good ol' Altair 8800 in the end?

Image

I think that would be a great project and someday, I think I will give it a go. I definately dont have the time to dedicate to such a task at the moment though. So that's why you need to keep us all posted so we can see how yours comes along = )
I remember that Briel Computers has an Altair project.

http://www.brielcomputers.com/wordpress/?p=328

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Sun Apr 04, 2010 10:13 pm

I can't believe they still sell these!

The original kit was selling in the 1970's :D

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Mattigasz » Wed Apr 07, 2010 4:59 am

Okay here is the Instruction set as I have it now, notice there are no rotation or shifting functions but these can be made out of the other commands easily (at least rotation can be)

Arithemetic Functions:
-------------------------
1.ADD
2.SUB
3.MUL

Logical bit Operations:
-------------------------
4.AND
5.OR
6.NOT
7.XOR

Branching:
------------------------
8.JP
9.JPZ
10.JPO
11.DJNZ

Data:
------------------------
12.LD
13.POP
14.PUSH
15.SET
16.BITT
17.RES

Misc:
-----------------------
18.RET
19.NOP
20.INC
21.DEC
22.IN
23.OUT
24.HALT

Silly enough I can't seem to get the logic gates (CMOS 4000 series) to work so all of this is sheerly theoretical. I hope that I receive a book I ordered soon and I hope it can help me out on my circuits! However, I do know that the logic behind my computer does work becuase I tested it in a brilliant but infamous program called "MultiMedia Logic". I am also writing a "compiler" for my assembly language in python, well trying. This converts words into 1's and 0's and each 1 and 0 represents a switch on the front of the CLU (whether it should be switched on or off).

Ooh I might add descriptions for the instructions later but first I want to get something practical to work so I can show you! Otherwise I'll be keeping to rammble on purely theoretical stuff...

If there is any unclearity or you have specifc questions feel free to either post them here or mail me at: matthiascalis@hotmail.com

greetings!

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Wed Apr 07, 2010 5:55 am

This project is really making some ground. Nice work!

Is there a specific reason that you are using 4000 series chips?

The newer 74 series have much better specs and are more readily available.

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

400 series+ Update

Post by Mattigasz » Mon Apr 12, 2010 6:39 am

Well there is a reason, they are quite simple to use (so guess how frustrating it is I can't get them to work ) and the book I recently bought is constructed around the use of 4xxx's. Furthermore, there are no reasons besides that I have some 4xxx's chips already and that switching now may financially not be all to smart.

And that leads to the next problem. The original system as I posted It here is not only a very difficult startoff but also quite costly. which is why I have switched RIS, Reduced Instruction Set. I am just working on making THE most functional and most versatile instruction set. it comes up with one problem though, I'll have to exclude the hardware multiplication since all I want to do is to make a most efficient language as possible and Multiplication can be done in software...

Also I decided to let go of 16 bit arithemetic/registers. I made everything 8 bit so program size is reduced further (since the Program Counter is an 8 bit register). I therefor also dubbed the main user memory module STM, Short Term Memory...
Which again brings me to the next topic: EEPROM's, Either I am blind or I can not find one single EASY EEPROM, all I find is EPROM's with serial data being clocked in, since my system lacks a system clock that would be very unhandy so I prefer parallel writing. So if anyone has suggestions for good and easy E2PROM's, tell me! Same goes for (DIY) E2PROM programmers!

I'll give you mroe detailed information once I sorted everything out nicely because there are more obstacles, mostly I can not get my head on JP instructions. Also making software bit testing (or even hardware) is (to me) extremely difficult.

I hop I did not ruin all the exicitemt around the CLU with this post cause all it breaks down to is: a more robuste and simple design with minimum hardware. I hope that, by lowering the standards, I can actually achieve something that not only works but of which I can be proud!

Thanks for commenting and following this project, my mom and dad nearly fell asleep when I tried to explain all this so I am deligthed there are some people interested in my story...

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 2 guests