CPU and other questions (new cs student)

Status
Not open for further replies.

pallius

Distinguished
Nov 20, 2011
3
0
18,510
Hello all. I am currently a CS student and finishing up my first hardware course. Although I am not the best student, I absolutely love the course. These forums look like an oustanding place to obtain knowledge. If I am posting this in the incorrect place, or im beaitng a dead horse (which I very well might be), I am sorry :??:

I have some general questions, and other questions on the CPU clock vs RAM internal clock. If anyone can tell me if my thoughts are incorrect and add any insight to my questions it would be much appreciated. ANY help on any of my questions or any discussion is highly appreciated. Thanks :)

NOTE: I would like to express my ideas using terminology I used in class.

CPU
From what I understand so far, the Hz label on the CPU is the time per clock pulse the cpu operates at. For example, a 3.0 GHz processor performs some operation every 1/(3 x 10^9) seconds or every .33 ns per clock pulse.

#1) If the oscillating crystal is on the motherboard, how does the crystal know at what clock frequency to pulse at? I would assume that a crystal pulsing faster then what a CPU is supposed to operate at will cause a BSOD OR... new control signals will be applied to the datapath before all operations are complete leading to missing bits, failure to load all bits to the IR, failure to apply the correct address to the MAR etc.

#2) By saying a CPU is 32 bit or 64 bit, that means the ALU/registers can perform operations on this many bits simultaneaously?

#3) Can the frequency of the crystal be manipulated by changing the voltage?

#4) When people overclock, what are they physically tampering with in the cpu? From my studies all I see is combinational/sequential circuitry. Certainly they arent changing the speed their latches and AND gates work, right? :pt1cable:

RAM
The ram is on its OWN clock. So by my math a 1333 Mhz stick of ram sends its OWN pulse every 1/(1333x 10^6); pulses every .75 ns.

#1) I think that the memory controller (on the RAM itself) counts this pulses and releases its own pulse?

#2) So if the CPU pulses and the pulse happens to be the one that starts the domino reaction in memory, is the time it takes for a write cycle or access cycle within ONE memory clock pulse? I know these cycles can last multiple CPU clocks. But does it take ONE memory pulse to apply the RAS, another to apply the CAS etc or does this happen before the first negative edge of the memory clock?

#3) I assume DDR ram works on positive and negative edges of the MEMORY clock, not the CPU clock?

#4) Does the word size have to be the same same number of bits as the amount of bits the CPU can handle? 32 bit CPU requires 32 bit word memory?

Together, a limiting factor can be the RAM. If there was some way to make RAM get an instruction to the instruction register by the first negative edge of the CPU clock after the address is applied to memeory then the RAM would be operating at the same frequency as the CPU? I'm assuming this technology isnt here yet because we have to wait for the RAS,CAS, decoder and mux delays which span multiple CPU clock cycles.

OK any clarification, insight and other knowledge is appreciated. Thanks in advance everyone.
 
Solution
CPU
0: Basically yes, the CPU can perform an operation every clock pulse but not all operations can complete in 1 cycle. Perhaps you noticed that the CPU is operatiing even faster than the system Ram and therefor when reading/writing something, alot of cpu time is spent just waiting for the ram to finish. Luckily the cpu is smart enough to do other things while waiting.

1a: "Crystal" may be on the motherboard or in the processor itself like the i-series.
The crystal itself determines the base oscillating frequency and surrounding circuitry 'fine tunes' it. Actual crystals are not used anymore on motherboards but all the motherbd clocks are generated from the single source using multipliers and dividers and is commonly refered to as the...

ulillillia

Distinguished
Jul 10, 2011
551
0
19,010
I'm no expert, but I know a few of these.

CPU-0: your math checks out - 1/3 nanosecond or 333 pictosecond for each clock. I've seen that this varies slightly though. It may be 3.0 GHz, but 3.042 GHz and the like is what I see. It's slight.

CPU-2: that's the memory address length. A 32-bit OS or a 32-bit-only CPU can only address up to 4 GB of RAM. A 64-bit OS and a 64-bit-supporting CPU supports up to 16 EB (16,777,216 TB) RAM (theoretically - the OS may limit it to 1 TB though I'm not certain)

RAM-0: your math is correct. I get 750 pictoseconds as well.

