Transcript for:
CPU Components and Buses Overview

in this video we provide an overview of the main internal components of a processor and the buses that connect them to main memory in later videos in this series we'll look at how they all work together [Music] so at a very high level your computer gathers input via variety of devices such as a keyboard mouse microphone controller touch gestures and so forth the brain of your computer the central processing unit then works out what it needs to do it regularly interacts with main memory reading and writing information is required and eventually produces some output which we understand and this comes in the form of visuals for display screen sound or vibration feedback we're going to take the lid off the processor now and have a look at the main components inside so here we have an abstraction of the internal components the cpu and main memory and how they're connected together we're going to run through each of these now explaining their purpose and how they work and then in later videos we'll show you how they interact together to perform the job of carrying out tasks so arguably the most important component inside the processor is the control unit and it's responsible for coordinating all the activities of the processor it directs the flow of data between the cpu and all other devices on your computer it accepts the next instruction it needs to deal with decodes it handles its execution and stores the results of data back into memory or other registers it's responsible for sending memory read and write requests to main memory on the control bus as well as other command and control signals such as bus requests bus grants interrupts etcetera it makes extensive use of statious registers in the clock which is slightly beyond the specification and it coordinates and communicates with all parts of the cpu the next component is called the program counter and this is the first of a number of registers you need to be aware of it holds the address of the next instruction in memory which needs to be executed by the processor now this could simply be the next instruction in a sequence of instructions or it could be an address to jump to a very different instruction for example if the current instruction register contains a command to jump or branch it has a very close relationship with the memory address register and at the start of every single new fetch decode and execute cycle the address that's held in the program counter is copied into the memory address register so let's look at the memory address register now this holds the address of the memory location from which data or instruction is to be fetched or which data is to be written and it sends these addresses to memory down a bus called the address bus the memory data register is used to temporarily store any data which is read from or is about to be written to main memory it's sometimes referred to as the memory buffer register and is nicknamed the gateway to the processor and this is because all data which is going to be written to or read from the memory must first pass through the memory data register the next register is the current instruction register as the name suggests this holds the current instruction actually being executed the contents of the memory data register are copied to the current instruction register if it is an instruction it contains two things an op code and an operand and together these make the instruction for example a machine language instruction to load the contents of memory location eight so in binary that's one zero zero zero into the alau may look something like lda one zero zero zero another vital component of the cpu is the arithmetic logic unit or alu it performs arithmetic and logical operations on data so arithmetic operations are things like add subtract multiply and divide and bit wise shift operations left and right which we look at in later videos logical operations are comparisons and boolean logic for example and or not an excel it often makes use of various general purpose registers to temporarily hold the results of calculations and one of these is called the accumulator as just mentioned one of the number of general purpose registers that modern cpus have is known as the accumulator and it tends to be data or control information that's stored here inside the cpu now modern cpus have many different general purpose registers for storing of temporary data while instructions or calculations are actually being carried out by the processor typically the more general purpose registers a processor has the faster it will operate and this is because accessing reading and writing information from registers inside the cpu is always much quicker than reading or writing information from main memory the results for example of calculations carried out by the alu can temporarily be stored here for super quick retrieval now we've been talking about the various buses as we've been discussing the other components of the cpu but let's go through each of them now the first to talk about at the top is the address bus now you'll notice this is unidirectional meaning information only flows in one direction and that's from the processor to main memory the address bus is responsible for carrying the actual memory addresses that identify where data needs to be read from in memory or where data needs to be written to in memory the next bus is a data bus and this is bi-directional meaning information can flow both ways this bus is responsible for carrying the actual binary ones and zeros that make up the information being transmitted around the cpu and the final bus which is also bi-directional is the control bus and this is responsible for carrying command and control signals to and from every other component on the cpu for example it sends memory read and memory write control signals to main memory so although computers only deal in binary ones and zeros as humans obviously we prefer to deal in more abstract languages that we can easily understand so we can see here that the instruction 0 1 0 1 actually means to load at a low level computers use what is known as assembly code a language that has a direct one-to-one relationship with the processor architecture the assembly language instruction for load for example could be lda and an assembly language we call this short three or four letter code and mnemonic the assembly code mnemonics you need to know for the exam are listed below now don't worry too much about getting your head around all of these different mnemonics and what they mean at this stage we're going to go into assembly language in a lot more detail in later videos so having watched this video you should be able to answer the following key question what are the components of a cpu and what do they do so that's everything you need to know from the specifications so you can stop taking notes but it's well worth watching the rest of this video because we're going to go over a few other very important components of the cpu which will help give you a better understanding moving forwards so there are five other very important components of the cpu while not listed in the specification they're really important to know about and will add to your understanding of how the processor works moving forward we'll look at each of them in turn now the decode unit is essentially a piece of logic that's presented with a sequence of bits which have been fetched from memory now you can think of the decode unit in an abstract way as a simple lookup table it prepares the execution of an instruction by looking up the binary operation code it's received in its table so the cpu knows what to do the fixed number of commands available in the decode unit will be specific to the instruction set architecture of that particular processor next we have the status register now this contains information about various states inside the processor individual bits can be implicitly or explicitly read or written to by machine code instructions inside the processor these bits are effectively like on and off flags and these flags can be checked at any point to work out various statuses the clock is a unit which synchronizes related components by generating pulses at a constant rate and we measure this in what's known as hertz a single hertz means one pulse per second the clock speed is the frequency therefore effectively at which the internal clock generates these pulses the higher clock rate the faster the computer may work this is one of the main stats that's quoted when you buy a computer for example this pc has a 3.4 gigahertz processor it's referring to the clock speed in hertz finally we have the interrupt register often known as an interrupt control register this is checked by the cpu to see if an interrupt is awaiting processing if it is a software process known as the interrupt service routine kicks in and handles the interrupt request by interrupting what is currently going on now interrupts can come from many different sources a very simple example would be the routine which handles keyboard events for example you pressing the spacebar you can learn a lot more about interrupts and how they work in another part of the course [Music] and finally we have cache this is a small area of memory often located on or inside the cpu or very near it and it provides fast access to frequently used instructions and data just like the general purpose registers cache typically is graded as level 1 2 or 3 and depending on the level depends on the speed of access all cache at the end of the day though is physically closer to the cpu than ram and faster to access but the downside is it has a much smaller capacity you