Skip to main content

Posts

Showing posts from November, 2021

Temporal and Spatial Locality

When referencing data items, the closer the instruction is to the processor the faster it can be accessed. The principle of locality is broken down into two types, temporal locality and spatial locality. Temporal locality can be explained as something that has been referenced has a high probability of being quickly referenced again (Patterson & Hennessy, 2014). While spatial locality is when instruction is referenced, instructions with addresses close to it will referenced as well (Patterson & Hennessy, 2014).   When incorporating these two concepts with referencing data, it can be explained using an array. Chi, Ho, and Lau (2012) explain that “array references have relatively strong spatial locality”. When indexing through the elements of an array is spatial locality. Elements in array hold memory addresses close to each other. Temporal locality would be constantly referencing the same element in an array.  The memory hierarchy can be broken into layers of different types of m

Computer Processor Implementation

The basic implementation of a processor revolves around the performance of a computer. Three factors play a role in the performance of a computer such as instruction count, clock cycle time, and clock cycles per instruction. According to the textbook, it mentions, "the implementation of the processor determines both the clock cycle time and the number of clock cycles per instruction." The MIPS instruction sets pertain to fetching the program counter's memory address and reading from the registers.   The ALU, adder, instruction, data memory, and the register file are all needed for the MIPS data path. The instruction and data memory are used to store the instruction location. In other words, the data path and the instruction memory get the instructions from the program counter along with the adder. Then the program counter is incremented to the following instruction location. These two elements are considered state elements because they can store information. The ALU and a

ALU R-Type Functions

The R-type or R-format instructions read two registers: rs-first register source operand and rt second register source operand. It then moves onto the written instruction (rd) which is the register destination operand. To support the instructions, we need to add an element called the register file. Doing so will both read and write starting with Read Register 1, which is the first source register, and will be 5 bits long. Next is the Read Register 2 which is the second source register and is also 5 bits wide. Then we move onto the write register which is the destination register and will be 5 bits wide as well. Last is the write data which is data waiting to be written to the register and it is 32 bits wide. Keeping that in mind, “To actually execute R-format instructions, we need to include the ALU element. The ALU performs the operation indicated by the instruction. It takes two operands, as well as a 4-bit wide operation selector value. The result of the operation is the output valu

Arithmetic Logic Unit Functions

The Arithmetic Logic Unit (ALU), within a computer, can perform logical operations such as “or” and “and”, including the arithmetic operations. The control unit supplies the data required by the ALU from memory or input devices. It directs the ALU to perform a specific operation based on the instruction obtained from memory. An arithmetic logic unit (ALU) is a significant component of the computer system's central processing unit. It does all processes related to arithmetic and logic operations according to the instructions. The ALU separates into the arithmetic unit (AU) and the logic unit (LU) in some microprocessor architectures. ALU is also known as an Integer Unit (IU). The arithmetic logic unit is part of the CPU that handles all the calculations the CPU may need.   A floating-point is a computer that represents numbers in which the binary point is not fixed. A floating-point representation will need to adjust between the size of the fraction and the size of the exponent. If

When Algorithms Go Wrong

An example of when an arithmetic operation led to unexpected behavior in computer usage and design was with the European Space Agency’s Ariane-5 launcher. The Ariane-5 launcher’s flight lasted only forty seconds because of an overflow error. According to Le Lann (2002), the reason the Ariane-5 launcher exploded was “during a conversion from a 64-bit floating point number F to a 16-bit signed integer number”. A 16-bit signed integer can only hold integers ranging from -32,768 to 32,767. When the conversion from the 64-bit floating number resulted in a larger integer than the 16-bit signed integer can hold, it created an overflow error.   Unfortunately, the error was not fixed in time because the Ariane –5 launcher had disintegrated shortly after takeoff. Lake (2010) states that this error occurred because a “software handler that could have dealt with the problem had been disabled”. This overflow error could have been avoided by enabling a software handler to work alongside the existing

Addition and Subtraction of Binary Numbers

The best way to remember how to add binary integers is by knowing the way they break down such as, 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 but remember to carry the 1 to the next significant bit. In the addition example posted below, the equation is using the 32-bit binary version of the integers 14 and 13 and generating a result of 27.                0000 0000 0000 0000 0000 0000 0000 1110    (14)          +    0000 0000 0000 0000 0000 0000 0000 1101    (13)  _________________________________________________               0000 0000 0000 0000 0000 0000 0001 1011    (27)  The rules for subtraction can be just as easy by remembering the following rules, 0 – 0 = 0, 1 – 0 = 1, 1 – 1 = 0, and 0 – 1 = 1 but remember to borrow 1 from the next more significant bit. In the subtraction example posted below, the equation is using the 32-bit binary version of the integers 14 and 13 and generating a result of 1.                 0000 0000 0000 0000 0000 0000 0000 1110    (14)          -     0

Classic Computer Components

The five classical components of a computer system consist of the input, output, memory, control, and data path. Input components are devices that are used to feed computer information such as keyboards, microphones, and a mouse. Output components are devices that convey the results of input computation to the user such as monitors, speakers, and printers. Memory components store instructions and data that are needed by programs. Memory components include random access memory, read-only memory, and cache memory. The data path is the part of the CPU that performs arithmetic operations, and the control component is the part of CPU that commands the data path, memory, input, and output devices. The list below shows the order in which all of these components work together to perform a function.  Input data from a keyboard, file, network, etc., is written in memory. A data path operates on data. Output reads data from memory. Control sends the signals that determine the operations of the da