Computing.Net > Forums > CPUs/Overclocking > building a cpu. i need HELP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

building a cpu. i need HELP

Reply to Message Icon

Name: vishal sharma
Date: June 20, 2007 at 12:51:06 Pacific
OS: vista
CPU/Ram: cpu:1.83 core 2 duo ram:1
Product: dell inspiron 9400
Comment:

hello everyone.
i am attempting the impposible. i am building a consol. so i need to start with the first thing.BULIDING A CPU.i whant to build a simmple 8bit cpu clocked at preferable about 8mhz and im still not sure how fast to make my fbs speed but i will deside that when i get there.
so if anyone can explain me how to build a cpu that would be great.
so jam i hope you can help me out because you seem to b a wizard at cpus and grafics cards ect...
ow and i need to be explaind about transisters and flip flops ect...



Sponsored Link
Ads by Google

Response Number 1
Name: vishal sharma
Date: June 20, 2007 at 12:52:36 Pacific
Reply:

and ive benn meaning to ask did you make this website jam


0

Response Number 2
Name: 02coled
Date: June 20, 2007 at 13:15:01 Pacific
Reply:

why dont you just buy an 8bit cpu ?? Cause i think it may be very hard if not near impossible to build an cpu considering, also cpus are made up of millions of logical gates!
Anyhow good luck!
02coled

Core2Duo E6400 @ 3.4ghz
2gb Elipedia 1066mhz5,5,5,15
EVGA 680i
Ati Radeon X600 128mb
680w Thermaltake Purepower
2 x 250gb Sata
XP Home


0

Response Number 3
Name: brighteyes
Date: June 20, 2007 at 13:30:02 Pacific
Reply:

CPU = Central Processing Unit

I do not feel that you have the equipment to manufacture a CPU, I would leave it to VIA, IBM, AMD or Intel to undertake this task.

As to the website Justin Weber is the Admin and has been fo a long time...

Actually any good Library will have books on Electronics as CPU design has more to do with electronics than PC's !!


0

Response Number 4
Name: jackbomb
Date: June 20, 2007 at 20:31:36 Pacific
Reply:

You're asking how to build a CPU and you need to be explained how transistors work (as well as how to correctly spell transistor)?

I'd snuff up on the basics first by hitting the library (or Google). Then closely study chips such as the Zilog Z80 and MOS 6502.

The Z80 is perhaps one of the most popular 8-bit chips available. They're in Gameboys, older consoles and computers, TI graphing calculators, and probably a lot more. Wouldn't be surprised if a good old Z80 controlled the electronic control panel of a modern washing machine.

The MOS 6502 powered the good old Apple II series computers.

