Omnimaga

General Discussion => Technology and Development => Other => Topic started by: AngelFish on April 09, 2011, 06:58:33 pm

Title: How to: Design a microprocessor
Post by: AngelFish on April 09, 2011, 06:58:33 pm
Since I've noticed a lot of interest in microprocessors here, I thought it was time someone put up a simple tutorial on microprocessor design. I don't claim to be anything even remotely resembling an expert on the subject, but I think I have enough knowledge to demonstrate the basic design principles.

To get started, you first need an electronics simulator. I recommend Logisim (http://ozark.hendrix.edu/~burch/logisim/) for a simple free program. However, I will not be using Logisim in these tutorials because I'm not as familiar with it and to encourage understanding of the fundamental concepts rather than the simulator. The principles and circuits will be identical, though. Also, some of the images are mine, some are from Wikipedia and other sources. Citations are not included because the circuits themselves are not copyrighted content.

The first thing to understand when designing your own microprocessor is that you're not going to be making the next Intel i7 chip clocking 2.25 GHz on your first attempt. Commercial microprocessors often rely on advanced hardware optimizations and design principles that are beyond the scope of anything short of a graduate level design course. After you accept that, processor design isn't quite the black magic it's often portrayed to be. Like programming, it's mostly a matter of understanding the interactions between different subsections of the hardware.

Logic gates

The most basic components of all of the electronic circuits we will be dealing with are logic gates. Logic gates are basically devices which produce outputs that are a logical function of their inputs. There are seven types of logic gates, each represented by the symbol next to it.
AND(http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/AND_ANSI.svg/100px-AND_ANSI.svg.png)
OR(http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/OR_ANSI.svg/100px-OR_ANSI.svg.png)
NOT(http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/NOT_ANSI.svg/100px-NOT_ANSI.svg.png)
NAND(http://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/NAND_ANSI.svg/100px-NAND_ANSI.svg.png)
NOR(http://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/NOR_ANSI.svg/100px-NOR_ANSI.svg.png)
Exclusive OR (XOR)(http://upload.wikimedia.org/wikipedia/commons/thumb/0/01/XOR_ANSI.svg/100px-XOR_ANSI.svg.png)
Exclusive NOR (XNOR)(http://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/XNOR_ANSI.svg/100px-XNOR_ANSI.svg.png)

The inputs to logic gates take the physical form of voltage levels, most commonly 0 V and +5 V (other values can be used but the exact values aren't important). By convention, these voltage levels are referred to as representing the binary values 0 and 1 respectively. The logic gates operate on these inputs according to their Truth tables (http://www.kpsec.freeuk.com/gates.htm). When the input combination matches an input combination on the left hand side of the corresponding table, the output is the same as that which appears on the right hand side of the table. For example, when the input to a NOT gate is 1 (+5 V), the output of the NOT gate is 0 (0 V).

Circuits

Logic gates are by themselves interesting, but there's no logic gate that implements say, a Z80 processor. This is because processors are composed of a lot of individual logic gates working together to accomplish the tasks required. So, let's start designing some small circuits that can do more than our individual logic gates.

1-2 Multiplexer (MUX): This device takes 2 data lines and an address line and places the value of of the data line whose address is equal to that of the address line on the output line.

(http://img.removedfromgame.com/imgs/DeMUX.png)

2-1 Demultiplexer (DeMUX): This performs the inverse operation to a MUX. It takes one data line as well as an address line as inputs and places the value of the data line on the output line whose value is equal to the value on the address line.

(http://img.removedfromgame.com/imgs/MUX.png)

Half adder: The half adder circuit takes two binary inputs and performs a binary addition on them. This produces two outputs, a sum and a carry-out.

(http://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Half_Adder.svg/220px-Half_Adder.svg.png)

Full adder: A full adder does the same thing as a half adder except that it also adds a carry-in bit to the operands.

(http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Full_Adder.svg/220px-Full_Adder.svg.png)

There are many other types of circuits, but these simple ones will eventually form the basis of our microprocessor.

Basic Memory

As any search through an electronics forum will reveal, memory is one of the most important parts of a computer. Like any important material, there are also a billion ways to accomplish its function. The most common are through what are known as flip-flops and latches (which are essentially the same thing). The most basic memory cell is known as an SR NOR latch and the circuit diagram is this:

(http://img.removedfromgame.com/imgs/SR latch.png)

While this looks simple, it has a few fundamental flaws. For one thing, the set and reset inputs are on two different lines. That's not ideal, since we will almost certainly be wanting to store data from a single line at some point. Secondly, what happens if both the set and reset lines are active at the same time? Does it set or reset? Well, we don't know. This is an example of a "Race condition" and it's a very bad thing to happen to a memory circuit. The cell goes into a state of indeterminacy and we have no way of predicting what the final state will be.

So, let's look at something else called the synchronous J-K flip-flop:
Spoiler For J-K Flip-flop:
(http://thinklikemalinga.files.wordpress.com/2010/11/jk-flipflop_4-nand.png)

The J-K Flip-flop avoids the disastrous race condition from the SR latch, but it still has those two annoying set and reset lines. As it turns out, if you replace the first level NAND gates with AND gates and the second level NAND gates with NORs, you end up with something called a T flip-flop (where T stands for Toggle...).

(http://thinklikemalinga.files.wordpress.com/2010/11/t-flip-flop3.jpg)

The T flip-flop is definitely a step in the right direction, since we have  only 1 data line (and a control line), but what if we don't want to toggle the bits every time the data line is active? In that case, you must go with something called a D flip-flop. D latches are the most commonly used type of solid state memory in existence today and will likely form the basis for most of our processor's memory.

(http://img.removedfromgame.com/imgs/D flip-flop.png)

The D latch is perfect for most purposes you will ever come across, but it turns out that you can optimize in many circumstances.
Spoiler For Cool D latch optimization:
(http://img.removedfromgame.com/imgs/Alternative memory cell.png)

You can eliminate two of the 5 gates in the D flip-flop with this optimization. However, like almost all optimizations, it has some drawbacks, namely that it requires a separate active low Enable input. Also, if the data must remain the same during the entire entire active half of the clock cycle. These are reasonable conditions for many circuits, though.

The truth tables for each of these circuits can be found here (http://thinklikemalinga.herobo.com/?p=195).

The ALU

At this point, we have every circuit we need to build a computer that can perform any computation we wish. For the sake of simplicity, however, let's limit ourselves to something more reasonable: a four bit microprocessor.

One of the most important parts of any processor is the Arithmetic Logic unit, or the ALU. The function of the ALU is basically to perform all of the arithmetic and logical operations within the processor. As you can imagine, processors like the Intel i7 with floating point trigonometric instructions have extremely complex and powerful ALU's. Since we don't have supercomputers to generate our circuit diagrams, we'll go for something easier to draw and understand. Before we can begin designing it, though, we need to know what it will have to do. In keeping with a simple design, we'll limit it to addition, subtraction, AND, OR, NOT, XOR, NOP and logical bitshifts. This might seem limited, but it's actually all you need to have a fully functional computer (although technically we could reduce the instruction set even further without reducing power). One thing that some people may notice is that addition and subtraction can be combined into one operation through the use of what's called Two's complement notation. While this is certainly possible for us, it would require that we dedicate one bit to be the sign bit. That's 25% of our operands dedicated exclusively to sign. Since the processor uses so few bits, we'll instead use dedicated circuits for addition and subtraction.

Next: Putting it all together

Title: Re: How to: Design a microprocessor
Post by: Ashbad on April 09, 2011, 07:06:16 pm
Thank you so much for this :D is is extremely helpful :)

+1, can't wait for basic memory and registers :)
Title: Re: How to: Design a microprocessor
Post by: jnesselr on April 09, 2011, 07:48:39 pm
lol, shouldn't HELLO WORLD be OR?
Title: Re: How to: Design a microprocessor
Post by: Ashbad on April 09, 2011, 07:50:16 pm
I think he did that for effect :)
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 09, 2011, 07:51:23 pm
Oh, lol. I was testing table alignment. Fixed.
Title: Re: How to: Design a microprocessor
Post by: jnesselr on April 09, 2011, 07:51:32 pm
I think he did that for effect :)
Well, I mean that is the OR gates symbol.  and I think this is ninja'd.

EDIT: Hey look, ninja'd
Oh, lol. I was testing table alignment. Fixed.
yeah, np.
Title: Re: How to: Design a microprocessor
Post by: tloz128 on April 09, 2011, 07:57:21 pm
This is so weird. Right as I was going on here I was thinking to myself that I'd like to ask somebody about building microprocessors.


...now I'm scared. :o
Title: Re: How to: Design a microprocessor
Post by: Binder News on April 09, 2011, 08:23:56 pm
Creepy...
Anyways, very cool. It's something I've been thinking about as well, so this will be cool!
Title: Re: How to: Design a microprocessor
Post by: Ashbad on April 09, 2011, 09:09:43 pm
Wow, I was playing around in logisim with this stuff, and its actually insanely fun -- it might even convince me to major in this type of engineering (long way off, but still) this is just so awesome.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 09, 2011, 11:28:00 pm
Added a short section on memory.
Title: Re: How to: Design a microprocessor
Post by: tloz128 on April 10, 2011, 11:46:41 pm
yay! keep it coming :)
Title: Re: How to: Design a microprocessor
Post by: Munchor on April 11, 2011, 05:26:34 am
Added a short section on memory.

Nice, I just skimmed through it, as it looks very nice, I gotta print it and read it later, since my eyes are tired.

Will you be adding registers soon?
Title: Re: How to: Design a microprocessor
Post by: jnesselr on April 11, 2011, 07:34:05 am
This is fun to go over and then jump to logism to mess with it. Keep the tutorials coming, please. :D  (In the end, you should probably convert this to a pdf or something.)
Title: Re: How to: Design a microprocessor
Post by: aeTIos on April 11, 2011, 07:47:35 am
Registers are easy, I think. It is just placing it. But it might be added, though :)
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 12, 2011, 07:04:21 pm
Okay, I built an ALU in Philosophy today (that includes 4 bit multiply). I'll try to post something about how to design your own later. However, it won't be including division, because that's a whole 'nother bucket of pain.

Also, this thing is freaking massive. I can't even fit it on a single screen without a lot of zooming out.
Title: Re: How to: Design a microprocessor
Post by: tloz128 on April 17, 2011, 11:05:57 pm
bump
Title: Re: How to: Design a microprocessor
Post by: willrandship on April 17, 2011, 11:16:43 pm
I designed my own base-4 AND, OR and NOT gates from scratch, as well as a base-4 RAM circuit with only 3 wires, clock, input, and read :) fun stuff! it got me a few scholarships.

BTW, I also made my adder, but the gate designs make some naughty assumptions involving saturation in the binary circuits, so I built mine from discrete components.

I'm working on a 2-qit CPU :)
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 17, 2011, 11:27:50 pm
Sorry, I've been building CPU controller, so I haven't gotten around to posting tutorials.
Title: Re: How to: Design a microprocessor
Post by: willrandship on April 17, 2011, 11:33:03 pm
Fun!

Really, for the tutorial, I think you should focus more on smaller circuits and how they work, than, say, "here's a giant circuit that does this!"

Not criticism since you haven't done it yet :P just a thought.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 17, 2011, 11:44:02 pm
What, you mean people can't instantly understand that this circuit multiplies two 4 bit numbers? :P

(http://img.removedfromgame.com/imgs/Multiply.png)
Title: Re: How to: Design a microprocessor
Post by: willrandship on April 17, 2011, 11:45:39 pm
Well, I can, of course, but not people who need tutorials :P

J/K I don't know many binary circuits, I can dissect them though. What are the square ones? ICs aren't allowed! :P too big.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 17, 2011, 11:51:16 pm
The rectangular ones with multiple inputs are all different variations of D flip flops. The square things near them are just binary probes that allow me to see the state of the circuit while it's running. It's actually quite a simple design. The multiplier is subtracted by 1 and placed in a decrementing circuit, then the multiplicand is placed in another circuit where it's summed with itself until the multiplier equals 0. When it equals 0, a gate turns on and dumps the contents of the multiplicand register in an outbound register on the external data line.
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on April 18, 2011, 12:14:25 am
If you're going to build a microprocessor of any kind, simple or complex, you do NOT want to be doing this on a gate/transistor level. The most appropriate course for creating such a circuit is describing it behaviorally in Verilog and then either running it through ModelSim or downloading it to an FPGA (Field Programmable Gate Array).

Also, the sheer number of wires in your schematic gives me a headache when I look at them. :P
Title: Re: How to: Design a microprocessor
Post by: yrinfish on April 26, 2011, 01:10:56 pm
The jk flipflop doesnt work in logisim, all inputs are allowed to be 1 at once, but it stops with the error 'oscillation apparent'
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 26, 2011, 01:17:47 pm
That's not a flaw. When all inputs (Set, Reset, and Clock) are 1, then you're telling the device to both set and reset itself simultaneously. Instead, it just toggles the current value in the cell. If you keep the clock line high, then it will continue toggling the value, resulting in that oscillation error.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on April 26, 2011, 01:23:45 pm
I know, but it shouldnt do that, should it?
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 26, 2011, 01:30:29 pm
That's how the circuit was designed to react, so yes. The reason it's more useful than the SR latch I mentioned before it is that the output is predictable. Actually, you get the T flip flop by basically tying the S and R lines together.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on April 26, 2011, 01:38:44 pm
the output is predictable, but if it 'crashes' the simulation, it isn't useful at all...

Does it work in RL this way? And how can Logisim have it built in while it doesn't work?
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 26, 2011, 01:42:56 pm
The circuit actually works like that in real life, so the problem is Logisim's error handling. As for how it works when it's built in, I imagine they did either of two things: They made the circuit so that it only works on rising/falling edge of the clock, which avoids the problem, or they wrote code in to handle the toggle case.

If you're having problems with the circuit in Logisim for certain inputs, all I can really say is to use the built-in JK flip flop or just not let the circuit reach a state where the clock signal is always high.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on April 26, 2011, 01:58:25 pm
Is there a way to use that rising/falling edge with logic gates?

I'm trying to do it without any built-in things, only logic gates...
Title: Re: How to: Design a microprocessor
Post by: AngelFish on April 26, 2011, 03:41:02 pm
Logisim doesn't really emulate the hardware well enough to give you a a reasonable way, so effectively no.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on April 26, 2011, 04:16:06 pm
ok, then ill connect the J and the K and put an inverter between them...

That's actually just as useful!!
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 03:06:29 am
Okay, since this is due tomorrow today, I've been working on it. I'll post the rest of the tutorials when I get a life.

Here's a preview to make your head hurt:

(http://img.removedfromgame.com/imgs/0-processor_.png)
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 03:18:38 am
Seriously, people. Verilog.

What, exactly, is to be gained by having a gate-level schematic of a microprocessor? If that image is part of your tutorial, then you are far from keeping this tutorial simple. You are treading in a territory that electrical engineers have long forsaken and (I assume) have no intent of returning to.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 03:21:14 am
Well, one thing to be gained by me is a grade :P

I also just posted this because multiple people have made posts describing gate level schematics.

Also, the image isn't part of the tutorial. That's much worse than what the actual tutorial CPU will be.
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 03:27:12 am
Well, one thing to be gained by me is a grade :P

I also just posted this because multiple people have made posts describing gate level schematics.

Also, the image isn't part of the tutorial. That's much worse than what the actual tutorial CPU will be.

If your school project is to make an Electrical Engineering major have a cerebral infarction or an aneurysm-hemorrhage, then you get full credit plus some! X_x

I'm glad that image isn't part of the tutorial but still. Some things were never meant to be described on the gate level for reasons of sanity, time, space, and understanding.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 03:29:34 am
 :w00t:

w00t full credit
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 03:34:45 am
For the record, I'd just like to state that I'm not trying to flame or troll or insult anybody. Rather, as an EE Major, I am compelled to ... emphasize certain things. If y'all want to build simple microprocessors at the gate level, be my guest. I warned you twice or thrice about how masochistically insane it can be. As Qwerty's brain-buster image so demonstrates, this stuff gets complex fast. The amount of time you'll spend debugging something like that will grow exponentially to the point you may as well call it outright impossible.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 03:36:10 am
I've spent less than five minutes debugging that microcode instruction ROM and it works perfectly...

I *did* spend an hour wiring it up, though.
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 03:39:15 am
I've spent less than five minutes debugging that microcode instruction ROM and it works perfectly...

I *did* spend an hour wiring it up, though.

You're either really good or really lucky or both. Fact of the matter is, it's still a pain in the butt. I've spent more time debugging simpler circuits. Furthermore, what's the practical application of creating a simulated schematic like that, anyway?
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 03:40:37 am
There's pretty much no practical application for it, except a general understanding of how computers work at their most basic level.
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 03:47:52 am
There's pretty much no practical application for it, except a general understanding of how computers work at their most basic level.

I guess that's a worthy reason but it's not exactly a marketable one unless you're going into microprocessor design for a career. Personally, if you want to just generally understand how computers work at their second-most basic level (most basic would be literally arrays of transistors), I'd suggest playing around with simpler sequential logic machines. Build a simple vending machine facsimile or a simple cruise control analogue. They're much, much less difficult in comparison and they teach the general concept of computers as state machines and how volatile memory works.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 03:50:16 am
I know, designing a vending machine was the *other* project we had to do...

I didn't use state machines to design any of the circuits in that diagram, though ;)
Way too much work to draw out the transition table for such a complex device.
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 03:55:27 am
[...]
I didn't use state machines to design any of the circuits in that diagram, though ;)
Way too much work to draw out the transition table for such a complex device.

Eh wot? <translation: please clarify your post for I am confused>
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 04:00:21 am
Er, I didn't use any of these (http://www.ee.surrey.ac.uk/Projects/Labview/Sequential/Course/04-State_Dia/state1.html)
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 04:01:44 am
Er, I didn't use any of these (http://www.ee.surrey.ac.uk/Projects/Labview/Sequential/Course/04-State_Dia/state1.html)

You're a maniac . _ .
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 04:02:00 am
What's wrong with that?  ???
Title: Re: How to: Design a microprocessor
Post by: TsukasaZX on May 03, 2011, 04:03:07 am
Designing any sort of sequential logic circuit without use of state diagrams and the like? Madness! Utter madness! ... You'd make a great engineer because you are obviously the world's biggest masochist and/or the world's smartest engineer :P
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 03, 2011, 04:04:25 am
lol, logical circuits just make sense to me.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on May 12, 2011, 01:21:30 pm
Er, are you guys going to hate me if I ask a question that is most likely connected to a project that is too big for me?

How the **** do I design an 4 bit instruction set?

This is my latest one:


nop  jz   jnz  jmp
push pop  call ret
not  lit  ld   sto
add  xor  or   and


lit is a inmediate value to a register.
ld and sto are for RAM

Do you have any examples? Do I miss something?
Title: Re: How to: Design a microprocessor
Post by: matthias1992 on May 12, 2011, 02:23:45 pm
Please, If you feel comfortable with logisim, use it but Multimedia Logic is SOOOOOOO much easier, really easy to use, pretty fast, has snap to grid functions can read and write files and has memory modules! its really great give it a try, not very well documented or well known in general but its so easy...

So at least take a look at I say...its really worth it!

http://www.softronix.com/logic.html

site may look like *** but its really great software, been using it more than 2 years now!
Title: Re: How to: Design a microprocessor
Post by: matthias1992 on May 12, 2011, 02:42:36 pm
Er, are you guys going to hate me if I ask a question that is most likely connected to a project that is too big for me?

How the **** do I design an 4 bit instruction set?

This is my latest one:


nop  jz   jnz  jmp
push pop  call ret
not  lit  ld   sto
add  xor  or   and


lit is a inmediate value to a register.
ld and sto are for RAM

Do you have any examples? Do I miss something?
sorry for the double post how about adding a neg (2's complement) lea (load effective adress) might also be nice but isn't a necessity for a 4 bit microprocessor at all. Hardware multiplication is always nice but not necessary either. Also I recommend you consider properly what does it need to do? this should be the most fun part, you are making your own language, make sure you comprehend it yourself. make it as you wish it.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on May 12, 2011, 03:00:08 pm
Er, do you really think that that is better?
Logisim has a cleaner design, is portable, and I do really prefer the symbols over those MMLogic has.
I do not see things that I miss in Logisim... (OK, that file stuff may be useful but I do not miss it)
MMLogic was last updated 7 years ago...

But please back to my question
Title: Re: How to: Design a microprocessor
Post by: yrinfish on May 12, 2011, 03:02:40 pm
er, not add 1 is the same as neg? and I do not really have much space left (er, ok, no space left)

How many registers should I use?

remember, this is more than slightly linked to creating the whole thing using logic gates.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 12, 2011, 03:56:57 pm
Er, are you guys going to hate me if I ask a question that is most likely connected to a project that is too big for me?

How the **** do I design an 4 bit instruction set?

This is my latest one:


nop  jz   jnz  jmp
push pop  call ret
not  lit  ld   sto
add  xor  or   and


lit is a inmediate value to a register.
ld and sto are for RAM

Do you have any examples? Do I miss something?

Basically, the only way to do it is to design the whole computer. There are actually quite a few ways to do it, though. I'll assume you use what's called the Princeton architecture rather than the Havard architecture (Google those if you're unfamiliar). The simplest way within the Havard architecture is to use "microcode" to tell the program to react to the opcode. To access the opcode, you need to retrieve it from memory using a data bus. Then, with microcode, you need to use the opcode to retrieve the microcode from a ROM array. This is easily done by using the Opcode as the selection inputs to a multiplexer. The Microcode should then be written so that it controls the individual components to direct your data (from memory or elsewhere) into the proper components and places. That's one of many ways to implement an instruction set.

Also, I highly recommend not using a stack. That's a bit more advanced than you probably want to go. Keep in mind that the features included in most modern processors are not always easy to replicate in hardware. As TsukasaZX said, you should use Verilog and an FPGA if you want a fully featured microprocessor.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on May 13, 2011, 03:58:52 am
No stack? er, ok 4 more opcode spaces... how do I call functions then?

and is princeton the same as von Neumann, because that is the one I want, I LOOOOOVEEE SMC.

I will have a look at a hexadecimal z80 chart for ideas.
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 13, 2011, 05:05:01 am
No stack? er, ok 4 more opcode spaces... how do I call functions then?

and is princeton the same as von Neumann, because that is the one I want, I LOOOOOVEEE SMC.

Er, not sure why I used Princeton instead of Von Neumann, but yeah. Also, why do you need to call functions? A 4 bit PC can only address 16 words of memory unless you use more advanced techniques like paging or virtual memory. There isn't much room for the main program, let alone subroutines.
Title: Re: How to: Design a microprocessor
Post by: yrinfish on May 13, 2011, 05:23:34 am
Thats true, what opcodes should I add in the new space?
maybe sub, neg, shift...
How many registers should I use? 4 is useful, but when I make the ip non-accesible with assembly, 2 could be enough.
Title: Re: How to: Design a microprocessor
Post by: Broseph Radson on May 16, 2011, 08:07:38 pm
After its done, you should make a tutorial on how to do this with Minecraft redstone circuits ;D
Title: Re: How to: Design a microprocessor
Post by: AngelFish on May 18, 2011, 03:41:18 pm
lol, it's basically the same thing, except you have to build the logic gates yourself :P
Title: Re: How to: Design a microprocessor
Post by: Broseph Radson on May 18, 2011, 11:09:51 pm
And stair-step thousands of blocks since you cant overlap redstone. And think of all the repeaters O.O
Title: Re: How to: Design a microprocessor
Post by: yrinfish on May 24, 2011, 03:02:25 pm
Bukkit and some redstone mods will help. but back to the topic, when are the next lessons ready? I'm hungry.
Title: Re: How to: Design a microprocessor
Post by: fb39ca4 on June 27, 2011, 09:58:44 am
lol, it's basically the same thing, except you have to build the logic gates yourself :P
It's still slightly different, though, as redstone does not need to be in a circuit.
Title: Re: How to: Design a microprocessor
Post by: ruler501 on June 27, 2011, 10:23:18 am
lol, it's basically the same thing, except you have to build the logic gates yourself :P
It's still slightly different, though, as redstone does not need to be in a circuit.
I'm confused enough with these regular processors. I'd hate to have to try and make a redstone one
Title: Re: How to: Design a microprocessor
Post by: aeTIos on May 28, 2012, 01:47:48 pm
is this dead? D:
Title: Re: How to: Design a microprocessor
Post by: Keoni29 on May 28, 2012, 02:42:29 pm
Microcontrollers <3 I'm building a 4 bit mcu.
Title: Re: How to: Design a microprocessor
Post by: ruler501 on May 28, 2012, 02:44:29 pm
Holy Necropost Batman

And probably as the last post was a year ago(nearly)
Title: Re: How to: Design a microprocessor
Post by: Keoni29 on May 28, 2012, 02:58:09 pm
Don't care actually. Not making a new topic for this:
(http://img.removedfromgame.com/imgs/rps20120417_211037.jpg)
Title: Re: How to: Design a microprocessor
Post by: Nick on May 28, 2012, 03:02:41 pm
wOw ö

but what does it actually do? i mean, what are these buttons used for etc.. ?
Title: Re: How to: Design a microprocessor
Post by: Keoni29 on May 28, 2012, 03:32:33 pm
wOw ö

but what does it actually do? i mean, what are these buttons used for etc.. ?
This is one half of the Arimethic logic unit (short ALU) which is the part of the cpu that performs all sorts of logic operations. This is a picture I took a while ago. I'm now building the control logic.