A CPU from the begining

All discussions related to the DCPU and in game hardware (equipment, vehicles)

A CPU from the begining

Postby abebarker » Thu Apr 03, 2014 6:46 am

CMOS
Modern CPUs are made using CMOS technology. MOS technology had two different types of transistors; N-type and P-type. They switch between being very conductive and very non-conductive when an electric field is present. The N-type switches on [conductive] when a positive voltage is applied. The P-type switches on [conductive] when a negative voltage is applied. When used together they "compliment" each other. The inputs are tied together and when voltage is applied the N-type conducts and the P-type doesn't. When ground voltage is applied the P-type conducts and the N-type doesn't. It's a push pull type of situation.

Tri state
Push-pull is nice and all. Pulling electrons is a positive voltage and a digital '1'. Pushing electrons is a negative or ground voltage and is a digital '0'.* What if we have a bunch of registers that can all be access from the bus? They can't all be connected to the bus at one time. This is where a third state in digital logic systems comes in. It's called High-Z [high impedance] or floating output. This is where the output is disconnected. It no longer pushes or pulls.


* It should be noted that electron flow and current flow are the opposite of each other. This dates back to Benjamin Franklin. He arbitrarily decided that current flows from positive"+" to negative"-". Electrons, as we know, are negatively charged "-". They are more concentrated at a negative potential [source, emitter, cathode] and flow into the empty space found at a positive potential [sink, collector, anode]. So don't get confused when dealing with transistors because we think in terms of electron flow and not current flow.

Image
Last edited by abebarker on Thu Apr 03, 2014 7:05 am, edited 1 time in total.
abebarker
 
Posts: 16
Joined: Mon Aug 12, 2013 11:41 pm

Logic gates

Postby abebarker » Thu Apr 03, 2014 6:53 am

CPUs are made of discrete logic blocks. Chip designers like to use existing logic block that are tested and proven. It is faster and more reliable to combine designs that are known to work on silicon.

This is where we find much of the pieces that make up a CPU are within other, more simple, chips. The documentation is a little bit more thorough and enlightening when we look at logic chips from the beginning.

The 7400 series of logic chips is one of the oldest. Many of the pieces we need to build a CPU are within these chips.
http://en.wikipedia.org/wiki/List_of_7400_series_integrated_circuits

In fact, it is possible to build a CPU from discrete logic. http://cpuville.com/

Image
Last edited by abebarker on Thu Apr 03, 2014 7:22 am, edited 1 time in total.
abebarker
 
Posts: 16
Joined: Mon Aug 12, 2013 11:41 pm

Decoder

Postby abebarker » Thu Apr 03, 2014 7:09 am

When an instruction is given it needs to be broken into smaller parts. A part that says what kind of instruction is to be performed. A part that indicates which register/registers is/are to be operated upon. The simple binary decoder is composed of is a bunch of AND gates with inverters on their inputs to correspond the to the binary value at which it activates.
3 to 8 line decoder;
http://www.nxp.com/documents/data_sheet/74HC_HCT138.pdf

Image
abebarker
 
Posts: 16
Joined: Mon Aug 12, 2013 11:41 pm

Bus gates

Postby abebarker » Thu Apr 03, 2014 7:31 am

Registers, the address generator, ALU and other components are connected to the internal bus. When data is to be moved from, say, a register to the ALU, gates are turned on that connect the two devices to the bus.

74244 is an example of a gate.
http://pdf.datasheetcatalog.com/datasheets/70/375527_DS.pdf

Image
abebarker
 
Posts: 16
Joined: Mon Aug 12, 2013 11:41 pm

Registers

Postby abebarker » Thu Apr 03, 2014 7:42 am

A register, as is in the 74273, is a bunch of D type flip-flops.

http://pdf.datasheetcatalog.com/datasheet2/9/0phkkp4woh655y3xhyco00865x7y.pdf

Image
abebarker
 
Posts: 16
Joined: Mon Aug 12, 2013 11:41 pm

Arithmetic Logic Unit

Postby abebarker » Thu Apr 03, 2014 7:58 am

The component that performs the arithmetic and logical operations is known as the Arithmetic Logic Unit, or ALU.

The 74181 is a 4-bit ALU thar performs all the traditional add / subtract / decrement operations with or without carry, as well as AND / NAND, OR / NOR, XOR, and shift. These can be combined to provide arbitrarily large word sizes. Multiply and divide functions are not provided but other components can be added to perform those operations.

http://en.wikipedia.org/wiki/74181
http://www.tranzistoare.ro/datasheets/560/493318_DS.pdf

Image
abebarker
 
Posts: 16
Joined: Mon Aug 12, 2013 11:41 pm

Re: A CPU from the begining

Postby DaveSparhawk » Thu Apr 03, 2014 9:47 pm

A very well written and informative topic.

I don't however, expect Trillek to simulate/emulate at the electron, transistor or logic gate level.
The processor will have timer module(s) and alu etc. These won't have to be accurate at the gate level but should behave similar to real CPU/microcontrollers.
DaveSparhawk
 
Posts: 28
Joined: Sat Mar 08, 2014 11:14 am

Re: A CPU from the begining

Postby ubernox » Fri Apr 04, 2014 3:11 am

I don't understand how this is relevant at all.
...fatty.
User avatar
ubernox
 
Posts: 17
Joined: Wed Nov 27, 2013 1:54 am

Re: A CPU from the begining

Postby Zardoz » Sat Apr 05, 2014 10:31 pm

ubernox wrote:I don't understand how this is relevant at all.

Learning what does and how works a real computer, always is relevant. In any case, we don't will work a this level of simulation.
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: A CPU from the begining

Postby ubernox » Sun Apr 06, 2014 6:09 pm

Zardoz wrote:
ubernox wrote:I don't understand how this is relevant at all.

Learning what does and how works a real computer, always is relevant. In any case, we don't will work a this level of simulation.

That's why. It's interesting, not relevant.
...fatty.
User avatar
ubernox
 
Posts: 17
Joined: Wed Nov 27, 2013 1:54 am

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 5 guests

cron