Once you really know how these basic (by today's standards) chips work internally, you could get to work in building a similar chip (a clone). Companies such as NEC made their own versions of chips such as the Intel 8088, to better suit their hardware. NEC called their i8088 clones "V30", if I remember correctly. You could modify slightly from the original design of the CPU to perfectly fit the console you want to build.

As for designing your own CPU from the ground up (without referring to previous designs), I'd imagine that would be pretty tricky to do all on your own. Even a simple 8-bit model. I could be wrong, though. Good luck.

Pentium III--Descendant of Intel Core.
Pentium III-S 1400 @ 1.63GHz, 512K L2
X800XT AIW OC 580/600
2GB of RAM
250GB HD
SB Audigy 2
QDI Advance 12 mobo
Smugly running Vista


0

Response Number 5
Name: Sabertooth
Date: June 20, 2007 at 22:00:27 Pacific
Reply:

"i am attempting the (sic) impossible.."

Not really - it's more like you are just attempting to reinvent the wheel. You biggest obstacle was partly mentioned by jackbomb when he alluded to having to do this all without borrowing from the advanced knowledge already out there on the subject.

This is like an engineer whose flown in a 767 many times today trying to built from scratch a plane similar to one from the Wright brothers early models. It is quite possible, but it sure is going to be pretty d@mn hard not to think outside the box .... LOL

Interestingly though, I'd like to see you do it.


0

Related Posts

See More



Response Number 6
Name: vishal sharma
Date: June 20, 2007 at 23:56:38 Pacific
Reply:

guys guys guys i apprishate the help but i realy need to build a cpu.and the point of the cpu was for it to be a z80 or more powerfull for a project im doing. also i needed to find out how the cpu works in the first place 2 no how to desighn my mainboard but if any one cant help me build acp can any of you guys tell me were i can bye a z80. and if im forced to bye a z80 can any one help me desghin and build a mainboard.
and i no my spelling i atroshas so plz dont critisize


0

Response Number 7
Name: Mattwizz3 (by mattwizz3)
Date: June 21, 2007 at 01:47:07 Pacific
Reply:

Building a CPU is almost near impossible for someone to do as a home project. There are millions of transistors in a CPU or for an 8MHz CPU probably thousands. Building one would be extremely complicated and you would have a ton of issues with heat and power. A basic 8MHz retail CPU would be pretty dang small. A home made one would probably be the size of a fridge. Then making a a mainboard would be difficult too.

If by a miracle you got one working, it probably wouldn't work for long because of the huge amounts of power it would pull and its thousands points of possible failure.
Sorry to be a killjoy but it really just isn't going to happen. Especially if you don't have an advanced understanding of logic gates or machine code.

What sort of console do you want anyways? Just buy a mini ITX pc and your done!

Mattwizz3 :

Vista Home Basic
2.2GHz Sempron
1GB DDR400
GeForce 6800Ultra


0

Response Number 8
Name: vishal sharma
Date: June 21, 2007 at 03:10:19 Pacific
Reply:

then can anyone tell me were to get a z80 cpu


0

Response Number 9
Name: vishal sharma
Date: June 21, 2007 at 05:27:35 Pacific
Reply:

i no if i build a cpu it will be the size of a fridge but i am determand to make a cpu.if i cant make 8 mhz then i will go down to 4mz as far as i have to go just to make a flipping prossesor


0

Response Number 10
Name: brighteyes
Date: June 21, 2007 at 05:32:44 Pacific
Reply:

http://www.zilog.com/


This is beyond a PC question this is ELECTRONICS,

http://www.nutsvolts.com

http://www.epemag.wimborne.co.uk

You need more than just a CPU you will need a development kit as well, as you need all the components to talk to the CPU, hope you have a few thousand $$$$$$$$$$$$$$$$$$

http://www.mouser.com/search/refine...


0

Response Number 11
Name: vishal sharma
Date: June 21, 2007 at 07:25:07 Pacific
Reply:

dont worry money isent an issue


0

Response Number 12
Name: vishal sharma
Date: June 21, 2007 at 07:33:07 Pacific
Reply:

ok i giv up im going to by a z80cpu. so now we got the cpu sorted can anyone help me make a motherbaord


0

Response Number 13
Name: brighteyes
Date: June 21, 2007 at 09:31:18 Pacific
Reply:

JEEZ>>>

http://www.mouser.com/search/refine... have all the goodies you require to build basic I/O system.

You really need to go to an Electronics Hobbysit Forum! GOODBYE!


0

Response Number 14
Name: jackbomb
Date: June 21, 2007 at 09:39:22 Pacific
Reply:

Again, go to the library, or if it's too hot outside, try Google.

They'd be a much better source of information than any of us here. We're just pre-built hardware/software/networking geeks. :) I doubt that any of us could build a motherboard from scratch. If I'm wrong, I'd like to know.

I once ran into a whole book devoted to the Motorola 68000 processor at the local library. It covered pinouts, motherboard designs, timing crystals, and a plethora of other data. Another book covered the Intel Pentium in a similar fashion. If you could find a book that really got into the Z80 (I'm sure there are plenty of them), then I'd start there for motherboard design.

Sorry if I was a little too harsh with your spelling. It's just that the vast majority of tech heads serious with microprocessor design wouldn't be caught dead incorrectly spelling 'transistor', that's all. :P


Pentium III--Descendant of Intel Core.
Pentium III-S 1400 @ 1.63GHz, 512K L2
X800XT AIW OC 580/600
2GB of RAM
250GB HD
SB Audigy 2
QDI Advance 12 mobo
Smugly running Vista


0

Response Number 15
Name: Sabertooth
Date: June 21, 2007 at 13:28:24 Pacific
Reply:

vishal sharma,

If you have access to fleabay you might get lucky....


0

Response Number 16
Name: vishal sharma
Date: June 22, 2007 at 11:56:56 Pacific
Reply:

i tryed to look in my local libary but found nothing. nothing at all. so if anyone knows a website on how to make a mainbord i would be very greatfull. by the way i never get a sunny day im in england :). so if any on knows any frends or relitives that can build a mainbaord i will ow one


0

Response Number 17
Name: vishal sharma
Date: June 22, 2007 at 12:26:05 Pacific
Reply:

