Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Unit 3rd computer architecture and organization, Study notes of Computer Architecture and Organization

Unit 3rd computer architecture and organization

Typology: Study notes

2023/2024

Available from 06/08/2025

anshuman-bishnoi
anshuman-bishnoi 🇮🇳

5 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UNIT 3
Central Processing Unit : Introduction, General Register organization, Stack Organisation,
Instruction Formats, Addressing Modes, Data transfer and manipulation, Program
Control.
Central Processing Unit :
The full form of CPU is Central Processing Unit . It is a brain of the computer. All types of data
processing operations and all the important functions of a computer are performed by the CPU. It
helps input and output devices to communicate with each other and perform their respective
operations. It also stores data which is input, intermediate results in between processing, and
instructions.
What is a CPU?
A Central Processing Unit is the most important component of acomputer system. A CPU is a
hardware that performs data input/output, processing and storage functions for a computer
system. A CPU can be installed into a CPU socket. These sockets are generally located on the
motherboard. CPU can perform various data processing operations. CPU can store data,
instructions, programs, and intermediate results.
History of CPU
Since 1823, when Baron Jons Jakob Berzelius discovered silicon, which is still the primary
component used in the manufacture of CPUs today, the history of the CPU has experienced
numerous significant turning points. The first transistor was created by John Bardeen, Walter
Brattain, and William Shockley in December 1947. in 1958, the first working integrated circuit
was built by Robert Noyce and Jack Kilby.
The Intel 4004 was the company’s first microprocessor, which it unveiled in 1971. Ted Hoff’s
assistance was needed for this. When Intel released its 8008 CPU in 1972, Intel 8086 in 1976,
and Intel 8088 in June 1979, it contributed to yet another win. The Motorola 68000, a 16/32-bit
processor, was also released in 1979. The Sun also unveiled the SPARC CPU in 1987. AMD
unveiled the AM386 CPU series in March 1991.
In January 1999, Intel introduced the Celeron 366 MHZ and 400 MHz processors. AMD back in
April 2005 with it’s first dual-core processor. Intel also introduced the Core 2 Dual processor in
2006. Intel released the first Core i5 desktop processor with four cores in September 2009.
In January 2010, Intel released other processors like Core 2 Quad processor Q9500, the first
Core i3 and i5 mobile processors, first Core i3 and i5 desktop processors.
In June 2017, Intel released Core i9 desktop processor, and Intel introduced its first Core i9
mobile processor In April 2018.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Unit 3rd computer architecture and organization and more Study notes Computer Architecture and Organization in PDF only on Docsity!

UNIT 3

Central Processing Unit : Introduction, General Register organization, Stack Organisation, Instruction Formats, Addressing Modes, Data transfer and manipulation, Program Control. Central Processing Unit : The full form of CPU is Central Processing Unit. It is a brain of the computer. All types of data processing operations and all the important functions of a computer are performed by the CPU. It helps input and output devices to communicate with each other and perform their respective operations. It also stores data which is input, intermediate results in between processing, and instructions. What is a CPU? A Central Processing Unit is the most important component of a computer system. A CPU is a hardware that performs data input/output, processing and storage functions for a computer system. A CPU can be installed into a CPU socket. These sockets are generally located on the motherboard. CPU can perform various data processing operations. CPU can store data, instructions, programs, and intermediate results. History of CPU Since 1823, when Baron Jons Jakob Berzelius discovered silicon, which is still the primary component used in the manufacture of CPUs today, the history of the CPU has experienced numerous significant turning points. The first transistor was created by John Bardeen, Walter Brattain, and William Shockley in December 1947. in 1958, the first working integrated circuit was built by Robert Noyce and Jack Kilby. The Intel 4004 was the company’s first microprocessor, which it unveiled in 1971. Ted Hoff’s assistance was needed for this. When Intel released its 8008 CPU in 1972, Intel 8086 in 1976, and Intel 8088 in June 1979, it contributed to yet another win. The Motorola 68000, a 16/32-bit processor, was also released in 1979. The Sun also unveiled the SPARC CPU in 1987. AMD unveiled the AM386 CPU series in March 1991. In January 1999, Intel introduced the Celeron 366 MHZ and 400 MHz processors. AMD back in April 2005 with it’s first dual-core processor. Intel also introduced the Core 2 Dual processor in

  1. Intel released the first Core i5 desktop processor with four cores in September 2009. In January 2010, Intel released other processors like Core 2 Quad processor Q9500, the first Core i3 and i5 mobile processors, first Core i3 and i5 desktop processors. In June 2017, Intel released Core i9 desktop processor, and Intel introduced its first Core i mobile processor In April 2018.

