0% found this document useful (0 votes)
16 views

XI-computer Notes Chapter 5

Chapter 5 covers fundamental concepts of computer architecture, including definitions of computer organization, design, and architecture, along with components of a computer such as input, processing, output, and memory units. It also explains memory addressing, registers in the CPU, types of buses, and computer instructions, detailing their formats and operations. The chapter concludes with an overview of stack data structures and their operations.

Uploaded by

jamil sulaiman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

XI-computer Notes Chapter 5

Chapter 5 covers fundamental concepts of computer architecture, including definitions of computer organization, design, and architecture, along with components of a computer such as input, processing, output, and memory units. It also explains memory addressing, registers in the CPU, types of buses, and computer instructions, detailing their formats and operations. The chapter concludes with an overview of stack data structures and their operations.

Uploaded by

jamil sulaiman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 5 (COMPUTER ARCHITECTURE)

Q1. What is computer organization, computer design and computer architecture?


Computer Organization:- Computer organization is the computer hardware components
operate and they are connected together to form the computer system.
Computer Design:-. Computer organization means to design the computer hardware. Once the
computer specifications are formulated, it is the task of the designer to develop hardware for the
system.
Computer Architecture:- Computer architecture is concerned with the structure and behavior of
the computer as seen by the user. It includes the information formats, the instruction set and
techniques for addressing memory. The architectural design of a computer system is concerned
with the specifications of the various functional modules, such as processors and memories and
structuring them together into a computer system

Q2. Define the components of a computer.


Ans. Cesomponents of computer are as under
Input Unit:- The input unit provides an interface between the users and the machine for
inputting data and instructions. The data in any form is first converted into binary form by the
input device. Example: keyboard, scanner, mic etc
Processing Unit:- The Central Processing Unit (CPU) containing with CU (control unit), ALU
(arithmetic logic unit) MU (memory unit like register etc), process data given data and give the
result on the output unit.
Output Unit:- Output Unit also provides an interface between user and machine. The output unit
receives data from the CPU in the form of binary bits, this is then converted into a desired form
graphical, audio, video or text etc understandable by user.
Memory Unit:- Memory is also called main memory RAM, primary or internal storage holds
data.

Q3. Define addressing of memory locations?


Ans. A memory address is a unique identifier used by a device or CPU for data tracking. This
binary address is defined by an ordered and finite sequence allowing the CPU to track the
location of each memory byte. Every piece of data that is stored in memory has its own unique
address, which can be used to access and manipulate the data. When a program is executed, the
operating system assigns memory addresses to different pieces of data, such as variables, arrays,
and other types of data structures. The group of n bit is termed as word where n is termed as
the word length. The word length of the computer has evolved from 8, 16, 24, 32 to 64 bits. For
example, a variable x that contains the value 5. When this variable is stored in memory, it will be
assigned a unique memory address, such as 2000. This memory address can then be used to
access and modify the value of x in program.
Modern computers are addressed by bytes which are assigned to memory addresses – binary
numbers assigned to a random access memory (RAM) cell that holds up to one byte. Data greater
than one byte is consecutively segmented into multiple bytes with a series of corresponding
addresses. Hardware devices and CPUs track stored data by accessing memory addresses via
data buses. Before CPU processing, data and programs must be stored in unique memory address
locations.
Q4. Define register. Describe various registers in CPU.
Ans. Register:- A register is a temporary storage device which holds data or instruction as long
as it is being manipulated or being interpreted. Each register within the CPU performs a specific
role. each register servers a particular purpose. Registers also differ from memory in that they are
not addressed as a memory location would be, but instead are manipulated directly by the control
unit during the execution of instructions. Registers may be as small as a single bit or as wider as
several bytes.