and also what is fleabay


0

Response Number 18
Name: Sabertooth
Date: June 22, 2007 at 12:39:37 Pacific
Reply:

Fleabay is a loose term for eBay.


0

Response Number 19
Name: vishal sharma
Date: June 22, 2007 at 12:45:33 Pacific
Reply:

ok bare with me i no this is going to sound like a noob question
what do i need to put in the mainboard:
g.p.u.
c.p.u.
r.a.m.
r.a.m. slot/expantion slot
sound c.p.u.
4 u.s.b. ports for four controllers
soldering iron
solder
bios
desghn a case
2 memorycard slots for saving games
disk/carrtrage drive
some sort of t.v. out
desghine and build a controller
p.s.u.
power conector for the mainboard
fan(s)
head phone/speaker jack
some sort of storage eg hard drive
plcc socket for my z80 c.p.u.(or my co c.p.u. for sound)
and a c.p.u. socket
now could someone tell me if i am missing anything and the most difficult question how to wire them together on my mainboard if you know how


0

Response Number 20
Name: vishal sharma
Date: June 22, 2007 at 14:29:15 Pacific
Reply:

ah so thats what fleabay means


0

Response Number 21
Name: Sabertooth
Date: June 22, 2007 at 14:29:31 Pacific
Reply:

Yup!

Trying not to be mean, but I think you are in WAY OVER your head on this project.

JOOC, have you even ever assembled a computer -- of course with pre-fabricated components -- let alone trying to fabricate a circuit board? You shouldn't attempt flying when you've barely mastered crawling .... LOL

Just get on eBay & buy your relic motherboard.



0

Response Number 22
Name: jam
Date: June 22, 2007 at 14:31:07 Pacific
Reply:

LOL...I may be fairly good at assembling hardware components, but I ceratinly don't know how to build a microprocessor from scratch!

I think the whole idea is rEEEdiculous!

What exactly are you trying to build? what is a "consol" & what do you do with it?

As the others have said, a homemade CPU would be anything but "micro"...it would be huge!

Does that mean you're gonna build your own RAM too? And your own GPU? And a board to put the GPU on? What about a hard drive?

"desghn a case"

A 20' x 20' garage w/24" diameter cooling fans should big enough...lol.

Did you ever see the movie "PI"? I suggest you stay away from power drills.

http://www.youtube.com/watch?v=oQ1s...


FLATURIN - Hand-to-mouth goodness. It's good!


0

Response Number 23
Name: jboy
Date: June 22, 2007 at 19:54:50 Pacific
Reply:

This seems to have more to do with psychiatry than electronics

Censorship is the tool of those who have the need to hide actualities from themselves and others. Their fear is only their inability to face what is real.


0

Response Number 24
Name: vishal sharma
Date: June 22, 2007 at 21:07:50 Pacific
Reply:

my idea may seem farfeched but i know it is doable and that was the hole point of my mini project. my "console" will be a games console with 4 controllers, with 2 memory card slots for game saves and will run at an amazing 60 fps lol. what i what to do with it is to make a consol like the sega jenesis and play my own home made games. as i sed in a previous mesage i giave up on making a cpu so i btought the z80 cpu used in the sega genisis but then i found out it was a co cpu for the sound and my actual cpu will be a moterola68000. i will be stealing my ram from an old nintendo 64 i have. my storage orhard drive will be a 20-60gb flash card. a case desghn is exactly what it ses im making a case to put all the parts in and it will be made from prbably wood because i dont have a machine to mold plastic. also do you now were to get a 20x20 fan. and that ip movie looks good i might rent it. what is "psychiaty". and finaly does any one know were to buy a moteroller 68000 cpu.


0

Response Number 25
Name: vishal sharma
Date: June 22, 2007 at 21:26:42 Pacific
Reply:

i can build a regular pc i just wanted to take it to the next lvl to response 21


0

Response Number 26
Name: jackbomb
Date: June 22, 2007 at 21:28:13 Pacific
Reply:

Good luck making the RDRAM from an N64 work with your MC68000 processor.

You're gonna have to build one heck of a neat memory controller to pull that one off.

psychiatry

Pentium III--Descendant of Intel Core.
Pentium III-S 1400 @ 1.63GHz, 512K L2
X800XT AIW OC 580/600
2GB of RAM
250GB HD
SB Audigy 2
QDI Advance 12 mobo
Smugly running Vista


0

Response Number 27
Name: vishal sharma
Date: June 22, 2007 at 21:30:12 Pacific
Reply:

and i think you may be right i am way over my head but were there's a will there's a way


0

Response Number 28
Name: vishal sharma
Date: June 22, 2007 at 21:56:00 Pacific
Reply:

when you put it like that i just might nik the n64 cpu


0

Response Number 29
Name: vishal sharma
Date: June 22, 2007 at 21:58:04 Pacific
Reply:

does anyone no how to open up a n64 without ripping open the case


0

Response Number 30
Name: brighteyes
Date: June 22, 2007 at 23:41:34 Pacific
Reply:

This is post 30 and the OP is the most arrogant idiot one could come across, he has been given links and advice and will he take it, just asks us bloody stupid questions.

I pointed out he need a Test Kit and CPU etc, but would he buy it or go to the link. NO NO NO.

This poster should be BANNED from all FORUMS in the world he is of his head and 24 short of a dozen.

Now go forth and multiply...............


0

Response Number 31
Name: vishal sharma
Date: June 23, 2007 at 03:24:14 Pacific
Reply:

there was a reson why i dident use your link.
i dont have a creadit or debit card
im not old enuff to have a crdit or debit card
my pearnets dont shop onine and dont like shoping online not even banking online.
so thats why i asked if any one knows how to open up a n64 to get some parts from there. the link with the issues from a news agent i couldent do that because i dont have a local news agents anymore


0

Response Number 32
Name: Mattwizz3 (by mattwizz3)
Date: June 23, 2007 at 20:35:40 Pacific
Reply:

HAHA, 60FPS with a Z80 CPU. haha. OK, this is NOT doable - EVER. You cant do this because of the HUGE amount of knowledge needed, enormous parts cost, the 5 rooms that you will need to fit everything in. there is not enough information on the entire internet to help you through such a project. just forget it and buy a dang PC, Xbox, PS2 or WHATEVER.


Mattwizz3 :

Vista Home Basic
2.2GHz Sempron
1GB DDR400
GeForce 6800Ultra


0

Response Number 33
Name: vishal sharma
Date: June 24, 2007 at 02:14:26 Pacific
Reply:

yes that may be trure but that was why i desided to make the z80 a co prossecor and the motaroller68000 as the main procesor.


0

Response Number 34
Name: vishal sharma
Date: June 24, 2007 at 02:17:26 Pacific
Reply:

thanks guys for all the help but no one can give me a straight arnser:).


0

Response Number 35
Name: brighteyes
Date: June 24, 2007 at 03:13:00 Pacific
Reply:

As already stated you need an Electronics Forum, this subject is not applicable here, that is why we can not help, now go away you silly boy:

http://www.electronics2000.co.uk

http://www.dutchforce.com/~eforum/i...


0

Response Number 36
Name: vishal sharma
Date: June 24, 2007 at 05:49:28 Pacific
Reply:

ok ok you made your point


0

Response Number 37
Name: firedragom
Date: June 24, 2007 at 18:40:07 Pacific
Reply:

All I can say is...LOL


0

Response Number 38
Name: frantz
Date: June 28, 2007 at 14:03:09 Pacific
Reply:

I dont know why everyone is being so hard on the op. To be honest with you guys, i think that building a home made console is a quite interresting, and fun project. I already thought of building a home made console myself in the past, but then gave up because of the lack of ressources.

I dont think theres a tutorial out there that teaches you how to make your own mother board, or cpu, or game console.

All i can say is good luck, and if you ever find a good book, tutorial, or some way to start this project, please let me know.
my email is uprise01@hotmail.com


0

Response Number 39
Name: Derek
Date: July 4, 2007 at 14:16:08 Pacific
Reply:

frantz

If you put your email address in open text on a forum the spammers engines will home in and you'll get junk mail forever. We only have to click your name to get it securely. If you must write it out then disguise it.

As for this post, I feel sure it was one of the best leg pulls I've seen. It certainly caught a few people.

DerekW


0

Response Number 40
Name: vishal sharma
Date: July 6, 2007 at 16:27:51 Pacific
Reply:

thank you frantz somone finaly gets me on why i whant to builld a computer but now i realize that it is very hard and you will need extream dextarit to make one and i will give you an exampl on how complex it is with just a 8 bit cpu

The CPU is usually the most complicated part of a modern microcomputer. It consists of several important and intricate sections, most of which are not well understood, even by seasoned computer engineers. Yet a CPU can be actually quite simple if you break it down into its fundamental component parts. The main parts of a CPU are essentially:

Registers A CPU has several registers inside it, which are really very tiny memory locations that are referred to by a name, rather than by a number, as normal memory locations are. Of these registers, the most important is the instruction pointer (IP), a register which contains the address of the next memory location which the CPU should get an instruction from. The instruction pointer is sometimes also known as the program counter (PC). Another important register which almost every CPU has is the accumulator, a general-purpose holding space which the CPU uses to temporarily store values it is getting ready to do something with.

Instruction decoder and control matrix The most fundamental job of a CPU is to obey instructions. The CPU receives instructions from memory, and then acts on them. In order to use the instructions it receives, the CPU needs a circuit to actuate the instruction (which is really just a string of 1s and 0s) into action. That circuit consists of two fundamental parts: The instruction decoder, a system which triggers one of several possible action circuits based on which instruction it is currently processing; and the control matrix, which takes the output from the instruction decoder and activates a series of control signals based on which instruction is being executed. Note that not all CPUs use instruction decoders and control matrices; an alternative to this system is to simply use a ROM chip which outputs the control signals needed for each opcode. In this case, each instruction is actually a memory location within the instruction ROM. However, in the construction of very simple CPUs, an instruction decoder and control matrix system is typically used because it makes it easier to see the cause-and-effect of the various parts of the CPU working together.

Timing circuitry Every CPU has a clock input. Every time this clock input goes through a cycle, the CPU goes through another cycle as well. The faster this clock input signal is, the more cycles per second the CPU runs at. You can theoretically make a CPU run faster by increasing the speed of the clock input. In the real world, however, there is a limit to how fast even electrons can flow, and CPUs, being physical objects, are limited to certain speed ranges, mainly because of heat. The faster a CPU runs, the more heat it generates, and a CPU has a speed limit beyond which it is liable to overheat and break down.

Arithmetic Logic Unit (ALU) Many people think that a CPU is just a math machine; a calculator, to perform arithmetic operations on numbers at high speed. While this is only part of the CPU's job, the CPU is indeed where numbers are added, subtracted, multiplied, and divided. This is specifically the job of the ALU, an important but distinct part of a CPU.

Memory input/output CPUs read to and write from the computer's memory. A CPU has several physical wires that connect it to the RAM and ROM in the computer (mainly constituted by the address bus and the data bus), and through these wires, information is stored and retrieved by the CPU.


----------------------

Now that we're familiar with some of the sub-systems of a CPU, let's go back and review the list again, this time taking a more detailed look at the structure of each sub-system and the technicalities of how it works.

Registers
Each of the registers in a CPU is essentially just a series of D flip-flops, with one flip-flop for each bit. The data inputs and outputs of these flip-flops are typically connected directly to the data bus. To make it possible to separate the inputs from the outputs, a tri-state buffer is usually put on each flip-flop's input and output line, and the "Enable" pins on the input buffers are then wired together to a single control input, while the Enable pins on the output buffers go to another control input. In this way, you can enable the inputs and outputs on all bits of a register with a single control line.

There are four fundamental registers that usually exist in even the simplest CPUs. Two have already been mentioned: The instruction pointer/program counter and the accumulator. Another two important registers are the MAR (Memory Address Register), which stores memory addresses which are to be later placed on the address bus, and the instruction register, which stores an instruction that has been fetched from memory. These registers might seem superfluous at first glance, but they are needed because a CPU does things step by step; you might at first think that instead of needing a register to store memory addresses, wouldn't it be simpler and faster to just pipe the memory address directly onto the address bus? The answer is yes, that would be simpler, but it would not work because when a memory address is read from the memory, the address bus is currently being used to indicate the address that the address is being read from. To illustrate this by example, suppose that you are reading in the instruction LDA $1FF (an instruction to load the accumulator with the contents of memory address $1FF) from memory location $3FF. In order for this to happen, the address bus must have $3FF on it, because that is what causes the memory to produce the bytes that constitute the LDA $1FF instruction. Since the CPU is currently looking at that location in memory, you can't simply dump the address $1FF on the address bus; you must wait until the address bus is free. Therefore, a MAR is used to temporarily store memory addresses until they are ready to actually be used when the address bus is not being used for any other purpose. Similarly, when you load an instruction from memory, the CPU cannot actually start executing that instruction instantly; it must first stop whatever else it is doing, and since the very act of pulling the instruction out of memory constitutes activity, a separate instruction register is used to hold the instruction until the CPU is ready to deal with it.