RAM-4: I'm not entirely certain, but I think that this is the case. The OS plays a role more than the CPU. A 32-bit OS with a CPU that supports 64-bit widths would still use 4-byte lengths. A 64-bit OS with a 64-bit CPU should use 8-byte lengths. One thing you should note is that Windows Task Manager always shows memory usage as multiples of 4 KB (4096 bytes or 32,768 bits).

Beyond this, I can't really say much.
 

popatim

Titan
Moderator
CPU
0: Basically yes, the CPU can perform an operation every clock pulse but not all operations can complete in 1 cycle. Perhaps you noticed that the CPU is operatiing even faster than the system Ram and therefor when reading/writing something, alot of cpu time is spent just waiting for the ram to finish. Luckily the cpu is smart enough to do other things while waiting.

1a: "Crystal" may be on the motherboard or in the processor itself like the i-series.
The crystal itself determines the base oscillating frequency and surrounding circuitry 'fine tunes' it. Actual crystals are not used anymore on motherboards but all the motherbd clocks are generated from the single source using multipliers and dividers and is commonly refered to as the System clock. For example. The primary bus on the motherboard is called the FSB for front side bus and a typical speed is 800Mhz. It gets this speed from the 200mhz system clock using a multiplier of 4. The cpu clock gets its clock from the System clock but multiplies it up even further by its own multiplier. This CPU multiplier used to be on the motherboard but now is in the CPU itself. When you see a processor like the black edition AMD's that say they are 'Unlocked' this is what they are referring to. The CPU multiplier is not locked and you have the option to change it for a real easy overclock (or underclock). With locked processors the only option you have is to change the system clock - if you can. Why cant you? - not all motherboards support changing the System clock and since some processors generate taht clock (intel I-series) there is very little ability to overclock with those either. Overclocking the system clock would indeed cause issues as all the other buses also derive their clock form this such as the PCI bus (33Mhz), older AGP bus (66Mhz), PCI-E (100Mhz), Memory bus (varies with memory type). Good overclocking boards allow you to set these buses mulipliers independantly to help keep them near spec.

2: Yes a Cpu is considered 64bits when its internal registers & such are 64bits wide. Please note that this does not necessarily reflect on the extrernal address bus which can also be further restricted by motherboard makers. I beleive the i-series uses a 36bit external address bus for example.

3: In a crystal oscillator circuit the tuning is typically done using a variable capacitor.

4: System clock

Ram
1: ram has its own clock but it is generated by the memory controller, be it on the motherboard or built into the CPU.

2: memory timings are set in the motherboards bios and dictate when the cpu should expect its data operation to complete. DDR memory can operate in random or sequential modes and each mode has its own 'speed'. Random read writes are almost the same from DDR to DDR3 (8-10ns) while sequential or burst mode is where the gains are made. What basicall happens is the CPU demands data from address1 thru 27 and in the case of ddr3 its able to buffer the data at a rate of 8 addresses per read. DDR2 was 4 I beleive and DDR is 2 leaving SDR with no prefetch buffer.

3: no, ddr runs off the system clock but is double pumped meaning it pulls data on the rising and falling egdes of the clock.

4: I'm not sure what your asking here but CPU wise, it doesn't really care because a 32bit data can have 32 zeros in front to make it 64 bits if it needs it. All it care about is if gets 64bit data and only has 32bit registers... special handling by the OS or program needs to be in place for these circumstances because its like having a calcultor with only the ones place for operands (so you can do 3x8) and someone tells you to use it to calculate 32x87. (btw yes this is doable)

As for ram speed, don't expect to ever see ram running at the same speed as the cpu at least until we get room temperature superconductors going LoL. The lengths of wires need to go that short distance from CPU to Ram would induce too many errors to run that fast. Techology to run memory that fast is already here and is extremely expensive. It's built into most CPU's and is called CACHE. Most cpu's have an L1 cache that runs at cpu speed. you can look up individula cpu;s to see how small it is.
 
Solution

pallius

Distinguished
Nov 20, 2011
3
0
18,510
Wonderful response. Thanks for the clarification.

"It's built into most CPU's and is called CACHE".

Trying to decipher cache homework as I type this ( Mano and Kime )
 
Status
Not open for further replies.