General Purpose Register:- The general purpose registers may be used for temporarily storing
data. These registers may be combined to form register pairs in order to handle larger size data.
Accumulator Register:- The Accumulator (AC) register is a general purpose processing
register. The Accumulator Register is mainly used to store the result of logical and arithmetic
operations.
Status Register:- The status register also called Flag register, hold I bit flag to indicate certain
condition that arise during arithmetic and logical operations. The important conditions shown by
flag or statues register are:
Carry flag (CF):-The answer can be 17 bits long when two 16-bit numbers are added. This extra
bit that does not fit into the destination register is placed in the carry flag, which can be used and
tested.
Zero flag (ZF):-The zero flag indicates whether the result is zero or nonzero.
Sign flag (SF):-A sign flag indicate whether the result is plus or minus.
Parity flag (PF):-A parity flag is a check bit that is added to a block of data for error detection
purposes. The value of the parity bit is assigned as either 0 or 1. Making the number of 1s in the
message block even or odd depends on the type of parity.
Interrupt flag (IF):-It tells the processor whether it can be interrupted externally. Sometimes
programmers do not want a particular task to be interrupted, so the interrupt flag can be set to
zero. Interrupts can be disabled or enabled by special instructions to set this bit to 0 or 1,
respectively.
Memory Buffer Register (MBR):This register is also known as the memory data
register(MDR). It is used to hold a word (a data value) that is being stored to or retrieved from
the memory location currently addressed by the memory address register.
The Memory Address Register (MAR):-The Address Register or AR hold the memory address
of the data that the CPU wants to read or write to.
Instruction Register(IR):- The instruction read from memory is placed in the Instruction
register (IR) The IR or Instruction Register holds the instruction that is currently in execution.
The CPU mainly uses IR to get the instruction, decode it and decide which operations have to be
performed to execute the instruction.
Program Counter:-The Program Counter (PC) hold the address of the next instruction to be
read from memory after the current instruction is executed. PC can be considered an important
part of the CPU’s instruction-fetching and execution cycle.
The Data Register:-As the name suggests the Data Register or DR is the register that stores the
data that is written to memory or read from memory.
The Temporary Register (TR):- It is used for holding the temporary data during the processing.
The intermediate result of the calculations is stored in these registers. It is refer to as the general-
purpose register. It can also be used to store the intermediate data between many calculations or
complex calculations.
The Input Registers (IR):- It holds the input characters given by the user. As the name suggests
the input register is used to store the input that is given to the CPU from an external device or
source like a mouse or keyboard. This is mainly used in conjunction with I/O(Input/ Output)
instructions that transfer the data between external devices and the CPU.
The Output Registers (OR):- It holds the output after processing the input data. This will store
the result or the output from the CPU to an external device, such as a printer or monitor. It is
used in conjunction with the input/ Output instructions to transfer the data between external
devices and the CPU. It is also used to store the data temporarily that is to be shown as output so
the CPU can continue to execute further

Q5. Define Sizes of CPU Registers?


Ans. The size of the computer register means the number of bits is able to store, we consider a 16
bit computer, it means that each word of this computer contains 16 bits of data. 8-bit registers
store 8 bits of data (1 byte), 16-bit registers store 16 bits of data (2 bytes). If the memory
capacity of that computer is 4K (4096 ) words, then we will need 12 bits to address or locate
each of these words. This is so because 2 12 =4096 and the addresses of memory locations will
vary from 0000 to 4095. The word length and memory capacity of the computer determines the
sizes of register.
If memory size is 16 bits so the AC, MAR, IR, TR hold 16 bits of data.

Q6. Define the term Bus, describe its types and function.
Ans. Buses: Bus is a communication pathway connecting with two or more devices. It is a
collection of wires through which data is transmitted or electrical signals are transmitted. The
speed of a bus is measured in megahertz(MHz). The size of a bus(its width) is how many bits it
can transfer at a time. A 64 bit computer has buses with 64 bit width.. It can be unidirectional or
bidirectional. Each wire carries just one bit, a bus with eight wires can carry only 8-bit data
words.
There are three types of buses.
1. Control Bus
2. Data Bus
3. Address Bus
Control Bus: The control bus manages the communication between the computer’s CPU and its
other components. The control bus supervises the reading or writing of data. In fact it informs the
CPU that a particular unit has completed its job. For example when an output device has
completed the job of printing a character the control bus communicates this information to the
CPU and the CPU may transmit another character to the output device for printing or may take
some other suitable action.
Data Bus: A data bus carries data. It is an electrical path that connects the CPU, Memory,
Input/output devices, and secondary storage devices. The data bus is bi-directional because data
has to pass from CPU to memory as well as from memory to the CPU. The number of lines in
bus affects the speed at which the data travels between different components.
Address Bus: An address bus carries address information. It is a set of wires similar to the data
bus but it only connects CPU and memory. It is unidirectional electric signals are transmitted in
one direction from CPU to other devices. Whenever the processor needs data from the memory,
it places the address of data on the address bus. The address is carried to the memory where the
data from the requested address is fetched and placed on the data bus. The data bus carried to the
CPU.

