Arithmetic Logic Unit (ALU)
The Arithmetic Logic Unit (ALU) is one of the core units in the Central Processing Unit (CPUs). The ALU also executes all mathematical as well as logical functions, that are enabled within the CPU. Apart from this, this unit takes care of:
- Arithmetic of numbers which include addition, subtraction, multiplication, division.
- Logical operations such as AND, OR, NOT and XOR.
- Operations that are done on bits such as shifts and rotates.
- Operations of comparison that assist in decision making (e.g. less than and greater than or equal to)
Example of ALU Operation:
For example, the program executing adds two numbers. The ALU receives two inputs (operands), let us say 5 and 10, applies the sum function, and sends back the result (15).
If an operation of this sort is required for example is the number a greater number than b, for example is 10 greater than 5? The ALU performs the operation and gives back true.
Role of ALU in Program Execution:
Every mathematical or logical decision performed by a computer, the CPU makes use of the ALU. The ALU closely cooperates with the control steers of a CPU in instilling system commands, manipulating data and storing the outcomes.
Input-output Units
Input-output (I/O) units are the equipment that enables a computer to exchange information in a non-verbal manner and more importantly with the external environment. While the input units provide information to the computer, the output units give the results of computation to the end user.
Types of Input Devices Include:
- Keyboard: It permits the users to type in texts, commands and other items.
- Mouse: Changes the position of the physical pointing device for graphic user interface elements clicked on the computer screen.
- Scanner: Enters printed images or documents into a computer.
- Microphone: Captures sound for various uses such as recording or making phone calls.
Example:
Character data is sent to a computer through typing in the keyboard where processing of the entered data takes place as well as storing of the information with possibilities of further executions such as vector based art drawing printing or file vectoring.
Types of Output Devices Include:
- Monitor: A device that presents a computer’s output consisting of texts, images and video.
- Printer: A machine used to produce a hard copy of a document.
- Speakers: Transmit the electrical signals and produce sound.
- Projector: Draws and throws an image created by an output device onto a flat surface such as a wall or screen.
Example:
If you want the document to get printed, you simply press the ‘print’ button on the document and the relevant processed information is sent to the computer’s printer which prints out a printed copy of the document.
Memory Units
Memory units of a computer are defined as the components of the device which save information and programs temporarily or permanently.
Primary vs. Secondary Memory:
Primary Memory (Main Memory):
- This refers to the computer’s immediate working area which is available for use by the CPU.
- Examples: RAM (Random Access Memory), Cache Memory.
- RAM is temporary storage that is cleared every time the systems are turned off.
- Cache storage is quite small but quicker than RAM. It holds commonly required materials.
- Example: When a person clicks on an icon, that application goes into memory and is readily available for the CPU.
Secondary Memory:
- This is used for keeping data for a long period of time.
- Examples: Hard Disk Drives (HDD), Solid-state Drives (SSD), USB, CDs and DVDs.
- As compared to secondary memory, secondary memory is persistent which means that even switching off the computer does not erase any data.
- Example: When a document is uploaded to the primary hard disk, it is now placed in the secondary memory where the user can retrieve it even after switching off the computer.
Types of Memory:
RAM (Random Access Memory):
An ephemeral area that is used to accommodate current procedures.
Example: If you open many pages on the internet, each of them is kept in RAM and not deleted until you close it.
ROM (Read Only Memory):
This is the type of storage that retains its structure even when electricity stops. Contains the main operating processes of the computer such as the installation of BIOS.
Example: ROM is generally understood to contain the directions for starting up the computer.
Program Counter (PC)
A program counter (PC) is usually defined as a specialized register provided in the CPU, which keeps an address of the memory location of the next instruction in a program that’s to be executed next.
Purpose in Program Execution:
As each instruction completes its execution, the Program Counter moves one step forward due to a functioning operation on the Central Processing unit.
However, in case there is a jump, loop or branch statement to be executed – in case of a conditional statement for instance – the Amazing Well-Teched‘re – how to reference – Keith Blah” Blah’’s pages 4 and 7 pages of jets ki lean anne’s main Failure: Lesson One. ‘Making human connect’ –.) which is to be addressed second is directed to the address of the instruction that needs to be addressed next depending on the condition.
Example:
Let’s look at a case where a program has the following statements.
- Load A.
- Add B.
- Store Result.
- Jump to Instruction 1 (in a loop)
- To begin with, the first instruction 1 is copied into the pc the address contained in pc still codes jump to instruction 1. Even after instruction one; he pc was increased and even moved to instruction) 2 and so on.
- When this assail reaches instruction one of the fourth set of instructions that border a loop, again the pc is adjusted to reset a pointer on instruction one, hence making the floating action to be effected over again.