Due to some unforeseen circumstances that don't make any logical sense but happened anyway, the four branches of the store I work for, all owned by one franchisee, are short four people today. So here I am in the store in Saldhana, with practically nothing going on. Because of this, and since I have now read every freakin' halfway decent story on FIMFiction (and stopped myself from descending into that mess too far), I decided that it was time to write a blog… On this accursed iPad.
So, how about I talk a bit about the way the CPU works, how it executes code, and how it controls external devices? Interested? Good.This will be a long blog, unless I miraculously get a troop of people wanting to buy water on one of the rainier days I've seen in a few weeks.The CPUPossibly one of the most misunderstood pieces of hardware in the system. I frequently find myself wanting to punch somebody when they ask how 'fast' a processor is, and gawk like idiots without understanding what the implications of the 'speed' are.Another delusion is that it is a single piece of hardware. It's actually a self contained system, containing several unique components.Among these exist the System Clock, the data bus, an instruction fetcher, an execution module (which is a wonderfully complex gathering of logic gates), an interrupt line (often connected to an external PIC, or Programmable Interrupt Controller), an APU (Arithmetic Processing Unit), an internal cache, and a few hardware registers.The CPU's job is very simple in theory: it fetches the next instruction from the data bus, executes it, and repeats the cycle. More realistically, the CPU can also receive 'interrupts', hardware induced triggers that usually make the CPU save its state and execute a special handler defined by the Resident OS.The number of instructions a CPU can execute per second is the commonly referred to 'speed'. One megahertz is equivalent to 1,000,000 instructions per second. One Gigahertz is equivalent to 1,000,000,000 instructions per second. Got it?Of course, here's where trouble sets in. The CPU is extremely fast. The RAM, on the other hand, is not. RAM is also locked to a specific frequency, relating to the number of fetch requests that can be handled per second, also described in MHz or GHz. On most budget RAM modules, the frequency is much lower than the CPU's potential request frequency. I'll expand on this shortly. UpdateI'm too demotivated at the moment to continue this; ask questions, that'll probably get me going again.Just a few interesting things I failed to mention in my last few blogs: I finally got myself a proper headset (With a decent microphone and bass amplification. Heck yeah!).Then I bought myself Just Cause. And I'm finding it absolutely hilarious and from here on in I decree that any game with vehicle based combat ought to allow you to jump out onto the front of the vehicle and parachute off, or grapple with the traffic… Heheh.
Just try to imagine Unreal Tournament with players able to hitch rides like that… sniper heaven.
Fair enough.
I give up; I am most definitely not studying the hardware of the PC, only the abstract side that applies to the programming I do. On a very low level, actually, because of the OS development related activity.