Since all of these registers get their data over the same bus (the data bus), most of these registers will need two "Enable" signals: One for their input, and one for their output. Through these Enable wires, it's possible to achieve the necessary state of allowing only one device to place data on the data bus at a time. Since there are several registers and some will have multiple control lines, it makes sense to name these control lines and give abbreviations to these names, so that you can easily and specifically refer to any one control line. These names can be anything you want (after all, when you design something, you get to apply the names you choose to the various parts of your creation), but for the purposes of this page, some kind of standardization is needed so that you'll know what I'm talking about, so let's try to establish some simple code to refer to all these control lines. I'll list the names that you might apply to the control lines in your own CPU. The actual names that you use are up to you, but these are the names I'm going to be using within this document. Note that some of these names are actually semi-standard and you might see them (or something very similar to them) on other documentation describing CPU design.

The accumulator's input enable signal might be called LA (Load Accumulator), while the accumulator's output enable signal might be called EA (Enable Accumulator).

The program counter's output enable signal might be called EP (Enable Program counter).

The MAR's input enable signal might be called LM (Load MAR).

The instruction register's input enable signal might be called LI (Load Instruction register), while the instruction register's output enable signal might be called EI (Enable Instruction register).

To summarize, let's list the control lines we've created to turn the registers' inputs and outputs on or off:

EA: Accumulator Output
EI: Instruction register Output
EP: Program counter Output
LA: Accumulator Input
LI: Instruction register Input
LM: MAR Input

Instruction decoder
A "decoder" is actually a generic name for a relatively simple digital logic device. A decoder has a certain number of binary inputs; if we call the number of inputs n, then the decoder has 2^n outputs. The idea is that for every possible combination of inputs, a single output line is activated. For example, in a 2-to-4 decoder (a decoder with 2 inputs and 4 outputs), you have 4 possible input combinations: 00, 01, 10, or 11. Each of these input combinations will trigger a single output wire on the decoder.

An instruction decoder is simply this concept applied to CPU opcodes. The opcodes of a CPU are simply unique binary numbers: A specific number is used for the LDA instruction, while a different number is used for the STA instruction. The instruction decoder takes the electric binary opcode as input, and then triggers a single output circuit. Therefore, each opcode that the CPU supports actually takes the form of a separate physical circuit within the CPU.

Ring counter
If you're good at thinking ahead with logic, you may have already anticipated an interesting problem that arises using the aforementioned instruction decoder: CPU instructions take more than one step to perform. Whether you're loading the accumulator with some value, storing something in memory, or sending data over an I/O line, almost every CPU opcode takes several steps. How can you perform these steps sequentially through the triggering of a single output? The answer lies partially with a key component of CPU control: The ring counter. This device often goes by other names (partly because "ring counter" is actually a generic name for the device that can be used in contexts that are not specific to CPUs), but I'll continue to call it by this name within this context.

A ring counter is somewhat different from a regular digital counter. To review: A regular counter is simply a series of flip-flops that are lined up in such a way that every time the counter's input triggers, the output of the counter goes up by 1. A 4-bit counter has 4 binary outputs, and will count from 0000 to 1111; after that it will loop around to 0000 and start over again. In contrast, a ring counter only has one single output active at any time. Every time the ring counter's input triggers, the active output moves along. The active output simply cycles through a rotating circle of possible locations, hence the name "ring" counter.

As mentioned, all CPUs have clock inputs. It turns out that all these clock inputs do is drive this ring counter. The ring counter, together with the instruction decoder, take care of all the activity within the CPU.

Among different CPUs, ring counters tend to have varying numbers of outputs; the number of outputs needed really depends on how many steps the CPU needs to perform each instruction. Since you can't create new outputs out of thin air (they are actual physical wires), the ring counter needs to have as many outputs as there are steps in the lengthiest CPU opcode. Any instructions which don't need that many steps can "waste" cycles by allowing the ring counter to circle around, but this is obviously inefficient, so a separate "reset" input usually exists on the ring counter so that it can start counting from the beginning if the current instruction has finished.

Having made it this far, we now have an instruction decoder that will give us one active wire representing which opcode the CPU is running, and a ring counter that allows us to proceed step-by-step through this instruction process. Obviously, we need some way of merging these control signals so that the actual work can get done. Where does this take place? In the most hairy and complex realm of the CPU: The control matrix.

