Is this why we use a lot of transistors in a cpu

Thread Starter

Werapon Pat

Joined Jan 14, 2018
35
cpu used a lot of transistors,but why it has to use that much? this question stuck in my head for years, and when I ask my friends or even my teacher
they only tell me that it's responsible for amplifying current, and that doesn't make me clearly understand 'cause I know it can amplify current, but why cpu needs that much? does it require a lot of current or what? So after I learned about digital and logic design, I found that the cpu is made of a lot of IC or logic gates, and I wonder, what is inside of a logic gate, and I found that it's made of a group of transistor. So is this why we use a lot of transistors in a cpu? does that corrent, i'm still not sure.
 

-live wire-

Joined Dec 22, 2017
959
Usually people don't make logic gates out of transistors but rather they use ICs, often with many logic gates in them. The transistors are often used for switching and amplifying small signals (like from a microcontroller).
 

MrChips

Joined Oct 2, 2009
30,821
CPU chips are designed using gates, such as AND, OR, NAND, NOR, NOT gates.

Each gate is designed to perform a simple logic function. A number of gates put together might perform a more complex function such as ADD.

A CPU might have from a thousand to many million gates.
Each gate might have from 3 to 10 transistors.

See this:
https://en.wikipedia.org/wiki/Transistor_count
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
I always tought this: The transistors are used in key mode. They only switch, nothing else. The higher the speed, the more transistors needed. This is a part of microelectronics. The processor just receives bytes of data and sums/divides/multiplies/etc. All of these actions are realized through summing (in computer systems that is, not for all types of MCUs). Meaning the processor only sums.
 

dl324

Joined Mar 30, 2015
16,938
when I ask my friends or even my teacher
they only tell me that it's responsible for amplifying current
Your friends and teacher don't know.

Most/all of the circuitry in a modern CPU is digital. The transistors are either on or off. All of the transistors used in a CPU are there for a purpose. They take space and dissipate power, so it makes little sense to have useless transistors.
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
By sum I mean: it sums byte with byte, binary code.

Key mode can be called "amplification". But it is a load in the collector that is switched with a current on the base.
 

MrChips

Joined Oct 2, 2009
30,821
At the most fundamental level, the simplest logic gate is the 2-input NAND gate.



The CMOS NAND circuit shown above uses 4 transistors.
From this, we can create all other logic functions.
The next level up is a flip-flop. We can create a flip-flop using two NAND gates.
The next level up is a register. An 8-bit register will required eight flip-flops.

As you can see, as the functionality increases, the number of gates and hence transistors required increases.
This has nothing to do with the speed of the CPU.

A CPU will contain dozens, hundreds, or thousands of registers, depending on the complexity of the CPU.
 

MrChips

Joined Oct 2, 2009
30,821
In digital logic, transistors are either ON or OFF. In the operation of digital circuits, one transistor is ON and another is OFF.




Because one transistor is always off, the transistor-pair conducts no current.

What takes current is charging and discharging the capacitances on the output pins of the circuit.
The more times the gates have to switch, the more current is required to switch from logic 0 to1 and 1 to 0. Hence power consumption goes up with frequency.

At zero frequency (i.e. very low operational speeds) the gate consumes very little current in the order of nano-amps.
 

Papabravo

Joined Feb 24, 2006
21,226
Actually the first [electroic] computers were built with vacuum tubes and relays.. Transistors came later, and integrated circuits, much later. It's funny how mythology evolves without a sound understanding of the fundamentals.

EDIT: I should have said electronic computers.
 
Last edited:

recklessrog

Joined May 23, 2013
985
Actually the first computers were built with vacuum tubes and relays.. Transistors came later, and integrated circuits, much later. It's funny how mythology evolves without a sound understanding of the fundamentals.

From wiki
Charles Babbage, an English mechanical engineer and polymath, originated the concept of a programmablecomputer. Considered the "father of the computer", he conceptualized and invented the first mechanical computer in the early 19th century..

Having said that, I think the early Greeks had a mechanical computer for navigation. Probably the Chinese did too.
 
All logic can be done with NAND gates. You can use another one too, I forget which one. With that as your basic building block,

You can look here https://en.wikipedia.org/wiki/Logic_family about the specific LOGIC FAMILIES and their characteristics.

Lithography techniques have increased the density. Now we are seeing a reduction in logic voltages from 3.3 to 1.8 and now even 0.8 volts. These voltage lowering goals are primarily for power reduction.

I did build a "computer" back in the Intel 8008 ERA with 2 other lab partners. Memory was tiny. 16 bits x 16 words. The program was tiny too. It used what's called micro-code and it could sort one digit bcd numbers in ascending or decending order based on the coding.

Machines I was familiar with had 128 or 256 bit wide microcode.

One person built the memory, one the data structures and I built the program counter/branching gizmo.

Scaling would require more of them.
 

WBahn

