Anatomy of the CPU
ALU (Arithmetic Logic unit): an ALU is a circuit that performs operations such as arithmetic and logical operations. This unit controls the order within the computer system and controls the flow of traffic such as arithmetic and logical operations. How this unit works is that it selects a statement from the storage area and interprets the statement and then it sends an impulse to the arithmetic logical unit to allow the instruction to be executed. The arithmetic logic unit can perform many operations including adding, subtracting, multiplying and division. The input required to allow the arithmetic logic unit to do such operations is from the CPU registers and operands.
Control Unit: A control unit is a circuit that controls the flow of information through the processor. The control unit performs the tasks of executing, fetching, and decoding. The control unit can be the brain of the CPU. It performs based on the instructions it decodes. There are mainly two types of control units. The first type is called the hardwired control unit. This type of control unit are made out of digital circuits and once created, it cannot be changed. The second type is the micro programmed control unit. This type mainly decodes and executes instructions based on what it receives. The control unit also contains registers that store current instructions.
Address Register: The address register keeps track of location in the memory. There are 3 main types of address registers, the MAR, DMAR and SMAR. The MAR is a parallel load register that contains the memory address that is to be changed. The DMAR is the location of the memory. The SMAR is the source memory address register. It is also a high speed circuit that holds information that is going to be processed or the next instruction that will be executed. It holds the memory location of data that needs to be executed. The Address register holds the memory address of an operand.
Program Counter: The program counter is a control unit in the CPU that is used to keep track of the address of the current or next instruction that is needed to be executed. It holds either the address of the instruction being executed or the address of the next instruction that is being executed. The program counters increments by each instruction cycle. It automatically increments one by one as the instructions get fetched. The programs counter usually increments independently when instructions are received. The program counter is a type of register.
Data Register: A data register contains data to be stored in the computer storage or the data from the computer storage that was fetched. It holds anything that is copied from the memory for the processor to use it. It is a small amount of storage available on the CPU where the data can be accessed quickly than any storage available. It is also the register of a computer’s control unit that contains the information on a register to fetch or to store form or to the computer storage.
Instruction Decoder: The instruction decoder is a circuit that translates instruction codes into the address in the micro memory where the memory for the instructions starts. It is also the time period during which the computer processes instructions from its memory or the sequence of actions that the CPU performs to execute each instruction in the program or application. The instruction decoder interprets and implements the instructions from the CPU. It does the opposite of what an encoder does. The instruction decoder is part of the CPU that converts the bits stored into the instruction register. A normal CPU with 8 registers can use many decoders.
Data Cache: A data cache is used by the central processing unit of a computer to allow the CPU to access memory from the CPU quicker. The cache is a smaller and faster memory which stores copies of data from the main memory location such as ROM or RAM. When the processor needs to read from or write to a location in main memory, it first checks whether a copy of that data is in the cache. If it is in the main memory, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory.
Instruction Cache: The Instruction Cache acts as a memory between external memory and the DSP core processor. When code executes, the code words at the locations requested by the instruction set are copied into the Instruction Cache for direct access by the core processor. If the same code is used frequently in a set of program instructions, storage of these instructions in the cache increases because external bus accesses are eliminated. Cache is much smaller than the actual data meaning memory it can be accessed and transferred at a greater speed.
Describe, step by step, how the CPU actually works if you were to subtract 5 from 8?
In order to do basic math such as adding and subtracting in the CPU, you must first convert the numbers that you are trying to add or subtract to the binary numeral system. The binary numeral system represents numerical values using two symbols, “0” and “1”. After the CPU converts the numbers into a binary number, it will then add or subtract. The binary number for 5 is 00000101 and the binary number for 8 is 00001000. 00000101 are stored in the accumulator in address C and 00001000 are stored in the accumulator in address B. The CPU will then subtract the number from B and the number from C. The result is stored in a new address in memory in the accumulator; Address A. The result will be 3 and the binary number for 3 is 00000011. We can also add or subtract using the basic logic gates which can add two 8-bit numbers. The CPU has a number of registers which store inputs and outputs.
Read about how slot machines are programmed to scam your money.
Slot Machines: The Big Secret
Controversy in the Olympics, as Gold Medallist is questioned about drug use.
Olympic Games: China's Ye Shiwen accused of using performance-enhancement drugs?
Nuno Pontes broke out of a maximum security prison. Read about it
Watch Breakout: Nuno Pontes