Different Parts of CPU Now, the CPU consists of 3 major units, which are:

  1. Memory or Storage Unit
  2. Control Unit
  3. ALU(Arithmetic Logic Unit) Let us now look at the block diagram of the computer: Here, in this diagram, the three major components are also shown. So, let us discuss these major components: Memory or Storage Unit As the name suggests this unit can store instructions, data, and intermediate results. The memory unit is responsible for transferring information to other units of the computer when needed. It is also known as an internal storage unit or the main memory or the primary storage or Random Access Memory (RAM) as all these are storage devices. Its size affects speed, power, and performance. There are two types of memory in the computer, which are primary memory and secondary memory. Some main functions of memory units are listed below:  Data and instructions are stored in memory units which are required for processing.

Note: CPU may contain more than one ALU and it can be used for maintaining timers that help run the computer system. What Does a CPU Do? The main function of a computer processor is to execute instruction and produce an output. CPU work are Fetch, Decode and Execute are the fundamental functions of the computer.  Fetch: the first CPU gets the instruction. That means binary numbers that are passed from RAM to CPU.  Decode: When the instruction is entered into the CPU, it needs to decode the instructions. with the help of ALU(Arithmetic Logic Unit) the process of decode begins.  Execute: After decode step the instructions are ready to execute  Strore: After execute step the instructions are ready to store in the memory. Types of CPU We have three different types of CPU:  Single Core CPU: The oldest type of computer CPUs is single core CPU. These CPUs were used in the 1970s. these CPUs only have a single core that preform different operations. This means that the single core CPU can only process one operation at a single time. single core CPU CPU is not suitable for multitasking.  Dual-Core CPU: Dual-Core CPUs contain a single Integrated Circuit with two cores. Each core has its cache and controller. These controllers and cache are work as a single unit. dual core CPUs can work faster than the single-core processors.  Quad-Core CPU: Quad-Core CPUs contain two dual-core processors present within a single integrated circuit (IC) or chip. A quad-core processor contains a chip with four independent cores. These cores read and execute various instructions provided by the CPU. Quad Core CPU increases the overall speed for programs. Without even boosting the overall clock speed it results in higher performance. Registers In Computer Architecture, the Registers are very fast computer memory which is used to execute programs and operations efficiently. but In that scenario, registers serve as gates, sending signals to various components to carry out little tasks. Register signals are directed by the control unit, which also operates the registers. The following list of five registers for in-out signal data storage:

  1. Program Counter A program counter (PC) is a CPU register in the computer processor which has the address of the next instruction to be executed from memory. As each instruction gets fetched, the program counter increases its stored value by 1. It is a digital counter needed for faster execution of tasks as well as for tracking the current execution point.
  2. Instruction Register In computing, an instruction register (IR) is the part of a CPU’s control unit that holds the instruction currently being executed or decoded. The instruction register specifically holds the instruction and provides it to the instruction decoder circuit.
  3. Memory Address Register The Memory Address Register (MAR) is the CPU register that either stores the memory address from which data will be fetched from the CPU, or the address to which data will be sent and stored. It is a temporary storage component in the CPU(central processing unit) that temporarily stores the address (location) of the data sent by the memory unit until the instruction for the particular data is executed.
  4. Memory Data Register The memory data register (MDR) is the register in a computer’s processor, or central processing unit, CPU, that stores the data being transferred to and from the immediate access storage. Memory data register (MDR) is also known as memory buffer register (MBR).
  5. General Purpose Register General-purpose registers are used to store temporary data within the microprocessor. It is a multipurpose register. They can be used either by a programmer or by a user. General Register Organization When we are using multiple general-purpose registers, instead of a single accumulator register, in the CPU Organization then this type of organization is known as General register-based CPU Organization. In this type of organization, the computer uses two or three address fields in their instruction format. Each address field may specify a general register or a memory word. If many CPU registers are available for heavily used variables and intermediate results, we can avoid memory references much of the time, thus vastly increasing program execution speed, and reducing program size. For example: MULT R1, R2, R This is an instruction of an arithmetic multiplication written in assembly language. It uses three address fields R1, R2, and R3. The meaning of this instruction is: R1 <-- R2 * R

 Since a large number of registers are used, thus extra cost is required in this organization. General register CPU organization of two types:

  1. Register-memory reference architecture (CPU with less register) – In this organization Source 1 is always required in the register, source 2 can be present either in the register or in memory. Here two address instruction formats are compatible instruction formats.
  2. Register-register reference architecture (CPU with more register) – In this organization, ALU operations are performed only on registered data. So operands are required in the register. After manipulation, the result is also placed in a register. Here three address instruction formats are the compatible instruction format. Stack Organization – The computers which use Stack-based CPU Organization are based on a data structure called a stack. The stack is a list of data words. It uses the Last In First Out (LIFO) access method which is the most popular access method in most of the CPU. A register is used to store the address of the topmost element of the stack which is known as Stack pointer (SP). In this organization, ALU operations are performed on stack data. It means both the operands are always required on the stack. After manipulation, the result is placed in the stack. The main two operations that are performed on the operators of the stack are Push and Pop. These two operations are performed from one end only. 1. Push – This operation results in inserting one operand at the top of the stack and it increases the stack pointer register. The format of the PUSH instruction is: PUSH It inserts the data word at a specified address to the top of the stack. It can be implemented as: // Increment SP by 1 SP <-- SP + 1 //store the content of specified memory address //into SP; i.e, at top of stack SP <-- (memory address) 2. Pop – This operation results in deleting one operand from the top of the stack and decreasing the stack pointer register. The format of the POP instruction is:

POP

It deletes the data word at the top of the stack to the specified address. It can be implemented as: //transfer the content of SP (i.e, at top most data) //into specified memory location (memory address) <-- SP //Decrement SP by 1 SP <-- SP - 1 Operation type instruction does not need the address field in this CPU organization. This is because the operation is performed on the two operands that are on the top of the stack. For example: SUB This instruction contains the opcode only with no address field. It pops the two top data from the stack, subtracting the data, and pushing the result into the stack at the top. PDP-11, Intel’s 8085, and HP 3000 are some examples of stack-organized computers. The advantages of Stack-based CPU organization –  Efficient computation of complex arithmetic expressions.  Execution of instructions is fast because operand data are stored in consecutive memory locations.  The length of instruction is short as they do not have an address field. The disadvantages of Stack-based CPU organization –  The size of the program increases. Note: Stack-based CPU organization uses zero address instruction. Instruction Formats – Introduction: In computer organization, instruction formats refer to the way instructions are encoded and represented in machine language. There are several types of instruction formats, including zero, one, two, and three-address instructions. Here is a brief overview of each:

Postfixed : X = AB+CD+* TOP means top of stack M[X] is any memory location PUSH A TOP = A PUSH B TOP = B ADD TOP = A+B PUSH C TOP = C PUSH D TOP = D ADD TOP = C+D MUL TOP = (C+D)*(A+B)

PUSH A TOP = A

POP X M[X] = TOP

Advantages: They are simple and can be executed quickly since they do not require any operand fetching or addressing. They also take up less memory space. Disadvantages: They can be limited in their functionality and do not allow for much flexibility in terms of addressing modes or operand types.

  1. One Address Instructions – These instructions specify one operand or address, which typically refers to a memory location or register. The instruction operates on the contents of that operand, and the result may be stored in the same or a different location. For example, a one-address instruction might load the contents of a memory location into a register. This uses an implied ACCUMULATOR register for data manipulation. One operand is in the accumulator and the other is in the register or memory location. Implied means that the CPU already knows that one operand is in the accumulator so there is no need to specify it. Expression: X = (A+B)*(C+D) AC is accumulator M[] is any memory location M[T] is temporary location LOAD A AC = M[A] ADD B AC = AC + M[B] STORE T M[T] = AC

M[] is any memory location MOV R1, A R1 = M[A] ADD R1, B R1 = R1 + M[B] MOV R2, C R2 = M[C] ADD R2, D R2 = R2 + M[D] MUL R1, R2 R1 = R1 * R MOV X, R1 M[X] = R Advantages: They allow for more complex operations and can be more efficient than one- address instructions since they allow for two operands to be processed in a single instruction. They also allow for a wide range of addressing modes. Disadvantages: They require more memory space than one-address instructions and can be slower to execute since they require operand fetching and addressing.

  1. Three Address Instructions – These instructions specify three operands or addresses, which may be memory locations or registers. The instruction operates on the contents of all three operands, and the result may be stored in the same or a different location. For example, a three-address instruction might multiply the contents of two registers together and add the contents of a third register, storing the result in a fourth register. This has three address field to specify a register or a memory location. Program created are much short in size but number of bits per instruction increase. These instructions make creation of program much easier but it does not mean that program will run much faster because now instruction only contain more information but each micro operation (changing content of register, loading address in address bus etc.) will be performed in one cycle only.