Q7.Define computer instruction.


Ans. An instruction is an order for the computer to perform a specific operation. It may be read a
data from an input unit or write a through an output unit. An instruction may specify arithmetic
operation like addition, subtraction, multiplication or division of two number. Instructions
transfer data internally within the computer. A group of instructions is used to compare data,
before execution instruction it must be stored in the main memory. If an instruction is held in the
external memory it has to be brought to the main memory before execution. An instruction is
stored in the memory as a number of bits (0 and 1). The word size defines the number of bits
used to represent data in the processor's registers and memory. Common word sizes include 8-bit,
16-bit, 32-bit, and 64-bit.

Q8. Define components of a computer instruction


Ans. A computer instruction in machine language consists of a fixed number of bits stored as
computer words. If an instruction has n-bits then these bit positions are divided into two or more
sections called fields. One field a group of bit positions in computer word) in an instruction has
to be an operation code field usually called opcode, that specifies the operation to be performed.
The opcode may instruct the computer to add two numbers or compare two numbers of it may
direct the computer to stop the execution of the program. The remaining part of the instruction is
called the address field. It may be divided into one or more parts each part containing address ofa
particular memory location where data for the instruction could be found thus an instruction in
machine language consists of two parts namely
Operation code abbreviated to opcode.
Address or addresses of a one or more memory locations
Operation Code:-The operation code of an instruction consists of a group of bits that define
certain arithmetic or some other operations such as addition, subtraction, multiplication, division,
shifting or complementation. If the operation code has n bits then the commuter is capable of
performing 2n distinct operations. Example if 16 distinct operation are to be performed by a
computer then the opcode must have atleast 4 bits (as 2 4=16) and if 32 (=25)distinct operation are
required the least number of bits needed for the opcode is 5.An operation code is a part of an
instruction stored in a memory location in the memory. As already pointed out this operation
code is a group of bits which tells the computer to carry out a specific operation such as to add
two numbers. The control unit fetches an instruction from the memory and decodes the operation
code part of it.
Address:-The operation code of an instruction specifies the operation to be performed on data or
on a set of data. The data may be stored in a register or in a memory location. The data on which
the operation to be performed is called an operand. Thus, an instruction must specify the
operation to be performed along with the address or addresses of the operands or registers where
the result of an operation is to be stored. Thus, a computer instruction contains the following
information.
Operation to be performed.
Address or addresses of memory locations containing the operand or operands.
Address of the register or memory location which is to store the result.

Q9. Define instruction formats.


Ans. An instruction format defines the layout of bits of an instruction in terms of its constituent
parts.
A computer system performs tasks based on the instruction provided to it. These computer
instructions are written in different formats based on the number of addresses that they contain.
There are various instruction formats depending upon the architecture of the computer.

Q10. Define the types of instructions.


Ans. Types of instructions:
1. Three Address Instruction.
2. Two Address Instruction
3. One Address Instruction
4. Zero Address Instruction
Three Address Instruction:-A three address instruction consists of the following parts.
Operation Code.
Addresses of two operands, called address 1 and address 2.
Address of the memory of the destination.
The number of bits (field length) allotted to each of the three parts depends upon the computer
Address of
Opcode Address 1 Address 2 Destination