Joined Mar 31, 2012
30,072
cpu used a lot of transistors,but why it has to use that much? this question stuck in my head for years, and when I ask my friends or even my teacher
they only tell me that it's responsible for amplifying current, and that doesn't make me clearly understand 'cause I know it can amplify current, but why cpu needs that much? does it require a lot of current or what? So after I learned about digital and logic design, I found that the cpu is made of a lot of IC or logic gates, and I wonder, what is inside of a logic gate, and I found that it's made of a group of transistor. So is this why we use a lot of transistors in a cpu? does that corrent, i'm still not sure.
The CPU is primarily a digital circuit -- any analog circuits are generally very few and for purposes peripheral to the CPU's job. The overwhelming majority of modern CPU's use CMOS circuits in which transistors are used as switches to either connect nodes to a HI voltage or a LO voltage. Each switch serves a particular role in the logic implemented by the CPU. The more things you want the CPU to do, the more switches (transistors) you need.
 

WBahn

Joined Mar 31, 2012
30,072
All logic can be done with NAND gates. You can use another one too, I forget which one. With that as your basic building block,
The other gate you are thinking of is the NOR-gate. These are the two symmetric two-input logic gates that are universal (meaning any Boolean logic function can be implemented using only that type of gate). But there are actually four more two-input logic gates that are universal, they just happen to be asymmetric.

But this is really immaterial to the question asked as no CPU implements logic using nothing but NAND gates. Gate universality is an important concept in the understanding of logic fundamentals, and awareness of it can sometimes be useful in designing IC circuits (though bubble-logic is far more useful), but silicon real estate is far too expensive for anyone to tolerate the massive gate counts associated with NAND-only implementations, not to mention the corresponding slow speeds and power dissipation.
 

WBahn

Joined Mar 31, 2012
30,072
From wiki
Charles Babbage, an English mechanical engineer and polymath, originated the concept of a programmablecomputer. Considered the "father of the computer", he conceptualized and invented the first mechanical computer in the early 19th century..

Having said that, I think the early Greeks had a mechanical computer for navigation. Probably the Chinese did too.
What qualifies as the first "programmable computer" is highly debatable and depends on what definition you choose to use or aspect you choose to focus on.

One argument has it that the first programmable computer was the 1725 Bouchon loom and, even more so, the 1805 Jacquard loom.

https://en.wikipedia.org/wiki/Basile_Bouchon

While I'm somewhat sympathetic to the claim, I don't think it quite rises to the bar as I would like to see some level of decision making capability. As far as I know, these looms had no such capacity. Now, if they had devised a way to perform a conditioned loop (which would have been extremely useful in a programmable loom), I would be more than willing to support the claim.
 

panic mode

Joined Oct 10, 2011
2,757
there is tons of resources to learn about digital circuits. Youtube has many channels just for this topic. for example "in one lesson" has videos like this one that explain working of transistor switches, gates, binary etc.

but.. adding two numbers is just one CPU instruction.
watch the video and count how many gates and transistors are needed to add just two bits.
then see how many are needed to add pair of 32-bit numbers.

there are many more instructions, each of them requires many more transistors.

 
Last edited:

AnalogKid

Joined Aug 1, 2013
11,055
All logic can be done with NAND gates. You can use another one too, I forget which one.
NOR gates (for normal outputs)
or
Open-Collector Inverter (for wire-x inputs)

The two most basic requirements for a logic gate used to construct much larger logic circuits are:

1. At least two inputs, or outputs that provide the ability to combine multiple signals into one input (such as wire-OR, wire-NAND, etc.)
2. Inversion

ak
 
My brain isn't working well today (migraine) and it didn't feel like looking it up.

The whole point is that a basic gate is the building block which can make flip-flops and other stuff. Obviosly there are technologies like FRAM or electrically erasable memory that don't fit. There was a computer built from valves/tubes.

So its a lot of repetition of small building blocks.

I don't think the PDP-8 http://tcm.computerhistory.org/ComputerTimeline/Chap5CS1_8-15-46_PDP8_CS2.pdf had any integrated circuits in it. I did program on one. The PDP-11 was just way cool. That one I did troubleshooting to the module level and programming.

The wierdest computer was the COSMAC 1802. It had no instructions to make subroutine calls, but any register could be the program counter. It had a stack. When i programmed that one, i hand assembled the code and the first routines I wrote implemented CALL and RETURN subroutine calls.
 

WBahn

Joined Mar 31, 2012
30,072
My brain isn't working well today (migraine) and it didn't feel like looking it up.

The whole point is that a basic gate is the building block which can make flip-flops and other stuff. Obviosly there are technologies like FRAM or electrically erasable memory that don't fit. There was a computer built from valves/tubes.

So its a lot of repetition of small building blocks.

I don't think the PDP-8 http://tcm.computerhistory.org/ComputerTimeline/Chap5CS1_8-15-46_PDP8_CS2.pdf had any integrated circuits in it. I did program on one. The PDP-11 was just way cool. That one I did troubleshooting to the module level and programming.

The wierdest computer was the COSMAC 1802. It had no instructions to make subroutine calls, but any register could be the program counter. It had a stack. When i programmed that one, i hand assembled the code and the first routines I wrote implemented CALL and RETURN subroutine calls.
The PDP-8 came in several variants. The early ones used "flip-chip" technology which, itself, was somewhat ill-defined and variable but it allowed DEC to advertise the PDP-8 as an integrated-circuit computer. Later versions used TTL MSI chips.
 
Top