Expression: X = (A+B)*(C+D) R1, R2 are registers M[] is any memory location ADD R1, A, B R1 = M[A] + M[B] ADD R2, C, D R2 = M[C] + M[D] MUL X, R1, R2 M[X] = R1 * R Advantages: They allow for even more complex operations and can be more efficient than two- address instructions since they allow for three operands to be processed in a single instruction. They also allow for a wide range of addressing modes. Disadvantages: They require even more memory space than two-address instructions and can be slower to execute since they require operand fetching and addressing. Overall, the choice of instruction format depends on the specific requirements of the computer architecture and the trade-offs between code size, execution time, and flexibility. Addressing Modes – For executing an instruction, data are required. These data may be present in the accumulator (AC) or stored in some location in the memory. There are various ways to specify the address of data or more precisely operands.These are known as addressing modes. The techniques for specifying the address of the operands are known as addressing modes. The address of an operand is known as the effective address. Some common addressing modes are listed below.

  1. Direct (or absolute) addressing : In this mode of addressing, the instruction contains the address of data (operand) in the memory. The operand will be present at some location in the memory and its address in memory is provided in the instruction itself. That is, the address field of the instruction contains the effective address. For example

Data Transfer and Manipulation:

What is Data Transfer? In computer architecture, data transfer refers to the movement of data between different components within a computer system. These components can include the central processing unit (CPU), memory, storage devices, and input/output (I/O) devices. Data transfer within a computer system occurs through the use of a bus, which is a set of communication lines that allow different components to communicate with each other. There are several types of data transfer that can occur within a computer system. These include:

  1. Memory transfer: This refers to the movement of data between the CPU and main memory (e.g., RAM). Memory transfer is an important part of the CPU's operation, as it allows the CPU to access and manipulate data stored in the memory.
  2. I/O transfer: This refers to the movement of data between the CPU and I/O devices, such as keyboards, mice, and printers.
  3. Storage transfer: This refers to the movement of data between the CPU and storage devices such as hard drives and solid-state drives.
  4. Inter-processor communication: This refers to the movement of data between different CPUs within a computer system such as in a multi-core processor or a cluster of computers. What is Data Manipulation? Data manipulation in computer architecture refers to the various operations that can be performed on data stored in a computer system. These operations may include sorting, filtering, merging and transforming data as well as extracting and summarizing data from large data sets. There are many different technique and tools that can be used to manipulate data in a computer system, including programming languages, databases and data processing frameworks. Some common data manipulation technique includes:  Sorting : Sorting data involves rearranging the records in a dataset based on the values of one or more fields. This can be useful for organizing data in a more logical or meaningful way or for making it easier to find specific records.  Filtering : Filtering data involves selecting only a subset of the records in a dataset based on certain criteria. This can be useful for isolating specific records that are of particular interest.

Merging : Merging data involves combining two or more datasets into a single dataset. This can be useful for combining data from different sources or for combining data from different time periods.  Transforming : Transforming data involves altering the values of one or more fields in a dataset. This can be useful for cleaning or standardization of data or for converting data from one format to another.  Extracting and Summarizing: Extracting and summarizing data involves selecting and summarizing specific data points from a larger dataset. This can be useful for generating reports or for creating more manageable datasets for further analysis. Steps for Data Manipulation There are several steps involved in data manipulation which may vary depending on the specific goals requirements of the task at hand. In general, the steps involved in data manipulation can include:

  1. Gathering data: The first step in data manipulation is often to gather the data that you will be working with. This may involve accessing data stored in a database, extracting data from a file or API or collecting data manually.  Cleaning and preprocessing data: Once you have gathered your data, the next step is often to clean and preprocess it. This may involve correcting errors, removing duplicate records or filling in missing values.  Transforming and manipulating data: After your data has been cleaned and preprocessed, you can begin to transfer and manipulate it as needed. This may involve sorting data, filtering records, merging datasets or converting data from one format to another.  Analyzing and visualizing data: Once you have transformed and manipulated your data, you can begin to analyze and visualize it. This may involve generating summary statistics, creating charts and graphs or performing more advanced statistical analysis.  Storing and organizing data: After you have finished manipulating and analyzing your data, it is important to store and organize it in a way that makes it easy to access and use in the future. This may involve saving data to a database or file system or creating a system for organizing and categorizing data. Program Control The CPU while executing a program normally executes the instructions sequentially, i.e. one after another. After executing an instruction the next instruction in squence is executed. The PC (Program Counter) is incremented each time to point to the next instruction in sequence.