A three address instruction to add two numbers, specifies the operation code for addition,
addresses of two number (operands) to be added, address of the memory location where the
result of addition of two numbers is to be stored, usually called address of the destination.
Instruction Meaning
ADD A,B,C Add the numbers stored at the memory locations A and B. Store the result
in
memory location C
In other words C=A+B
It must be clearly understood that the instruction ADD, A,B,C is coded in binary form before it
can be executed by the computer.
Two Address Instruction:-The type of instruction in a computer system that requires minimum
two operands to perform operations is known as a 2-address instruction. In the case of 2-
address instruction, the result is stored in one of the two operands.
In other words, a computer instruction in which operations like addition, subtraction,
multiplication, etc. are performed on two values stored in registers and the result is also stored
back into one of the same registers, it is called a 2-address instruction.
The Two Address Instruction has the following parts.
Operation Code
Address of one of the operands, say address1
Address of the storage location where the result is to be stored. This address is denoted by
address 2

Opcode Address 1 Address 2

The 2-address instruction is very common in commercial computer systems.


Syntax
The following is the syntax of the 2-address instruction −
A B, C
Where, A is the opcode for example “ADD” for addition, B is the source operand, and C is the
destination operand. Here, the destination operand is used to store result, and hence it can be a
register or a memory location.
Example
The following is an example to illustrate the 2-address instruction −
ADD A, B A = A + B
Here, contents of the register A and register B will be added and the result will be stored in the
register A.
One Address Instruction:-A type of instruction in computer system that takes only one operand
to perform operations is called a 1-address instruction. In the case of 1-address instruction, the
result of operation is stored either in the same operand or in a memory register.
The 1-address instruction mostly used to perform unary operations like increment or decrement a
value stored in a register.

Opcode Address 1

Syntax
The 1-addresss instruction takes the following syntax −
AB
Where, A is an opcode like INC for increment, and B is the operand on which the operation is to
be performed. Thus, in the case of 1-address instruction, the operand is modified.
while the 1-address instruction requires only one operand to perform an operation and stores the
result in the same operand or in a register.
Zero Address Instruction:-1. Zero(0) Address Instruction format
The instruction format in which there is no address field is called zero address instruction. In
zero address instruction format, stacks are used. In zero order instruction format, there is no
operand.
The zero address instructions are also called stack instructions and consist of opcode only. The
addresses of operand and destination are implied. The general form of zero-address instruction is
Opcode.
Q11. What is stack? Explain its operations with example.
Stack:-A stack is a linear data structure used for storing data. A stack is an ordered list in which
insertion and deletion are performed at one end, which is referred to as the top. The data which is
placed first is removed in last and which is placed last is removed first. It is known as the Last in
First Out (LIFO) rule. When an element is inserted in a stack, the concept is called push and
when the element is removed from the stack, the concept is called pop. When stack is completely
full it is called over flow state, and when stack is completely empty is called underflow state.
Examples: letter basket, stack of trays, stack of plates. There are only two basic operations on
stacks, the push (insert), and the pop (delete).
1. push():-Push is a function in stack definition which is used to insert data at the stack's top.

2. pop():- Pop is a function in the stack definition which is used to remove data from the stack's
top.

Q12.Define Infix, Prefix and Postfix


Ans. Define The way to write arithmetic expression is known as a notation. An arithmetic
expression can be written in three different but equivalent notations, i.e., without changing the
essence or output of an expression. These notations are –
1. Infix
2. Prefix
3. Postfix
Infix notations are normal notations, that are used by us while write different mathematical
expressions. The Prefix and Postfix notations are quite different.
Prefix Notation In this notation, operator is prefixed to operands, i.e. operator is written ahead
of operands. For example, +ab. This is equivalent to its infix notation a + b. Prefix notation is
also known as Polish Notation.
Postfix Notation This notation style is known as Reversed Polish Notation. In this notation
style, the operator is postfixed to the operands i.e., the operator is written after the operands. For
example, ab+. This is equivalent to its infix notation a + b.
Example
Expression No Infix Notation Prefix Notation Postfix Notation

1 a+b +ab ab+

2 (a + b) * c *+abc ab+c*

3 a * (b + c) *a+bc abc+*

4 a/b+c/d +/ab/cd ab/cd/+

5 (a + b) * (c + d) *+ab+cd ab+cd+*

6 ((a + b) * c) - d -*+abcd ab+c*d-

Q13. Define internal working of CPU.