Control matrix
The control matrix is where things really get crazy inside a CPU. This is where each output from the instruction decoder and the ring counter meet in a large array of digital logic. The control matrix is typically made of many logic gates which are wired in a highly architecture-specific way to activate the correct control lines that are needed to fulfill the opcode being processed.

For example, suppose the instruction decoder has activated the LDA FROM MEMORY output, meaning the CPU has been given an LDA instruction to load the accumulator with the value from a specific memory address. The first step in executing this instruction might be to increment the instruction pointer so it can retrieve the desired memory address from memory. Thus, the LDA FROM MEMORY output from the instruction decoder and the first output from the ring decoder might go to and AND gate, which of course will then trigger only during the very first step of an LDA FROM MEMORY instruction. The output of this AND gate might go directly to the clock input on the instruction decoder. The second step in executing this instruction might be to load the MAR with the memory address desired which the instruction pointer is now helpfully pointing at, so perhaps the LDA FROM MEMORY output and the second ring counter output meet at another AND gate which goes directly to LM. And so on. This is how instructions are performed inside a CPU.


----------------------

Verilog CPUs
It's fun to create a simple CPU out of a series of electronic components on a breadboard or something similar. However, today people who want to design their own CPU typically do so through software, using a hardware description language like Verilog. Since Verilog is a very powerful language that makes it surprisingly easy to design and model the complex workings of a computer's CPU, it makes sense to examine how we can write a piece of Verilog code that will act like a CPU.

Since this is a section on CPU architecture specifically, we won't be going into the details of Verilog syntax here. If you want to learn a bit more about coding with Verilog, check out my own Verilog section, or another learning resource; several excellent books and websites about Verilog exist, from which you can learn a lot.

Since all the CPU really wants to do is perform instructions, and it needs to check the instruction pointer to know where to look for the next instruction, let's start with the instruction pointer. Assuming we have a 16-bit address bus (as most early microcomputers did) and we can run an instruction from any location in memory, we'll need a 16-bit instruction pointer. We can declare this item thusly:

reg [15:0] IP;
Because the IP gets its instructions from memory, we'll also need some way of accessing memory. In modern computer design, the memory is often integrated into the same programmable chip as the CPU, so that a single chip becomes the entire computer (a system known as a SOC, or System On a Chip). However, for this discussion, we're only making a true CPU, not an entire SOC, so the device we're making has no memory of its own and thus needs external memory buses. The buses are actual, physical wires, so we can define them as such:

output [15:0] abus; //address bus
inout [7:0] dbus; //data bus

Now we have a way of specifying a memory address: The abus output.

Many CPUs use idiosyncratic specifications to deal with the problem of deciding where to start getting instructions in memory. Some CPUs have a specific point that they start executing instructions from, others use a reset vector, a location in memory that stores another memory location from which to begin executing instructions. Some people may argue the virtue of one system over another, but for our current discussion, let's keep things simple and just assume that our CPU begins executing instructions from memory address 0, and just proceeds from there. To do this, we'll first need to set our address bus to equal 0, so our memory chips will output whatever instruction is at address 0.

IP = 0;
This line initializes our instruction pointer to its first memory location. From here on, we will need to get our instructions from memory by setting the address bus to reflect whatever is stored in the instruction pointer.

abus = IP;
Assuming the interface between the CPU and the memory now works properly, the data bus should currently be reflecting whatever is at the specified memory address. If the memory has been programmed correctly, this is an opcode, a binary number which corresponds to a specific instruction that the CPU can perform. The CPU needs to be able to act on this opcode and select a course of action based on exactly what that opcode is. This is the job for the instruction decoder, which in Verilog can be programmed quite easily using the case statement.

case(dbus)
opcode1: //code for opcode 1
opcode2: //code for opcode 2
endcase

