A computer is a programmable electronic device that accepts raw data as input and processes it with a set of instructions (a program) to produce the result as output. It renders output just after performing mathematical and logical operations and can save the output for future use. It can process numerical as well as non-numerical calculations. The term "computer" is derived from the Latin word "computare" which means to calculate.
A computer is designed to execute applications and provides a variety of solutions through integrated hardware and software components. It works with the help of programs and represents the decimal numbers through a string of binary digits. It also has a memory that stores the data, programs, and result of processing. The components of a computer such as machinery that includes wires, transistors, circuits, hard disk are called hardware. Whereas, the programs and data are called software.
It is believed that the Analytical Engine was the first computer which was invented by Charles Babbage in 1837. It used punch cards as read-only memory. Charles Babbage is also known as the father of the computer.
The basic parts without which a computer cannot work are as follows:
- Processor: It executes instructions from software and hardware.
- Memory: It is the primary memory for data transfer between the CPU and storage.
- Motherboard: It is the part that connects all other parts or components of a computer.
- Storage Device: It permanently stores the data, e.g., hard drive.
- Input Device: It allows you to communicate with the computer or to input data, e.g., a keyboard.
- Output Device: It enables you to see the output, e.g., monitor.
Computers are divided into different types based on different criteria. Based on the size, a computer can be divided into five types:
- Micro Computer
- Mini Computer
- Mainframe Computer
- Super Computer
- Workstations
It is a single-user computer which has less speed and storage capacity than the other types. It uses a microprocessor as a CPU. The first microcomputer was built with 8-bit microprocessor chips. The common examples of microcomputers include laptops, desktop computers, personal digital assistant (PDA), tablets, and smartphones. Microcomputers are generally designed and developed for general usage like browsing, searching for information, internet, MS Office, social media, etc.
Mini-computers are also known as "Midrange Computers." They are not designed for a single. They are multi-user computers designed to support multiple users simultaneously. So, they are generally used by small businesses and firms. Individual departments of a company use these computers for specific purposes. For example, the admission department of a University can use a Mini-computer for monitoring the admission process.
It is also a multi-user computer capable of supporting thousands of users simultaneously. They are used by large firms and government organizations to run their business operations as they can store and process large amounts of data. For example, Banks, universities, and insurance companies use mainframe computers to store the data of their customers, students, and policyholders, respectively.
Super-computers are the fastest and most expensive computers among all types of computers. They have huge storage capacities and computing speeds and thus can perform millions of instructions per second. The super-computers are task-specific and thus used for specialized applications such as large-scale numerical problems in scientific and engineering disciplines including applications in electronics, petroleum engineering, weather forecasting, medicine, space research and more. For example, NASA uses supercomputers for launching space satellites and monitoring and controlling them for space exploration.
It is a single-user computer. Although it is like a personal computer, it has a more powerful microprocessor and a higher-quality monitor than a microcomputer. In terms of storage capacity and speed, it comes between a personal computer and minicomputer. Work stations are generally used for specialized applications such as desktop publishing, software development, and engineering designs.
- Increases your productivity: A computer increases your productivity. For example, after having a basic understanding of a word processor, you can create, edit, store, and print the documents easily and quickly.
- Connects to the Internet: It connects you to the internet that allows you to send emails, browse content, gain information, use social media platforms, and more. By connecting to the internet, you can also connect to your long-distance friends and family members.
- Storage: A computer allows you to store a large amount of information, e.g., you can store your projects, ebooks, documents, movies, pictures, songs, and more.
- Organized Data and Information: It not only allows you to store data but also enables you to organize your data. For example, you can create different folders to store different data and information and thus can search for information easily and quickly.
- Improves your abilities: It helps write good English if you are not good at spelling and grammar. Similarly, if you are not good at math, and don't have a great memory, you can use a computer to perform calculations and store the results.
- Assist the physically challenged: It can be used to help the physically challenged, e.g., Stephen Hawking, who was not able to speak used computer to speak. It also can be used to help blind people by installing special software to read what is on the screen.
- Keeps you entertained: You can use the computer to listen to songs, watch movies, play games and more.
The computer has become a part of our life. There are plenty of things that we do in a day are dependent on a computer. Some of the common examples are as follows:
- ATM: While withdrawing cash from an ATM, you are using a computer that enables the ATM to take instructions and dispense cash accordingly.
- Digital currency: A computer keeps a record of your transactions and balance in your account and the money deposited in your account in a bank is stored as a digital record or digital currency.
- Trading: Stock markets use computers for day-to-day trading. There are many advanced algorithms based on computers that handle trading without involving humans.
- Smartphone: The smartphone that we use throughout the day for calling, texting, browsing is itself a computer.
- VoIP: All voice over IP communication (VoIP) is handled and done by computers.
We can categorize computer in two ways: on the basis of data handling capabilities and size.
On the basis of data handling capabilities, the computer is of three types:
- Analogue Computer
- Digital Computer
- Hybrid Computer
Analogue computers are designed to process analogue data. Analogue data is continuous data that changes continuously and cannot have discrete values. We can say that analogue computers are used where we don't need exact values always such as speed, temperature, pressure and current.
Analogue computers directly accept the data from the measuring device without first converting it into numbers and codes. They measure the continuous changes in physical quantity and generally render output as a reading on a dial or scale. Speedometer and mercury thermometer are examples of analogue computers.
Advantages of using analogue computers:
- It allows real-time operations and computation at the same time and continuous representation of all data within the rage of the analogue machine.
- In some applications, it allows performing calculations without taking the help of transducers for converting the inputs or outputs to digital electronic form and vice versa.
- The programmer can scale the problem for the dynamic range of the analogue computer. It provides insight into the problem and helps understand the errors and their effects.
- Slide Rules: It is one of the simplest types of mechanical analogue computers. It was developed to perform basic mathematical calculations. It is made of two rods. To perform the calculation, the hashed rod is slid to line up with the markings on another rod.
- Differential Analysers: It was developed to perform differential calculations. It performs integration using wheel-and-disc mechanisms to solve differential calculations.
- Castle Clock: It was invented by Al-Jarazi. It was able to save programming instructions. Its height was around 11 feet and it was provided with the display of time, the zodiac, and the solar and lunar orbits. This device also could allow users to set the length of the day as per the current season.
- Electronic Analogue Computer: In this type of analogue computer, electrical signals flow through capacitors and resistors to simulate physical phenomena. Here, the mechanical interaction of components does not take place. The voltage of the electrical signal generates the appropriate displays.
Digital computer is designed to perform calculations and logical operations at high speed. It accepts the raw data as input in the form of digits or binary numbers (0 and 1) and processes it with programs stored in its memory to produce the output. All modern computers like laptops, desktops including smartphones that we use at home or office are digital computers.
Advantages of digital computers:
- It allows you to store a large amount of information and to retrieve it easily whenever you need it.
- You can easily add new features to digital systems more easily.
- Different applications can be used in digital systems just by changing the program without making any changes in hardware
- The cost of hardware is less due to the advancement in the IC technology.
- It offers high speed as the data is processed digitally.
- It is highly reliable as it uses error correction codes.
- Reproducibility of results is higher as the output is not affected by noise, temperature, humidity, and other properties of its components.
Hybrid computer has features of both analogue and digital computer. It is fast like an analogue computer and has memory and accuracy like digital computers. It can process both continuous and discrete data. It accepts analogue signals and convert them into digital form before processing. So, it is widely used in specialized applications where both analogue and digital data is processed. For example, a processor is used in petrol pumps that converts the measurements of fuel flow into quantity and price. Similarly, they are used in airplanes, hospitals, and scientific applications.
Advantages of using hybrid computers:
- Its computing speed is very high due to the all-parallel configuration of the analogue subsystem.
- It produces precise and quick results that are more accurate and useful.
- It has the ability to solve and manage big equation in real-time.
- It helps in the on-line data processing.
On the basis of size, the computer can be of five types:
Supercomputers are the biggest and fastest computers. They are designed to process huge amount of data. A supercomputer can process trillions of instructions in a second. It has thousands of interconnected processors.
Supercomputers are particularly used in scientific and engineering applications such as weather forecasting, scientific simulations and nuclear energy research. The first supercomputer was developed by Roger Cray in 1976.
Characteristics or applications of supercomputers:
- It has the ability to decrypt your password to enhance protection for security reasons.
- It produces excellent results in animations.
- It is used for virtual testing of nuclear weapons and critical medical tests.
- It can study and understand climate patterns and forecast weather conditions. It can run in NOAA's system (National Oceanic and Atmospheric Administration) that can execute any type of simple and logical data.
- It helps in designing the flight simulators for pilots at the beginner level for their training.
- It helps in extracting useful information from data storage centres or cloud system. For example, in insurance companies.
- It has played a vital role in managing the online currency world such as stock market and bitcoin.
- It helps in the diagnosis of various critical diseases and in producing accurate results in brain injuries, strokes, etc.
- It helps in scientific research areas by accurately analysing data obtained from exploring the solar system, satellites, and movement of Earth.
- It also used in a smog control system where it predicts the level of fog and other pollutants in the atmosphere.
Mainframe computers are designed to support hundreds or thousands of users simultaneously. They can support multiple programs at the same time. It means they can execute different processes simultaneously. These features of mainframe computers make them ideal for big organizations like banking and telecom sectors, which need to manage and process high volume of data.
Mainframe computers are designed to support hundreds or thousands of users simultaneously. They can support multiple programs at the same time. It means they can execute different processes simultaneously. These features of mainframe computers make them ideal for big organizations like banking and telecom sectors, which need to manage and process a high volume of data that requires integer operations such as indexing, comparisons, etc.
Characteristics of Mainframe Computers:
- It can process huge amount of data, e.g., millions of transactions in a second in the banking sector.
- It has a very long life. It can run smoothly for up to 50 years after proper installation.
- It gives excellent performance with large scale memory management.
- It has the ability to share or distribute its workload among other processors and input/output terminals.
- There are fewer chances of error or bugs during processing in mainframe computers. If any error occurs it can fix it quickly without affecting the performance.
- It has the ability to protect the stored data and other ongoing exchange of information and data.
Applications of mainframe computers:
- In health care, it enabled hospitals to maintain a record of their millions of patients in order to contact them for treatment or related to their appointment, medicine updates or disease updates.
- In the field of defence, it allows the defence departments to share a large amount of sensitive information with other branches of defence.
- In the field of education, it helps big universities to store, manage and retrieve data related to their courses, admissions, students, teachers, employees and affiliated schools and colleges.
- In the retail sector, the retail companies that have a huge customer base and branches use mainframe computers to handle and execute information related to their inventory management, customer management, and huge transactions in a short duration.
It is a midsize multiprocessing computer. It consists of two or more processors and can support 4 to 200 users at one time. Miniframe computers are used in institutes and departments for tasks such as billing, accounting and inventory management. A minicomputer lies between the mainframe and microcomputer as it is smaller than mainframe but larger than a microcomputer.
Characteristics of miniframe or minicomputer:
- It is light weight that makes it easy to carry and fit anywhere.
- It is less expensive than mainframe computers.
- It is very fast compared to its size.
- It remains charged for a long time.
- It does not require a controlled operational environment.
Applications of minicomputers:
A minicomputer is mainly used to perform three primary functions, which are as follows:
- Process control: It was used for process control in manufacturing. It mainly performs two primary functions that are collecting data and feedback. If any abnormality occurs in the process, it is detected by the minicomputer and necessary adjustments are made accordingly.
- Data management: It is an excellent device for small organizations to collect, store and share data. Local hospitals and hotels can use it to maintain the records of their patients and customers respectively.
- Communications Portal: It can also play the role of a communication device in larger systems by serving as a portal between a human operator and a central processor or computer.
Workstation is a single user computer that is designed for technical or scientific applications. It has a faster microprocessor, a large amount of RAM and high-speed graphic adapters. It generally performs a specific job with great expertise; accordingly, they are of different types such as graphics workstation, music workstation and engineering design workstation.
Characteristics of workstation computer:
- It is a high-performance computer system designed for a single user for business or professional use.
- It has larger storage capacity, better graphics, and more powerful CPU than a personal computer.
- It can handle animation, data analysis, CAD, audio and video creation and editing.
Any computer that has the following five features, can be termed as a workstation or can be used as a workstation.
- Multiple Processor Cores: It has more processor cores than simple laptops or computers.
- ECC RAM: It is provided with Error-correcting code memory that can fix memory errors before they affect the system's performance.
- RAID (Redundant Array of Independent Disks): It refers to multiple internal hard drives to store or process data. RAID can be of different types, for example, there can be multiple drives to process data or mirrored drives where if one drive does not work than other starts functioning.
- SSD: It is better than conventional hard-disk drives. It does not have moving parts, so the chances of physical failure are very less.
- Optimized, Higher end GPU: It reduces the load on CPU. E.g., CPU has to do less work while processing the screen output.
Microcomputer is also known as a personal computer. It is a general-purpose computer that is designed for individual use. It has a microprocessor as a central processing unit, memory, storage area, input unit and output unit. Laptops and desktop computers are examples of microcomputers. They are suitable for personal work that may be making an assignment, watching a movie, or at office for office work.
Characteristics of a microcomputer:
- It is the smallest in size among all types of computers.
- A limited number of software can be used.
- It is designed for personal work and applications. Only one user can work at a time.
- It is less expansive and easy to use.
- It does not require the user to have special skills or training to use it.
- Generally, comes with single semiconductor chip.
- It is capable of multitasking such as printing, scanning, browsing, watching videos, etc.
- A computer organization describes the functions and design of the various units of a digital system.
- A general-purpose computer system is the best-known example of a digital system. Other examples include telephone switching exchanges, digital voltmeters, digital counters, electronic calculators and digital displays.
- Computer architecture deals with the specification of the instruction set and the hardware units that implement the instructions.
- Computer hardware consists of electronic circuits, displays, magnetic and optic storage media and also the communication facilities.
- Functional units are a part of a CPU that performs the operations and calculations called for by the computer program.
- Functional units of a computer system are parts of the CPU (Central Processing Unit) that performs the operations and calculations called for by the computer program. A computer consists of five main components namely, Input unit, Central Processing Unit, Memory unit Arithmetic & logical unit, Control unit and an Output unit.
Fig 1 – Process state
- Input units are used by the computer to read the data. The most commonly used input devices are keyboards, mouse, joysticks, trackballs, microphones, etc.
- However, the most well-known input device is a keyboard. Whenever a key is pressed, the corresponding letter or digit is automatically translated into its corresponding binary code and transmitted over a cable to either the memory or the processor.
- Central processing unit commonly known as CPU can be referred as an electronic circuitry within a computer that carries out the instructions given by a computer program by performing the basic arithmetic, logical, control and input/output (I/O) operations specified by the instructions.
- The Memory unit can be referred to as the storage area in which programs are kept which are running, and that contains data needed by the running programs.
- The Memory unit can be categorized in two ways namely, primary memory and secondary memory.
- It enables a processor to access running execution applications and services that are temporarily stored in a specific memory location.
- Primary storage is the fastest memory that operates at electronic speeds. Primary memory contains a large number of semiconductor storage cells, capable of storing a bit of information. The word length of a computer is between 16-64 bits.
- It is also known as the volatile form of memory, means when the computer is shut down, anything contained in RAM is lost.
- Cache memory is also a kind of memory which is used to fetch the data very soon. They are highly coupled with the processor.
- The most common examples of primary memory are RAM and ROM.
- Secondary memory is used when a large amount of data and programs have to be stored for a long-term basis.
- It is also known as the Non-volatile memory form of memory, means the data is stored permanently irrespective of shut down.
- The most common examples of secondary memory are magnetic disks, magnetic tapes, and optical disks.
- Most of all the arithmetic and logical operations of a computer are executed in the ALU (Arithmetic and Logical Unit) of the processor. It performs arithmetic operations like addition, subtraction, multiplication, division and also the logical operations like AND, OR, NOT operations.
- The control unit is a component of a computer's central processing unit that coordinates the operation of the processor. It tells the computer's memory, arithmetic/logic unit and input and output devices how to respond to a program's instructions.
- The control unit is also known as the nerve centre of a computer system.
- Let's us consider an example of addition of two operands by the instruction given as Add LOCA, RO. This instruction adds the memory location LOCA to the operand in the register RO and places the sum in the register RO. This instruction internally performs several steps.
- The primary function of the output unit is to send the processed results to the user. Output devices display information in a way that the user can understand.
- Output devices are pieces of equipment that are used to generate information or any other response processed by the computer. These devices display information that has been held or generated within a computer.
- The most common example of an output device is a monitor.
Key takeaways:
- A computer is a programmable electronic device that accepts raw data as input and processes it with a set of instructions (a program) to produce the result as output. It renders output just after performing mathematical and logical operations and can save the output for future use. It can process numerical as well as non-numerical calculations. The term "computer" is derived from the Latin word "computare" which means to calculate.
- A computer is designed to execute applications and provides a variety of solutions through integrated hardware and software components. It works with the help of programs and represents the decimal numbers through a string of binary digits. It also has a memory that stores the data, programs, and result of processing. The components of a computer such as machinery that includes wires, transistors, circuits, hard disk are called hardware. Whereas, the programs and data are called software.
- It is believed that the Analytical Engine was the first computer which was invented by Charles Babbage in 1837. It used punch cards as read-only memory. Charles Babbage is also known as the father of the computer.
- The primary function of a computer system is to execute a program, sequence of instructions. These instructions are stored in computer memory.
- These instructions are executed to process data which are already loaded in the computer memory through some input devices.
- After processing the data, the result is either stored in the memory for further reference, or it is sent to the outside world through some output port.
- To perform the execution of an instruction, in addition to the arithmetic logic unit, and control unit, the processor contains a number of registers used for temporary storage of data and some special function registers.
- The special function registers include program counters (PC), instruction registers (IR), memory address registers (MAR) and memory and memory data registers (MDR).
- The Program counter is one of the most critical registers in CPU.
- The Program counter monitors the execution of instructions. It keeps track on which instruction is being executed and what the next instruction will be.
- The instruction register IR is used to hold the instruction that is currently being executed.
- The contents of IR are available to the control unit, which generate the timing signals that control, the various processing elements involved in executing the instruction.
- The two registers MAR and MDR are used to handle the data transfer between the main memory and the processor.
- The MAR holds the address of the main memory to or from which data is to be transferred.
- The MDR contains the data to be written into or read from the addressed word of the main memory.
- Whenever the processor is asked to communicate with devices, we say that the processor is servicing the devices. The processor can service these devices in one of the two ways.
- One way is to use the polling routine, and the other way is to use an interrupt.
- Polling enables the processor software to check each of the input and output devices frequently. During this check, the processor tests to see if any devices need servicing or not.
- Interrupt method provides an external asynchronous input that informs the processor that it should complete whatever instruction that is currently being executed and fetch a new routine that will service the requesting device.
Key takeaways
- The primary function of a computer system is to execute a program, sequence of instructions. These instructions are stored in computer memory.
- These instructions are executed to process data which are already loaded in the computer memory through some input devices.
- After processing the data, the result is either stored in the memory for further reference, or it is sent to the outside world through some output port.
- To perform the execution of an instruction, in addition to the arithmetic logic unit, and control unit, the processor contains a number of registers used for temporary storage of data and some special function registers.
A digital system composed of many registers, and paths must be provided to transfer information from one register to another. The number of wires connecting all of the registers will be excessive if separate lines are used between each register and all other registers in the system.
A bus structure, on the other hand, is more efficient for transferring information between registers in a multi-register configuration system.
A bus consists of a set of common lines, one for each bit of register, through which binary information is transferred one at a time. Control signals determine which register is selected by the bus during a particular register transfer.
The following block diagram shows a Bus system for four registers. It is constructed with the help of four 4 * 1 Multiplexers each having four data inputs (0 through 3) and two selection inputs (S1 and S2).
We have used labels to make it more convenient for you to understand the input-output configuration of a Bus system for four registers. For instance, output 1 of register A is connected to input 0 of MUX1.
Fig 2 – Bus system for 4 Registers
The two selection lines S1 and S2 are connected to the selection inputs of all four multiplexers. The selection lines choose the four bits of one register and transfer them into the four-line common bus.
When both of the select lines are at low logic, i.e. S1S0 = 00, the 0 data inputs of all four multiplexers are selected and applied to the outputs that forms the bus. This, in turn, causes the bus lines to receive the content of register A since the outputs of this register are connected to the 0 data inputs of the multiplexers.
Similarly, when S1S0 = 01, register B is selected, and the bus lines will receive the content provided by register B.
The following function table shows the register that is selected by the bus for each of the four possible binary values of the Selection lines.
Note: The number of multiplexers needed to construct the bus is equal to the number of bits in each register. The size of each multiplexer must be 'k * 1' since it multiplexes 'k' data lines. For instance, a common bus for eight registers of 16 bits each requires 16 multiplexers, one for each line in the bus. Each multiplexer must have eight data input lines and three selection lines to multiplex one significant bit in the eight registers.
A bus system can also be constructed using three-state gates instead of multiplexers.
The three state gates can be considered as a digital circuit that has three gates, two of which are signals equivalent to logic 1 and 0 as in a conventional gate. However, the third gate exhibits a high-impedance state.
The most commonly used three state gates in case of the bus system is a buffer gate.
The graphical symbol of a three-state buffer gate can be represented as:
Fig 3 – Graphical Symbol
The following diagram demonstrates the construction of a bus system with three-state buffers.
Fig 4 – Bus line with three state buffer
- The outputs generated by the four buffers are connected to form a single bus line.
- Only one buffer can be in active state at a given point of time.
- The control inputs to the buffers determine which of the four normal inputs will communicate with the bus line.
- A 2 * 4 decoder ensures that no more than one control input is active at any given point of time.
Most of the standard notations used for specifying operations on memory transfer are stated below.
- The transfer of information from a memory unit to the user end is called a Read operation.
- The transfer of new information to be stored in the memory is called a Write operation.
- A memory word is designated by the letter M.
- We must specify the address of memory word while writing the memory transfer operations.
- The address register is designated by AR and the data register by DR.
- Thus, a read operation can be stated as:
- Read: DR ← M [AR]
- The Read statement causes a transfer of information into the data register (DR) from the memory word (M) selected by the address register (AR).
- And the corresponding write operation can be stated as:
- Write: M [AR] ← R1
- The Write statement causes a transfer of information from register R1 into the memory word (M) selected by address register (AR).
Fig 5 – Memory unit
Key takeaways
- A digital system composed of many registers, and paths must be provided to transfer information from one register to another. The number of wires connecting all of the registers will be excessive if separate lines are used between each register and all other registers in the system.
- A bus structure, on the other hand, is more efficient for transferring information between registers in a multi-register configuration system.
- A bus consists of a set of common lines, one for each bit of register, through which binary information is transferred one at a time. Control signals determine which register is selected by the bus during a particular register transfer.
Computer performance is the amount of work accomplished by a computer system. The word performance in computer performance means “How well is the computer doing the work it is supposed to do?”. It basically depends on response time, throughput and execution time of a computer system.
Response time is the time from start to completion of a task. This also includes:
- Operating system overhead.
- Waiting for I/O and other processes
- Accessing disk and memory
- Time spent executing on the CPU or execution time.
Throughput is the total amount of work done in a given time.
CPU execution time is the total time a CPU spends computing on a given task. It also excludes time for I/O or running other programs. This is also referred to as simply CPU time.
Performance is determined by execution time as performance is inversely proportional to execution time.
Performance = (1 / Execution time) And, (Performance of A / Performance of B) = (Execution Time of B / Execution Time of A) |
If given that Processor A is faster than processor B, that means execution time of A is less than that of execution time of B. Therefore, performance of A is greater than that of performance of B.
Example –
Machine A runs a program in 100 seconds, Machine B runs the same program in 125 seconds (Performance of A / Performance of B) = (Execution Time of B / Execution Time of A) = 125 / 100 = 1.25 That means machine A is 1.25 times faster than Machine B. And, the time to execute a given program can be computed as: Execution time = CPU clock cycles x clock cycle time Since clock cycle time and clock rate are reciprocals, so, Execution time = CPU clock cycles / clock rate The number of CPU clock cycles can be determined by, CPU clock cycles = (No. of instructions / Program) x (Clock cycles / Instruction) = Instruction Count x CPI Which gives, Execution time = Instruction Count x CPI x clock cycle time = Instruction Count x CPI / clock rate The units for CPU Execution time are: |
How to Improve Performance?
To improve performance, you can either:
- Decrease the CPI (clock cycles per instruction) by using new Hardware.
- Decrease the clock time or Increase clock rate by reducing propagation delays or by use pipelining.
- Decrease the number of required cycles or improve ISA or Compiler.
Key takeaways
- Computer performance is the amount of work accomplished by a computer system. The word performance in computer performance means “How well is the computer doing the work it is supposed to do?”. It basically depends on response time, throughput and execution time of a computer system.
- Response time is the time from start to completion of a task. This also includes:
- Operating system overhead.
- Waiting for I/O and other processes
- Accessing disk and memory
- Time spent executing on the CPU or execution time.
3. Throughput is the total amount of work done in a given time.
4. CPU execution time is the total time a CPU spends computing on a given task. It also excludes time for I/O or running other programs. This is also referred to as simply CPU time.
What is Clock Cycle of CPU?
You may know what is CPU in a computer. CPU is like a brain in a computer like a brain in a living kind. So, the speed of a computer is mostly depended on the speed of its CPU. Clock Cycle is referred to the speed of a CPU. The clock cycle is the amount of time between two Cycles. During a clock cycle, one or more instructions are processed. So, if a CPU can process a higher number of pulses per second, it will be able to process information at a high speed.
What is Clock Rate of CPU?
You may have seen in your CPU description that your CPU clock speed is 1-3 GHz. Have you wondered what does that mean? Actually, it is your CPU’s clock rate. Clock rate means the number of pulses generated by CPU in one second. It is generally measured in MHz (Megahertz) or GHz (Gigahertz). Today’s computers generally run at a clock rate having more than one Gigahertz. Generally, clock speed or clock rate is determined by a quartz-crystal circuit.
History of Clock Speed in CPU
If you look back to 1980, you will find that Intel 8088 processor was quite popular at that time. You will be surprised to know that this CPU has only a clock speed of 4.77 MHz. CPU clock speed then started doubling every year. Today, if you buy a cheap computer, it will have a CPU that has a clock speed of at least 1 GHz. Nowadays, a CPU having a clock speed of around 3 GHz is so common.
How Does Clock Speed Affect the CPU PERFORMANCE?
Think of your brain. How do you determine the speed of a person’s brain? The fast he can think and decide determine the speed of his brain. It is same for CPU of a computer. The fast a CPU can process instructions, the faster the CPU. CPU’s clock rate determines how fast a CPU can work. The speed of a CPU is the rate at which a CPU can complete a processing cycle. You know about the clock cycle.
Suppose, your CPU’s clock rate is 1 GHz. If your friend has a CPU which clock rate is 2 GHz, then your friend’s CPU’s clock speed is twice of your CPU’s. But it cannot be said that the 2 GHz CPU is two times faster than the 1 GHz CPU. It depends on many things including computer architecture. Suppose, the 2 GHz CPU can complete an instruction in 4 Cycles and the 1GHz CPU needs 6 Cycles to complete the same instruction then the 2 GHz CPU will perform the same operation more than two times faster than the 1 GHz CPU.
If the situation is opposite, that means, the 2 GHz CPU needs more cycles than the 1 GHz CPU to perform the same operation, then the 2 GHz CPU will work less than 2x fast than the 1 GHz CPU.
Other Factors That Determine the Performance of a Computer
Computer performance depends on the processing speed of a computer. The Clock speed cannot determine the processing speed of a computer. It is one measure of computer power. Suppose, you have only doubled the clock speed, will your CPU work two times faster than before? The answer is, no. It depends on many other things. The performance of a CPU depends on
- The type of microprocessor
- The bus architecture
- The nature of the instructions set
- The amount of Random Access Memory (RAM) etcetera
Some processors can execute only one instruction during a clock cycle. Most of the today’s CPUs can execute more than one instruction per clock cycle. So, the CPUs that can complete more instructions per cycle than others will work faster. In the same way, the computer with a 64-bit bus architecture will work faster than the computer work in a 32-bit bus architecture. So, you cannot find any simplistic or universal relation among clock speed, bus architecture.
Clock rate formula
CPU clock rate formula can be determined in many ways. Here we will talk about two formulas to determine the performance of a CPU. To understand that you have to know about instructions, CPI, Clock cycle time, Clock rate. You have known all these from previous sections of this article except CPI.
CPI: You have known about Clocks and instructions. CPI stands for Clocks per Instructions. That means, how many clocks are needed to complete an instruction.
Equations:
CPU Time = I * T * CPI Here, I = Total number instructions in a program CPI = Clocks needed to complete an instruction T = Clock cycle time CPU Time = I * CPI/R Here, R = Clock rate which can be measured by the inverse of Clock cycle time that means, R = 1/T Note: T or R are generally measured for knowing the performance of a processor. I require special profiling software. CPI depends on many other factors such as RAM, computer architecture etcetera. |
Fastest CPU Clock Speed
It is a difficult thing to say about the fastest clock speed. Because clock speed is depended on many things including cooling process, motherboard etcetera. Again, overlocking of a CPU can give higher clock speed. Vendors including AMD, Intel are manufacturing CPU having a clock speed of above 8 GHz. The clock speed of 8722.78 MHz was recorded as the world’s fastest clock speed until this article was written. The CPU is AMD FX-8370. The user of this CPU was The Stilt and liquid nitrogen cooling system was used.
Note: We haven’t discussed the clock speed of CPUs that are used in supercomputers.
Multi-Cores vs Multi-Processors
Before 2005, all processors on the market had a single core. So, clock speed was the main scale to measure the performance of a CPU. But nowadays, processors with multi-cores are common. Even a very cheap laptop nowadays comes with at least two or three cores. Even processors with multiple processors are becoming available. Each processor in the processor has multiple cores too.
Multi-core processors became popular because a processor having a single core cannot be given too much clock speed because of technological limitations. A core of a processor is a single processing unit. So, a multi-core processor has multiple processing units. A 2.0 GHz dual-core processor has two processing unit each having 2.0 GHz clock speed that comprising 4 GHz clock speed. So, a 5 core 2 GHz processor has a total clock speed of 10 GHz.
Clock Speed vs Cores
You now know the benefit of having a multi-core processor with a higher clock speed. But having too many cores with a higher clock speed is not possible most of the time because of the cost. So, it becomes difficult to choose a processor for buying. You can go for a processor having slower clock speed but many cores, or you can go for a processor having higher clock speed but fewer cores. To understand this matter, we are giving you pros and cons of these two possible choices.
Processor Having More Cores but Slower Clock Speed
- It will give more benefits to the applications that support multi-threading
- It is a cost-effective way of increasing performance
- This kind of processor can run more applications at once
- This kind of processors cannot give a higher single-threaded performance.
Processor Having Fewer Cores but Higher Clock Speed
- This kind of processors can give a higher single-threaded performance.
- Lower cost option
- It cannot give more benefits to the applications that support multi-threading
- Many cores are not available to split between applications
How to Check CPU Speed in Windows
There are many ways to check CPU speed/Clock rate on your computer. Among them, 4 best ways are given below:
- Right-click on This PC or my computer (It can be named differently in your PC) on the desktop. An options menu will be seen.
- Click on the properties. System properties will be seen in a new window.
Fig 6 - System Properties
You will find CPU type and core numbers and CPU speed here as well as other system information.
Fig 7 - System Info
- Press Windows key from the keyboard and type settings. Go to Settings.
Fig 8 - PC Settings
2. From the settings window, click on System.
Fig 9 - System Settings
3. Click on About.
Fig 10 - Settings Option
In this window, you will find the CPU information including Click speed.
Fig 11 - Processor Info
- Press Windows key + R on the keyboard. The run application will be opened.
Fig 12 - msinfo32
2. Type msinfo32 on the text field and then click on OK.
Fig 13 - CPU Info
- Press Windows key + R on the keyboard. The run application will be opened.
Fig 14 - dxdiag
2. Type Dxdiag on the text field and then click on OK.
Fig 15 - Processor Info
Summing up
Clock rate means the number of pulses generated by CPU in one second. CPU’s performance most of the time depends on the clock rate of a CPU. To understand all the things that are responsible for the performance of a computer, you must have a better idea about the clock rate of a CPU. What are clock rate and its effects on computer performance?
Key takeaways
- You may know what is CPU in a computer. CPU is like a brain in a computer like a brain in a living kind. So, the speed of a computer is mostly depended on the speed of its CPU. Clock Cycle is referred to the speed of a CPU. The clock cycle is the amount of time between two Cycles. During a clock cycle, one or more instructions are processed. So, if a CPU can process a higher number of pulses per second, it will be able to process information at a high speed.
When you look at the computer engineering methodology you have technology trends that happen and various improvements that happen with respect to technology and this will give rise to newer and newer architectures. You have to evaluate the existing systems for bottlenecks and then try to come up with better architectures and this process continues. While evaluating the existing systems for bottlenecks, you will have to have certain metrics and certain benchmarks based on which you’ll have the evaluation done.
You should basically be able to
- measure performance
- report performance and
- Summarise performance.
These steps are necessary because that’ll help you make intelligent choices about the computer systems that you want to purchase. It will help you see through the marketing hype – there is so much of hype happening about computer systems and unless you have some basics about the performance of computer systems you will not be able to manage this and you will not be able to make a judicious choice when purchasing systems. Understanding performance measures is also a key to understanding the underlying organizational motivation, based on what factors people try to bring these modifications, so that performance will be improved. You will be able to understand the motivational aspects based on which certain innovations were brought in. While discussing about performance, you should be able to answer some questions like this:
- Why is some hardware better than others for different programs?
- What factors of system performance is hardware related? (e.g., do we need a new machine, or a new operating system?)
- How does the machine’s instruction set affect performance?
Performance is important both from the purchasing perspective and the designer’s perspective. When you look at the purchasing perspective, given a collection of machines, you’ll have to be able to decide which has the best performance, the least cost, and also the best cost per performance ratio. Similarly, from a designer’s perspective, you are faced with several design options like which has the best performance improvement, least cost and best cost/performance. Unless you have some idea about the performance metrics, you will not be able to decide which will be the best performance improvement that you can think of and which will lead to least cost and which will give you the best cost performance ratio. So, whether you’re looking at the designer’s perspective or purchaser’s perspective, both of them need to have some knowledge about the performance metrics and both require these performance metrics for comparison.
Our goal is to understand what factors in the architecture contribute to the overall system performance and the relative importance and cost of these factors. Performance means different things to different people. Say, for example, take an analogy from the airline industry. If you have to choose between different types of aircrafts, what the various factors that you’ll have to consider? Do you have to worry only about the cruising speed – how fast the craft flies, or do you have to worry about how far the car craft will fly – the flight range., or look at how big these aircrafts are and how many people can be transported at one point of time from one place to another place. So these are different factors that need to be considered and you cannot expect a particular aircraft to satisfy all these requirements. You’ll have to decide which one is more important than the other factors. All three factors are important, no doubt about it, but all three of them may not be equally important – you may have more importance to certain factors compared to other factors. The criteria of performance evaluation differ among the users and designers. The same holds good when you’re looking at a computer industry also. You have different classes of computer systems and you may have certain performance criteria which are important for certain types of applications, whereas they may not be so important for other types of applications. You should be able to decide which is important for which type of processor. You’ll have to be aware of the fact that you should never let an engineer get away with simply presenting the data – you always should insist that he or she should lead off with the conclusions to which the data led, to justify the reasons why you get these data. Only when you are able to understand the internal architecture of the processor, you’ll be able to make a judicious choice.
There are different things that affect the performance of a computer system. The instructions that you use and the implementation of these instructions, the memory hierarchy, the way the I/O is handled – all this may contribute to your performance. The primary factor when you’re looking at computer performance is time. All of us are worried about how fast the program executes. So the most important performance factor is the time. When you’re looking at time being the most important factor, are you looking at response time, or are you looking at something else? What we mean by response time is the latency – you ask the processor to execute a particular task and how fast you get a response from the processor – that is basically what is called the response time.
- How long does it take for my job to run?
- How long does it take to execute a job?
- How long must I wait for the database query?
The other important time factor is throughput. It is the total amount of work done in a given time.
- How many jobs can the machine run at once?
- What is the average execution rate?
- How much work is getting done?
Response time (execution time) – the time between the start and the completion of a task is important to individual users. Throughput (bandwidth) – the total amount of work done in a given time is important to data center managers. We will need different performance metrics as well as a different set of applications to benchmark embedded and desktop computers, which are more focused on response time, versus servers, which are more focused on throughput
If we have to maximize performance, we obviously need to minimize our execution time. Performance is inversely related to execution time.
Performance = 1/ Execution time If a processor X is n times faster than Y, then, Decreasing response time almost always improves throughput. As an example, If computer A runs a program in 10 seconds and computer B runs the same program in 20 seconds, how much faster is A than B? Speedup of A over B = 20 /10 = 2, indicating A is two times faster than B. |
Execution time is the time the CPU spends working on the task, it does not include the time waiting for I/O or running other programs. You know the processor does not run only your program, it may be running other programs also and when there is an I/O transfer, it may block this program and then switch over to a different program. We don’t consider the time taken for doing the I/O operations and always only worried about the CPU execution time. That is the time that the CPU spends on a particular program.
To determine the CPU execution time for a program, you can find out the total number of clock cycles that the program takes and multiply it by the clock cycle time. Each program is made up of a number of instructions and each instruction takes a number of clock cycles to execute. If you find out the total number of clock cycles per program and if you know the clock cycle time for each of these clock cycles, then the CPU execution times can simply be calculated as the product of the total number of CPU clock cycles per program and these clock cycle. Because of the clock cycle time and clock rate being inversely related, this can also be written as CPU clock cycles for a program divided by the clock rate.
Since the CPU execution time is a product of these two factors, you can improve performance by either reducing the length of the clock cycle time or by the number of clock cycles required for a program. A clock cycle is the basic unit of time to execute one operation/pipeline stage/etc. The clock rate (clock cycles per second in MHz or GHz) is inverse of clock cycle time (clock period) CC = 1 / CR.
The clock rate basically depends on the specific CPU organization, whether it is pipelined or non-pipelined, the hardware implementation technology – the VLSI technology that is used. A 10 ns clock cycle relates to 100 MHz clock rate, a 5 ns clock cycle relates to 200 MHz clock rates and so on. If you’re looking at a 250 ps clock cycle, then it corresponds to 4 GHz clock rate. The higher the clock frequency, the lower is your clock cycle.
As an example, consider the following problem:
A program runs on computer A with a 2 GHz clock in 10 seconds. What clock rate must a computer B run at to run this program in 6 seconds? Unfortunately, to accomplish this, computer B will require 1.2 times as many clock cycles as computer A to run the program.
You find that the second processor should run at a clock rate of 4 GHz if you want to finish the program a little earlier.
When you have to find out the total execution time in terms of the total number of clock cycles multiplied by the clock cycle period, you have a problem of calculating the total number of clock cycles. Not all instructions take the same amount of time to execute – say you’ll have to know the number of clock cycles that each instruction takes and you should be able to add up all these clock cycles to find out the total number of clock cycles. One way to think about execution time is that it equals the number of instructions multiplied by the average time per instruction. Somehow, if we find out the average time per instruction, we should be able to calculate the execution time. A computer machine (ISA) instruction is comprised of a number of elementary or micro-operations which vary in number and complexity depending on the instruction and the exact CPU organization (Design). A micro-operation is an elementary hardware operation that can be performed during one CPU clock cycle. This corresponds to one micro-instruction in microprogrammed CPUs. Examples: register operations: shift, load, clear, increment, ALU operations: add, subtract, etc. Thus, a single machine instruction may take one or more CPU cycles to complete termed as the Cycles Per Instruction (CPI). Average (or effective) CPI of a program: The average CPI of all instructions executed in the program on a given CPU design.
Example problem:
- Computers A and B implement the same ISA. Computer A has a clock cycle time of 250 ps and an effective CPI of 2.0 for some program and computer B has a clock cycle time of 500 ps and an effective CPI of 1.2 for the same program. Which computer is faster and by how much?
Each computer executes the same number of instructions, I, so
Computing the overall effective CPI is done by looking at the different types of instructions and their individual cycle counts and averaging.
|
where ICi is the count (percentage) of the number of instructions of class i executed, CPIi is the (average) number of clock cycles per instruction for that instruction class and n is the number of instruction classes.
The overall effective CPI varies by instruction mix – is a measure of the dynamic frequency of instructions across one or many programs.
How much faster would the machine be if a better data cache reduced the average load time to 2 cycles?
– Load à 20% x 2 cycles = .4 – Total CPI 2.2 à 1.6 – Relative performance is 2.2 / 1.6 = 1.38 How does this compare with reducing the branch instruction to 1 cycle? – Branch à 20% x 1 cycle = .2 – Total CPI 2.2 à 2.0 – Relative performance is 2.2 / 2.0 = 1.1 |
These equations separate the three key factors that affect performance
- Can measure the CPU execution time by running the program
- The clock rate is usually given
- Can measure overall instruction count by using profilers/ simulators without knowing all of the implementation details
- CPI varies by instruction type and ISA implementation for which we must know the implementation details
To conclude, if you look at the aspects of the CPU execution time, you have three factors which affect the CPU execution time – the clock cycle time, the average number of clock cycles per instruction which is your CPI value and the instruction count. The various factors that affect these three parameters are:
- Instruction count is affected by different factors – depends on the way the program is written, if you are a skilled programmer, you use a crisp algorithm and you code it appropriately, then it is going to use less number of instructions. So, the first thing depends upon the algorithm that you want to use and the skill of the programmer who writes this code. The second thing is once you’ve written a code, the compiler is responsible for translating these instructions into your machine instructions. The compiler should be an optimizing compiler so that it translates this code into fewer number of machine instructions. The compiler definitely has a role to play in reducing the instruction count, but remember the compiler can only use the instructions that are supported in your instruction set architecture. So the instruction set architecture also plays a role in reducing the instruction count. In the previous session, we’ve looked at how the same operation can be implemented as different sequences of instructions depending upon the ISA. So with the help of the ISA, the compiler will be able to generate code which uses less number of machine instructions.
- Clock cycle time depends upon the CPU organization and also depends upon the technology that is used. By organization, we mean whether the instruction unit is implemented as a pipelined unit or a non-pipelined unit. Pipelining facilitates multi cycle operations, which reduce the clock cycle time. This will be dealt with in detail in the subsequent modules.
- CPI, which is the average number of clock cycles per instruction, depends upon the program used because you may use complicated instructions which have a number of elementary operations or simple instructions. Similarly, the compiler may translate the program using complicated instructions instead of using simpler instructions. So, the compiler may also have a role to play, and because the compiler is only using the instructions in your ISA, the ISA definitely has a role to play. Finally, the CPU organization has also a role to play in deciding the CPI values.
Having identified the various parameters that will affect the three factors constituting the CPU performance equation, computer designers should strive to take appropriate design measures to reduce these factors, thereby reducing the execution time and thus improving performance.
To summarize, we’ve looked at how we could define the performance of a processor and why performance is necessary for a computer system. We have pointed out different performance metrics, looked at the CPU performance equation and the factors that affect the CPU performance equation. This module also provided different examples which illustrate the calculation of the CPU execution time using the CPU performance equation.
Key takeaways
- When you look at the computer engineering methodology you have technology trends that happen and various improvements that happen with respect to technology and this will give rise to newer and newer architectures. You have to evaluate the existing systems for bottlenecks and then try to come up with better architectures and this process continues. While evaluating the existing systems for bottlenecks, you will have to have certain metrics and certain benchmarks based on which you’ll have the evaluation done.
Computer architecture has been defined in a number of ways by different authors. Amdahl, Blaauw and Brooks, for example, the designers of the IBM/360 architecture, used the term to "describe the attributes of a system as seen by the programmer, i.e., the conceptual structure and functional behaviour, as distinct from the organisation of the data flow and controls, the logical design and the physical implementation." Stone, on the other hand, states that "the study of computer architecture is the study of the organisation and interconnection of components of computer systems." The material presented here is better described by this wider definition, but is particularly concerned with ways in which the hardware of a computer can be organised so as to maximise performance, as measured by, for example, average instruction execution time. Thus, the architects of high-performance systems seek techniques whereby judicious use of increased cost and complexity in the hardware will give a significant increase in overall system performance. The material is presented from a historical perspective, i.e. most of the examples describe relevant parts of the computer in which the mechanism was first introduced. Manifestations of most of these techniques can be found in modern processors and computer systems.
Key takeaway
- Computer architecture has been defined in a number of ways by different authors. Amdahl, Blaauw and Brooks, for example, the designers of the IBM/360 architecture, used the term to "describe the attributes of a system as seen by the programmer, i.e., the conceptual structure and functional behaviour, as distinct from the organisation of the data flow and controls, the logical design and the physical implementation.
Machine Instructions are commands or programs written in machine code of a machine (computer) that it can recognize and execute.
- A machine instruction consists of several bytes in memory that tells the processor to perform one machine operation.
- The processor looks at machine instructions in main memory one after another, and performs one machine operation for each machine instruction.
- The collection of machine instructions in main memory is called a machine language program.
Machine code or machine language is a set of instructions executed directly by a computer’s central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory. Every program directly executed by a CPU is made up of a series of such instructions.
The general format of a machine instruction is
[Label:] Mnemonic [Operand, Operand] [; Comments] |
- Brackets indicate that a field is optional
- Label is an identifier that is assigned the address of the first byte of the instruction in which it appears. It must be followed by “:”
- Inclusion of spaces is arbitrary, except that at least one space must be inserted; no space would lead to an ambiguity.
- Comment field begins with a semicolon “ ; ”
Example:
Here: MOV R5, #25H ; load 25H into R5 |
Machine instructions used in 8086 microprocessor
1. Data transfer instructions– move, load exchange, input, output.
- MOV :Move byte or word to register or memory .
- IN, OUT: Input byte or word from port, output word to port.
- LEA: Load effective address
- LDS, LES Load pointer using data segment, extra segment.
- PUSH, POP: Push word onto stack, pop word off stack.
- XCHG: Exchange byte or word.
- XLAT: Translate byte using look-up table.
2. Arithmetic instructions – add, subtract, increment, decrement, convert byte/word and compare.
- ADD, SUB: Add, subtract byte or word
- ADC, SBB: Add, subtract byte or word and carry (borrow).
- INC, DEC: Increment, decrement byte or word.
- NEG: Negate byte or word (two’s complement).
- CMP: Compare byte or word (subtract without storing).
- MUL, DIV: Multiply, divide byte or word (unsigned).
- IMUL, IDIV: Integer multiply, divide byte or word (signed)
- CBW, CWD: Convert byte to word, word to double word
- AAA, AAS, AAM,AAD: ASCII adjust for add, sub, mul, div .
- DAA, DAS: Decimal adjust for addition, subtraction (BCD numbers)
3. Logic instructions – AND, OR, exclusive OR, shift/rotate and test
- NOT: Logical NOT of byte or word (one’s complement)
- AND: Logical AND of byte or word
- OR: Logical OR of byte or word.
- XOR: Logical exclusive-OR of byte or word
- TEST: Test byte or word (AND without storing).
- SHL, SHR: Logical Shift rotate instruction shift left, right byte or word? by 1or CL
- SAL, SAR: Arithmetic shift left, right byte or word? by 1 or CL
- ROL, ROR: Rotate left, right byte or word? by 1 or CL .
- RCL, RCR: Rotate left, right through carry byte or word? by 1 or CL.
4. String manipulation instruction – load, store, move, compare and scan for byte/word
- MOVS: Move byte or word string
- MOVSB, MOVSW: Move byte, word string.
- CMPS: Compare byte or word string.
- SCAS S: can byte or word string (comparing to A or AX)
- LODS, STOS: Load, store byte or word string to AL.
5. Control transfer instructions – conditional, unconditional, call subroutine and return from subroutine.
- JMP: Unconditional jump .it includes loop transfer and subroutine and interrupt instructions.
- JNZ: jump till the counter value decreases to zero. It runs the loop till the value stored in CX becomes zero
6. Loop control instructions-
- LOOP: Loop unconditional, count in CX, short jump to target address.
- LOOPE (LOOPZ): Loop if equal (zero), count in CX, short jump to target address.
- LOOPNE (LOOPNZ): Loop if not equal (not zero), count in CX, short jump to target address.
- JCXZ: Jump if CX equals zero (used to skip code in loop).
- Subroutine and Intrrupt instructions-
- CALL, RET: Call, return from procedure (inside or outside current segment).
- INT, INTO: Software interrupt, interrupt if overflow. IRET: Return from interrupt.
7. Processor control instructions-
Flag manipulation:
- STC, CLC, CMC: Set, clear, complement carry flag.
- STD, CLD: Set, clear direction flag.STI, CLI: Set, clear interrupt enable flag.
- PUSHF, POPF: Push flags onto stack, pop flags off stack.
Key takeaways
- Machine Instructions are commands or programs written in machine code of a machine (computer) that it can recognize and execute.
- A machine instruction consists of several bytes in memory that tells the processor to perform one machine operation.
- The processor looks at machine instructions in main memory one after another, and performs one machine operation for each machine instruction.
- The collection of machine instructions in main memory is called a machine language program.
MEMORY-LOCATIONS & ADDRESSES
- Memory consists of many millions of storage cells (flip-flops).
- Each cell can store a bit of information i.e. 0 or 1 (Figure).
- Each group of n bits is referred to as a word of information, and n is called the word length.
- The word length can vary from 8 to 64 bits.
- A unit of 8 bits is called a byte.
- Accessing the memory to store or retrieve a single item of information (word/byte) requires distinct addresses for each item location. (It is customary to use numbers from 0 through 2ˆk-1 as the addresses of successive-locations in the memory).
• If 2ˆk = no. of addressable locations; then 2ˆk addresses constitute the address-space of the computer. For example, a 24-bit address generates an address-space of 2ˆ24 locations (16 MB).
Fig 16 – Memory words Fig 17 - Example |
BYTE-ADDRESSABILITY
- A byte is always 8 bits, but the word length typically ranges from 16 to 64 bits.
- In byte-addressable memory, successive addresses refer to successive byte locations in the memory.
- Byte locations have addresses 0, 1, 2. . . . .
- If the word-length is 32 bits, successive words are located at addresses 0, 4, 8. . with each word having 4 bytes.
Key takeaways
1. Memory consists of many millions of storage cells (flip-flops).
2. Each cell can store a bit of information i.e. 0 or 1 (Figure).
3. Each group of n bits is referred to as a word of information, and n is called the word length.
4. The word length can vary from 8 to 64 bits.
5. A unit of 8 bits is called a byte.
6. Accessing the memory to store or retrieve a single item of information (word/byte) requires distinct addresses for each item location. (It is customary to use numbers from 0 through 2ˆk-1 as the addresses of successive-locations in the memory).
7. If 2ˆk = no. of addressable locations;
then 2ˆk addresses constitute the address-space of the computer.
For example, a 24-bit address generates an address-space of 2ˆ24 locations (16 MB).
A memory unit stores binary information in groups of bits called words. Data input lines provide the information to be stored into the memory, Data output lines carry the information out from the memory. The control lines Read and write specifies the direction of transfer of data. Basically, in the memory organization, there are memory locations indexing from 0 to where l is the address buses. We can describe the memory in terms of the bytes using the following formula:
Where,
l is the total address buses
N is the memory in bytes
For example, some storage can be described below in terms of bytes using the above formula:
1kB= 210 Bytes 64 kB = 26 x 210 Bytes = 216 Bytes 4 GB = 22 x 210(kB) x 210(MB) x 210 (GB) = 232 Bytes |
Memory Address Register (MAR) is the address register which is used to store the address of the memory location where the operation is being performed.
Memory Data Register (MDR) is the data register which is used to store the data on which the operation is being performed.
- Memory Read Operation:
Memory read operation transfers the desired word to address lines and activates the read control line. Description of memory read operation is given below:
Fig 18 – Memory read operation
In the above diagram initially, MDR can contain any garbage value and MAR is containing 2003 memory address. After the execution of read instruction, the data of memory location 2003 will be read and the MDR will get updated by the value of the 2003 memory location (3D).
2. Memory Write Operation:
Memory write operation transfers the address of the desired word to the address lines, transfers the data bits to be stored in memory to the data input lines. Then it activates the write control line. Description of the write operation is given below:
Fig 19 – Memory write operation
In the above diagram, the MAR contains 2003 and MDR contains 3D. After the execution of write instruction 3D will be written at 2003 memory location.
Key takeaway
1. A memory unit stores binary information in groups of bits called words. Data input lines provide the information to be stored into the memory, Data output lines carry the information out from the memory. The control lines Read and write specifies the direction of transfer of data. Basically, in the memory organization, there are memory locations indexing from 0 to where l is the address buses. We can describe the memory in terms of the bytes using the following formula:
Where,
l is the total address buses, N is the memory in bytes
Four types of operations
- Data transfer between memory and processor registers.
- Arithmetic & logic operations on data
- Program sequencing & control
- I/O transfers.
1) Register transfer notations (RTN)
R3<–[R1]+[R2]
- Right hand side of RTN-denotes a value.
- Left hand side of RTN-name of a location.
2) Assembly language notations (ALN)
Add R1, R2, R3
- Adding contents of R1, R2 & place sum in R3.
3) Basic instruction types-4 types
- Three address instructions– Add A, B, C
A, B-source operands
C-destination operands
- Two address instructions-Add A,B
B <–[A] + [B]
- One address instructions –Add A
Add contents of A to accumulator & store sum back to accumulator.
- Zero address instructions
Instruction store operands in a structure called push down stack.
4) Instruction execution & straight line sequencing
- The processor control circuits use information in PC to fetch & execute instructions one at a time in order of increasing address.
- This is called straight line sequencing.
- Executing an instruction-2 phase procedures.
- 1st phase–“instruction fetch”-instruction is fetched from memory location whose address is in PC.
- This instruction is placed in instruction register in processor
- 2nd phase-“instruction execute”-instruction in IR is examined to determine which operation to be performed.
5) Branching
- Branch-type of instruction loads a new value into program counter.
- So processor fetches & executes instruction at this new address called “branch target”
- Conditional branch-causes a branch if a specified condition is satisfied.
- E.g. Branch>0 LOOP –conditional branch instruction .it executes only if it satisfies condition.
6) Condition codes
- Recording required information in individual bits called “condition code flags”.
- These flags are grouped together in a special processor register called “condition code register” or “status register”
- Individual condition code flags-1 or 0.
- 4 commonly used flags.
1) N (negative)-set to 1 if result is –ve or else 0.
2) Z (zero)-set to 1 if result is 0, or else 0 .
3) V (overflow)-set to 1if arithmetic overflow occurs or else 0.
4) C(carry)-set to 1 if carry out results from operation or else 0
Key takeaways
- Four types of operations
- Data transfer between memory and processor registers.
- Arithmetic & logic operations on data
- Program sequencing & control
- I/O transfers.
References
1. William Stallings: Computer Organization & Architecture, 7th Edition, PHI, 2006.
2. Vincent P. Heuring & Harry F. Jordan: Computer Systems Design and Architecture, 2 nd Edition, Pearson Education, 2004.