This month I am taking a break from the traditional analysis of a piece of software or elaborating on an idea in the general tech universe. Instead we are going to examine something that is the keystone of modern computing. Everyone takes their computers, cell phones, and iPods for granted. There’s one general principle that all of these devices have in common, the model in which the hardware is based on. Every device has to have a central point to control other components of the device and perform arithmetic and logical operations. Believe it or not whether the device is a computer, cell phone, or iPod they are all based on the same central architecture. This architecture is called the Von-Neumann Architecture.
The Von-Neumann Architecture has been the model for computing for the last 50 years. The model highlights a system in which there are multiple components which help to complete a specified task. Another key feature of the VNM (Von-Neumann Model) is that programs can be loaded, used, unloaded, and then changed for next time. In its simplest form the model contains memory, a control unit, an arithmetic and logic unit (for calculations), and a method for input and output. In modern computers the model includes a CPU, memory, hard drives, optical drives, and peripherals (hard drives, optical drives, and peripherals can be thought of is the input/output (IO) method). This model powers everything from a cell phone all the way to enterprise servers running the internet.
The first logical point to look at in the VNM is the CPU. Most of you will know the CPU as the part of your computer that controls everything or makes it all work, this is relatively true. The two biggest manufacturers are Intel and AMD. CPUs require constant innovation as the same technology is only usable for a few iterations. Ideally from an economic perspective a perfect see-saw motion would be best, Intel leapfrogs AMD, AMD leapfrogs back, and the process continues. Currently Intel has the upper hand in terms of the overall technology. Now that the mention of Intel and AMD is done it’s important to say that any VN CPU contains a control unit and arithmetic logic unit (ALU).
The control unit can be thought of as the brain of the computer in general. The control unit controls and manages all other devices and the ALU. The control unit also retrieves instructions, decodes, and executes them. The instructions come from various memory sections that have been placed by other programs running in memory. Instruction execution is continued until an instruction is found that signals that the program has finished and should stop. During this execution commands are issued to various hardware devices, including the ALU. Instructions are defined by the CPU manufacturer, this is known as the instruction set. Instruction sets contain a variety of instructions (ADD, SUB, MOV, SLL, SLR, JMP, and many more) and may receive addons when Intel or AMD releases a new CPU. These instructions interact with the various other devices, including the ALU which is key to any arithmetic and logical operations.
The ALU may sound like a separate unit outside of the CPU but in reality it is a part of the CPU. As stated above the ALU handles all arithmetic and logical operations. Without the ALU a computer would be unable to branch into different areas of code (example: choosing a certain menu item, if hovered open the sub menu). The ALU also holds the systems registers. Registers are physical entities in the CPU that are capable of storing integers and other data. One common use for registers is for storing the operation code (numerical identifier of the instruction), another is to store integers for fast computation without accessing system memory which we’ll touch on later. The arithmetic operations can be summed up into the 4 basic arithmetic operations: addition, subtraction, multiplication, and division. Focusing on arithmetic operations, the ALU can also shift the bits of a register to the left or right. Shift operations simply mean that the bitstream represented (eg. 00000010) is shifted one bit to the left or right. The operations of logic are also carried out, these can be summed up as AND, NOT, OR, and XOR. Most of these are pretty self explanatory except for XOR. XOR is simply eXclusive OR, meaning a traditional OR operation but only one case can be true whereas in a traditional OR one or both cases can be true.
These two components make up the CPU. Modern CPUs are becoming increasingly complex, at a bare minimum a modern CPU will have these features and more. Both Intel and AMD are developing CPUs that have integrated graphics accelerators on the same die (piece of plastic) as the CPU, this is due in part to the decreasing size of the CPU manufacturing process. With this in mind it’s critical to remember that this is the structure basic CPU and modern equivalents are going to have many more features. Memory is the next stage of a the architecture that will be examined as it is required for any work to be carried out.
Without memory (RAM) a computer would be pretty useless. Memory stores instructions that are going to be executed and the data being processed currently. Data is stored in memory cells, each cell is represented by an address. Each cell can hold any numerical value, which is all that’s needed to represent anything in memory (more on this later). In a traditional 32-bit machine memory addresses can have a range of 0x0000000 (0) to 0xffffffff (232 – 1), this is referred to the memory address space. Memory address space in a 64-bit machine is significantly larger. You can read up more about 64- vs. 32-bit on an article discussing the pros and cons of using a 64-bit operating system. Memory does not act as one monolithic entity, it is sub-divided by the operating system into smaller manageable sections with restrictions applied. This division can be thought of as vertical in nature, lower addresses being near the bottom and higher addresses at the top. Memory layout varies greatly from operating system to operating system but a generalization that works well for an Intel Windows system is: lower memory for lower level system tasks (BIOS & Kernel), midrange memory for active program storage, high-midrange for software data storage, and high memory for more hardware storage (such as video cards and other PCI devices). The benefit of modern languages is that most of these memory based decisions no longer have to be managed by the programmer, the only time when this becomes necessary is when working at a low level in C or Assembler.
As you can very well see, memory is more complex than the simple RAM chips that are inserted into your computer. There’s a whole model to the way memory is structured and organized by the system. One passing note that should be mentioned is that most of the software exploits we are plagued with are caused by sloppy programming in regards to memory management and security. We are going to now take a step up and take a look at the input and output (IO) aspect of the Von-Neumann model.
Input and Output (IO)… sounds simple but this is the last key aspect that is required to make a computer come alive in our Von-Neumann model. The first idea that comes to mind when IO is mentioned is most likely the keyboard and mouse. This is true to a degree but the keyboard and mouse are merely a bridge from our input methods to ones that the computer understands. IO encompasses multiple aspects including, but not limited to hard drives, optical drives, and of course peripherals such as the keyboard and mouse. We will be focusing on hard drives here for simplicity. You are probably wondering why display devices wasn’t mentioned. At the level of system architecture the display device is handled discretely by a dedicated graphics card or an integrated graphics card. As a result of this it isn’t a part of traditional IO, so we will be simply assuming our system is running a dedicated graphics card.
Hard drives are ancient technology compared to flash memory of the year 2009. Hard drives work by storing information magnetically on glass drive platters. This information is written by magnetically changing the state of the bytes on the drive. The hard drive has a head which moves around the drive according to instructions given to it by the microcontroller on the drive. Drives spin at speeds of up to 10,000 RPM (7200 RPM is standard in a desktop drive, 5400 RPM is common in laptop drives). When the drive spins the head must move back and forth to read information on the drive. The placement of this information is controlled by the operating system and some operating systems do this better than others. When you command notepad to save a text file to your hard drive the operating system will find an open space on the drive and save it. If the hard drive is fragmented this file may be split into multiple parts across the drive (this is what defragmenting helps fix). It would be too complicated for the operating system to remember where every file starts and ends so as a result of this the operating system creates the equivalent of a phone book. This phone book stores the name of a file and directions on how to locate the actual contents. When deleting a file Windows just deletes this reference which means the file is “deleted” by the virtue that the space is no longer reserved and can be written over. In a nutshell this means that when deleting a file, if no further disk operations occur the file could potentially be recovered in full but this is a topic for another article.
You are probably wondering just how hard drives communicate with the CPU and how their actions deal with memory, that point will be addressed next. So far we have broken down the CPU into sub-components, examined the memory model, and looked at how long term storage works. This next part is essentially a look at how a motherboard works from a macro perspective.
The motherboard is known as the piece of plastic that houses all the components and circuitry required to connect them. As stated before the control unit of the CPU is the brain of the computer and rightly so as it coordinates each piece of hardware. There are many ways for a motherboard to connect and relay information across components. Intel will be focused on here as its architecture is fairly simple. The CPU is connected to a motherboard chip called a “Northbridge” via a “Front Side Bus.” The front side bus relays all info from the CPU to the Northbridge. This is why in the past having a fast Front Side Bus (FSB) speed was critical. The Northbridge then hands tasks off to either the memory or PCI Express graphics card. The Northbridge can be thought of as a memory controller, that is the chip that controls memory operations at the request of the CPU. It also doubles as a PCI controller for the PCI Express graphics card in your system. The Northbridge is then connected to the Southbridge. The Southbridge is considerably slower than the Northbridge, this isn’t a problem giving what it controls. The Southbridge controls all IO methods including the Serial ATA (SATA) and IDE (for hard drives), PCI Bus (expansion bays), Power Management, USB, Networking, BIOS Memory, and Audio. It is this combination of the Southbridge, Northbridge, and Front Side Bus that forms the motherboard chipset and connects all the components to the CPU. This setup can be used to describe semi-modern Intel based systems including the Pentium 4, Intel Core, and Intel Core 2.
Recently with the release of Intel’s new Nehalem architecture they have abandoned the Front Side Bus and Northbridge. The memory controller and PCI Express controller are built directly in to the CPU. This increases performance but not to a level a casual user would notice. It should also be worth noting that AMD dropped their Front Side Bus years before Intel.
This leaves us with a nice overview of how the traditional computer works. It also leaves us with a box that can’t do much which will be rectified in a later article. I hope this has given you some insight into how computers work overall. If there are any questions/comments please leave them in the comments field or PM me on the forums.