Here's where we need to get creative. We need to invent our own opcodes. Every CPU has a set of opcodes, and each opcode has a specific number associated with it. Since we're not making a world-class CPU right now, we can start with just a very basic set of instructions for the time being. Let's say that the two most fundamental opcodes a CPU can have are LOAD and STORE: An opcode to load the CPU's accumulator with a value from a specific memory address, and an opcode to store the value presently in the accumulator into a specific memory address. (BURY and DISINTER, as Cryptonomicon's Lawrence Pritchard Waterhouse called them.) Since we want to keep things simple, let's furthermore assign the numbers 0 and 1 to opcodes LOAD and STORE, respectively. So, we'd modify the case statement above to look something like this:

case(dbus)
0: //LOAD instruction
begin
//code for the LOAD instruction goes here!
end
1: //STORE instruction
begin
//code for the STORE instruction goes here!
end
endcase

Obviously, we need to fill in the actual code to perform the opcodes, but we can get to writing the actual code for the CPU instructions later.

Tying it all together, then, all you really need to make a CPU in Verilog is the initial register and pin declarations, a reset vector (or at least some set location in memory where instruction execution will begin), and then just the code for all of the CPU's individual opcodes. That's really it. You can make a working CPU that simply. You can connect it to a ROM and put some small program in the ROM to test your CPU.

Below is a general idea of what your CPU code might look like overall. This code is obviously just a rough draft and you'll want to improve on it if you plan to use your CPU for anything. This is just to give you an idea of what can be done and how to do it. Be creative!

reg [15:0] IP; //instruction pointer
reg [7:0] A; //accumulator

input clk; //CPU clock input
output [15:0] abus; //address bus
inout [7:0] dbus; //data bus
output RW; //read/write output so the memory knows whether to read or write

IP = 0; //initial location of instruction execution

always @(posedge clk) //main CPU loop starts here
begin

RW = 0; //set read/write low so it reads from memory
abus = IP; //put IP on the address bus, so that the memory produces
//the next instruction on the data bus.

case(dbus)
0: //LOAD instruction
begin
IP = IP + 1; //increment IP so it points to the memory vector
RW = 0; //set read/write low so it reads from memory
abus = IP; //examine the memory location it points to
A = dbus; //load the accumulator with the value at the address
IP = IP + 1; //increment IP so it points to the next instruction
end
1: //STORE instruction
begin
IP = IP + 1; //increment IP so it points to the memory vector
RW = 0; //set read/write low so it reads from memory
abus = IP; //examine the memory location IP points to
RW = 1; //set read/write high so it writes to memory
dbus = A; //send the accumulator onto the data bus
IP = IP + 1; //increment IP so it points to the next instruction
end
endcase

end

and if you can understand all of that you might have a chance


0

Response Number 41
Name: Derek
Date: July 6, 2007 at 17:12:50 Pacific
Reply:

Why didn't you just post this link from where you got it instead of cluttering up this forum?
http://www.geocities.com/SiliconVal...

I can't see what point your are making by pasting that lot. Sure, then if you can understand all of it you might have a chance too. Have a go then, nobody is stopping you.

From your first post you admitted to not even knowing what a flipflop was or a transistor. So you are starting from absolute zilch. Design work takes years of study and there are books and books on it, starting from Boolean Algebra upwards. Do you honestly think it can be conveyed on a forum even if the relevant expertise was available? This thread would probably be up to 300 before just basic electronics had been touched upon and even that assumes a reasonable electrical knowledge.

If you were really serious you would do the donkey work, produce some sort of simplified breadboard and then seek assistance. In any event you need a specialist website for advanced electronics not a general computer forum.

What is it tomorrow, rocket science or brain surgery? Come on, pull the other leg - you are either kidding yourself or us.

DerekW


0

Response Number 42
Name: vishal sharma
Date: July 7, 2007 at 04:04:43 Pacific
Reply:

actully i just postad that message for franz. and ok this is the last time i will bug you guys on the subjet


0

Response Number 43
Name: vishal sharma
Date: July 7, 2007 at 04:06:57 Pacific
Reply:

actully i just postad that message for franz.


0

Response Number 44
Name: DE
Date: July 16, 2007 at 01:23:55 Pacific
Reply:

http://www.cc86.org/~dkuschel/ its a interesting sight if u have not seen it all ready :) theirs a 16bit cpy too and their all made from ttl's


0

Response Number 45
Name: Jennifer SUMN
Date: September 4, 2007 at 04:57:45 Pacific
Reply:

This is ridiculous. I can't imagine why Justin hasn't deleted this whole thread.

Life's more painless for the brainless.


0

Response Number 46
Name: Derek
Date: September 4, 2007 at 13:44:12 Pacific
Reply:

... my sentiments entirely Jen. See. I'm still looking LOL.

Kind regards

...some other bloke...


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to CPUs/Overclocking Forum Home


Sponsored links

Ads by Google


Results for: building a cpu. i need HELP

Over heating cpu....i need help!!!! www.computing.net/answers/cpus/over-heating-cpui-need-help/9587.html

new build I need help www.computing.net/answers/cpus/new-build-i-need-help/14511.html

Build a cpu?¿? www.computing.net/answers/cpus/build-a-cpu/7361.html