Ans. The central processing unit (CPU) that accepts data and instructions, processes the data
according to the instructions and delivers the output to the output units. It has the following
features.
The computer word is 16-bit long
It accepts and executes one address instruction
The instruction word is divided into two parts namely the operation code (opcode) and address
field which gives the address of the operand.
The operation code is 4-bit long and address field is 12-bit long
The computer has memory size f 4K words i.e. it has 4096 (4K=4x1024) memory locations
which can be addressed.
The execution of an instruction stored in memory involves two step. The processor reads
(fetches) instructions from memory one at a time and executes each instruction. Program
execution consists of repeating the process of instruction fetch and instruction execution. The
instruction execution may involve several operations and depends on the nature of the
instruction.

Q14. Define fetch cycle.


Ans. The fetch cycle is that duration of time in which an instruction stored in the memory is
brought to an appropriate register, all this happening under the commands from control unit of
the CPU. The process of bringing an instruction from memory to a register is called a fetch cycle
ands has to be completed in a specified duration of time. How this is done and to which register
this instruction is brought will be discussed later.

Q15. Define execute cycle.


Ans. The process of execution of an instruction by the CPU in a specified interval of time is
called execute cycle. The instruction fetched from memory is placed in a register where it is
decoded and executed by ALU (Arithmetic Logic Unit) in this execute cycle. The CPU when
fetching an instruction is said to be in fetch stage and while executing an instruction is in execute
stage, the two stages appearing alternately.

Q16. What is data processing cycle? What its steps with the help of a diagram.
Or Describe instruction fetch cycle.
Ans. To execute an instruction, a processor goes through a series of steps, called an instruction
cycle. The instruction cycle typically consists of fetching the instruction from memory, decoding
the opcode and the operands, executing the operation, and storing the result.
Fetching of an Instruction: -The instructions and data are stored in main memory as computer
words. These instructions and data are stored in memory in binary coded forms (0s and 1s). By
fetching of an instruction means transferring an instruction from a memory location to the
instruction register (IR). This instruction Register holds an instruction temporarily only for the
time when the instruction and data are being interpreted or decode. The instruction from a
memory location is transferred to instruction register via another register called memory buffer
register (MBR). All the instructions and data from memory pass through memory buffer register
on their way to other registers or to other units. The other registers used in a fetching operation
are program counter (PC) and memoryaddress register (MAR). thus, the registers needed in
instruction fetching operations are.
1. Instruction Register (IR)
2. Memory buffer register (MBR)
3. Program counter (PC)
4. Memory address register (MAR)
5. Decode fetching instruction: -
To execute the instruction, ADD 4, 3, the processor might fetch the machine code 0001 0100
0011 from memory, decode it into the opcode 0001 and the operands 0100 and 0011, execute the
addition operation, and store the result 0111 in a register or memory.
Execution of an instruction :-The operation code is transferred to the control unit. This control
unit sends opcode to decoder where it is decoded. After decoding the opcode, the control unit
issues commands in the form of control signals to various other units such as arithmetic logic
unit to perform the necessary operations. The address part of the instruction in IR is transferred
to a decoder which decodes it as the address of a particular memory location. This address is
transmitted to memory address register (MAR) which transmits it to the main memory. Under the
directions of the control unit, the operand stored in that particular memory location is transmitted
to the memory buffer register, from where it is transmitted to the ALU. The most import register
of the ALU is accumulator where all the arithmetic is performed. This operand (data) is passed to
the accumulator in ALU where the necessary arithmetic as directed by the control unit is
performed and the result of the operand is held in the accumulator for onward transmission to the
main memory.

Q17. Define the fetching operation.


Ans. Let s consider a small computer program stored in the main memory in the locations from
0000 to 0008. The first instruction to be fetched is in the location 0000. To start with the program
counter is set to 0000. Under the signals from control unit this address 0000 is passed to memory
address register (MAR) and PC itself gets incremented by 1 and now it holds the address 0001
which is the address of the next instruction. Again the control unit issues commands to MAR to
pass on this Address, to the main memory and under the directions of the control unit the
instruction stored at address 0000 in the memory is passed to the memory buffer register (MBR).
This instruction is held in MBR temporarily and is passed to current instruction register under
the commands from control unit. One this is done, the above process is repeated to fetch the next
instruction.

You might also like