0% found this document useful (0 votes)
36 views11 pages

1st Year Chapter 3

Uploaded by

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

1st Year Chapter 3

Uploaded by

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

CHAPTER – 3 CENTRAL PROCESSING UNIT

SHORT QUESTIONS
Q 1: WHAT IS THE FUNCTION OF ALU IN THE COMPUTER?

Ans:

ALU stands for Arithmetic Logic Unit.

It is the part of processor which does the following operations:

• Arithmetic operations
• Logical operations

Arithmetic operations include addition, subtraction, multiplication, division and modulus.

Logical operations include

< Less than

> Greater than

> = greater than and equal to

< = less than and equal to

= = equal to than equal to

! = not equal to

A processor may have more than one ALU than can speed up the operations.

Q 2: WHAT IS THE FUNCTION OF CONTROL UNIT IN THE COMPUTER?

Ans:

There is circuitry in the control unit which uses electrical signals to instruct the whole computer system
for carrying out or executing, already stored program instructions. Its name clearly shows that it controls
and co-ordinates computer components. It extracts instructions from memory and decodes and
executes them. In fact, it regulates the flow of information through the processor. In short, it can be
said, this component receives, decodes, stores results and manages execution of data that flows
through the CPU. Its communication with both arithmetic unit and memory is certain.

Q 3: WHAT IS A MICROPROCESSOR?

Ans:

Microprocessor or CPU (Central Processor Unit) is also called a processor .It is an important part of every

ATIF FAHEEM KHAN


1|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

computer system. Just like human brain it controls all operations inside system unit .It is the fastest
component than all other components of computer system.

It has following major parts:

1. ALU

2. CU

3. Cache

4. Registers

5. Internal Buses

Now day’s two major companies manufacture CPUs for PCs i.e. INTEL and AMD.

Q 4: DEFINE SYSTEM BUS?

Ans:

Every component in computer motherboard is connected with every other component through printed
electrical lines. These electrical lines are called system bus.

So, we can define a bus in these words

“Combination of electrical lines which are used to travel data from one component to another”

System bus consists of three main types: -

1. Data Bus

2. Address Bus

3. Control Bus

System bus is also called external bus because this is not inside CPU.

Every bus (Data, Address, and Control) has its specific function.

Q 5: WRITE SHORT NOTE ON MEMORY BUFFER REGISTER (MBR)?

Ans:

Memory Buffer Register is a special purpose register. It is also called memory data register. It major
work is to make processor and memory, work independently. It holds (stores) the contents of that
memory location which needs to be moved from memory to other components or from other
components to memory. It works as a buffer. Before saving a data it is stored in MBR and then it goes to

ATIF FAHEEM KHAN


2|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

the specific memory location.

Q 6: WHAT IS CPU OPERATION?

Ans:

Being a central and most important component of a computer system, the CPU can perform arithmetic
and logical operations like addition, subtraction, less than, greater than etc. It also controls the overall
functions of computer system by using Control units. It performs following functions to process an
instruction:

1. Fetch
2. Decode
3. Execute
4. Store

After the completion of these steps an instruction is said to be executed.

Q7: WHAT IS MEANT BY AN INSTRUCTION?

ANS:

When referring to the computer processor, an instruction is a segment of code that contains steps that
need to be executed by the computer processor. For a computer to do something, instructions have to
be given to the computer processor so it knows how to do what it is being asked to do.

For example, if you were to ask the computer to draw a square, it would need a set of instructions on
how to draw the square, so it can complete the task.

Q 8: DIFFERENTIATE B/W OP-CODE AND OPERAND.

ANS:

Opcode is the portion of a machine language instruction that specifies the operation to be performed.
Like here MOV specifies the movement of 1000H in the AX register.
ATIF FAHEEM KHAN
3|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

Operand is a quality on which operation is performed. Here AX and 1000H are the operands.

Example 1: MOV AX, 1000H;

Now in the above assembly language example

• MOV is the opcode


• AX (register) is an operand.

Example 2: ADD 45

• ADD is the opcode


• 45 is an operand.

Q 9: SHOW COMPUTER INSTRUCTION FORMAT WITH THE HELP OF DIAGRAM AND LABEL ITS PARTS.

ANS:

Computer Instruction Format:

An instruction consists of an opcode, usually with some additional information such as where operands
come from, and where results go. There are three basic types of instruction format:

Zero-Address Instruction

The instruction contains only op code. It takes only one byte in memory.

Example: ADD

One-Address Instruction

It contains opcode and address so it takes two bytes in memory.

op code address1

Example: ADD B

Two-Address Instruction

It contains opcode and two addresses.


ATIF FAHEEM KHAN
4|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

op code operands

Example: ADD R1, A, B

Q 10: DIFFERENTIATE B/W CISC AND RISC PROCESSOR ARCHITECTURE.

ANS:

1. CISC [ARCHITECTURE ORIENTED]

(Complex instruction set compilers) focuses on finishing a task in few lines of assembly code.

For example, MULT 3:4, 6:5

This instruction when executed will load two numbers and multiply them up and then store the
result in a register.
MULT here is a complex instruction and here we don't require much of loading and storing
elements from the computer's memory rather they (CISC instructions) act directly on it. IT
emphasizes on multi clock instructions.

2. RISC [SOFTWARE ORIENTED]

(Reduced instruction set computing) here instead of complex instruction we go for simple
instructions one by one which could be completed in a single clock. so, here instead of MULT as
a single instruction, there are a series of loading and storing instructions
Example: LOAD A, 3:4
LOAD B, 6:5
PROD A, B
STORE A,
Differentiating CISC and RISC
CISC: Compiler has to do a little job while translating HLL to assembly since the statements are
quite small. The main difficulty is creating complex instruction sets on hardware directly. There
is a very small use of RAM.
RISC: As we have already seen more no. of instructions mean more use of memory and much
work is meant for compiler too but at the same time RISC instructions require less hardware and
here we have scope for pipelining (executing more than one instruction during a single clock
cycle) too.

LONG QUESTIONS
ATIF FAHEEM KHAN
5|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

Q 1: WHAT IS CPU? DESCRIBE BASIC COMPONENTS OF CPU IN DETAIL.

ANS:

CPU stands for Central Processing Unit. It is also called a Central processor, or microprocessor, or
processor or the brain of the computer. A computer's CPU handles all instructions it receives from
hardware and software running on the computer. It is the main unit which is responsible for executing
instructions and data.

The three components of the CPU are following,

1. Arithmetic Logic Unit


2. Control Unit
3. Registers

Arithmetic Logic Unit (ALU)

There is electronic circuit board in arithmetic logic unit which executes all arithmetic and logical
operations. Its function is clear from its name. It performs arithmetic calculations like as
addition, subtraction, multiplication and division as well as comparisons. The unit can compare
numbers, letters, or special characters. There can be more than one Arithmetic logic unit in a
CPU.

Control Unit (CU)

There is circuitry in the control unit which uses electrical signals to instruct the whole computer
system for carrying out or executing, already stored program instructions. Its name clearly
shows that it controls and co-ordinates computer components. It extracts instructions from
memory and decodes and executes them. In fact it regulates the flow of information through
the processor. In short, it can be said, this component receives, decodes, stores results and

ATIF FAHEEM KHAN


6|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

manages execution of data that flows through the CPU. Its communication with both arithmetic
unit and memory is certain.

Registers/The Memory Unit

Registers are temporary storage areas which are responsible for holding the data that is to be
processed. They store the instructions and data in a processor. This data is further used by
Control Unit. There are some registers that are set aside for specific tasks, these generally
include a program counter, stack, and flags.

Q 2: WHAT IS A REGISTER? EXPLAIN DIFFERENT TYPES OF REGISTERS?

ANS:

Registers:

Registers are temporary storage areas which are responsible for holding the data that is to be
processed. They store the instructions and data in a processor.

There are two main types of Registers:

1. General purpose registers


2. Special purpose registers

General Purpose Register are the registers which are used for storing data as well as addresses. They are
combined data and address registers.

1. AX (Accumulator): This is accumulator register. It is used in arithmetic, logic and data transfer
instructions. In manipulation and division, one of the numbers involved must be in AX or AL.

ATIF FAHEEM KHAN


7|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

16 Bit AX Register

8 Bit AH Register 8 Bit AL Register

2. BX (Base Register): This is base register. BX register is an address register. It usually contain a
data pointer used for based, based indexed or register indirect addressing.

16 Bit BX Register

8 Bit BH Register 8 Bit BL Register

3. CX (Count Register): This is Count Register. This serves as a loop counter. Program loop
constructions are facilitated by it. Count register can also be used as a counter in string
manipulation and shift/rotate instruction.

16 Bit CX Register

8 Bit CH Register 8 Bit CL Register

4. DX (Data Register): This is data register. Data register can be used as a port number in I/O
operations. It is also used in multiplication and division.

16 Bit DX Register

8 Bit DH Register 8 Bit DL Register

Special Purpose Registers:

These registers hold the state of the program. They are used by the control unit to control the
operations of CPU and by the operating system to control the execution of the programs.

1. Instruction Register (IR): It is the part of Control unit. The instruction register holds the
instruction currently being executed. It is also called Current Instruction Register (CIR).
2. Memory Data Register (MDR): The memory data register (also known as the memory buffer
register or data buffer) holds the piece of data that has been fetched from memory. It works as
a buffer allowing the processor and memory units to act independently.
3. Memory Address Register (MAR): The memory address register holds the address of the next
piece of memory to be fetched. It basically holds the memory location of data that needs to be
accessed.
4. Program Counter (PC): The program counter holds the location of the next instruction to be
fetched from memory. It is automatically incremented by 1 between supplying the address of
the next instruction and the instruction being executed.

ATIF FAHEEM KHAN


8|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

Q 3: WHAT IS SYSTEM BUS? EXPLAIN DIFFERENT TYPES OF BUSES USED IN COMPUTERS.

ANS:

The CPU moves data around the computer on pathways that interconnect it to all the other components
on the motherboard. These pathways are called ‘buses’.

• The internal bus carries data within the motherboard.


• External buses carry data to peripherals and other devices attached to the motherboard.

The lines or pins of a bus are of three types:

1. Data Bus

The data bus can be a very busy pathway. Data bus is the most common type of bus. It is used to
transfer data between different components of computer. The number of lines in data bus
affects the speed of data transfer between different components. The data bus consists of 8, 16,
32, or 64 lines. A 64-line data bus can transfer 64 bits of data at one time.

The data bus lines are bi-directional. It means that:

• CPU can read data from memory using these lines


• CPU can write data to memory locations using these lines

2. Address Bus.

The components pass memory addresses to one another over the address bus. Many
components are connected to one another through buses. Each component is assigned a unique
ID. This ID is called the address of that component. If a component wants to communicate with
another component, it uses address bus to specify the address of that component. The address
bus is a unidirectional bus. It can carry information only in one direction. It carries address of
memory location from microprocessor to the main memory.

3. Control Bus

Control bus is used to transmit different commands or control signals from one component to
another component. Suppose CPU wants to read data from main memory. It will use control is
also used to transmit control signals like ASKS (Acknowledgement signals). A control signal
contains the following:

• Timing information: It specifies the time for which a device can use data and address bus.
• Command Signal: It specifies the type of operation to be performed.

Suppose that CPU gives a command to the main memory to write data. The memory sends
acknowledgement signal to CPU after writing the data successfully. CPU receives the signal and
then moves to perform some other action.

Q 4: EXPLAIN DIFFERENT TYPES OF CPU INSTRUCTIONS. ALSO GIVE EXAMPLES?

ATIF FAHEEM KHAN


9|Page
CHAPTER – 3 CENTRAL PROCESSING UNIT

ANS:

An instruction is an order given to a computer processor by a computer program. At the lowest level,
each instruction is a sequence of 0s and 1s that describes a physical operation the computer is to
perform (such as "Add"). An instruction has two fields:

1. Operation Code: It represents that the action that the processor executes.
2. Operand Code: It defines that parameters of the action.

There are three types of instructions:

1. Data transfer instruction


The data-transfer functions provide the ability to move data either between its internal registers
or between an internal register and a storage location in memory.
The data-transfer functions include:
a. MOV (Move byte or word): The move (MOV) instruction is used to transfer a byte or a
word of data from a source operand to a destination operand.
b. XCHG (Exchange byte or word): The exchange (XCHG) instruction can be used to swap
data between two general-purpose registers or between a general purpose register and
a storage location in memory.
c. LEA (Load effective address)
d. LDS (Load data segment)
e. LES (Load extra segment)
The LEA, LDS, LES instructions provide the ability to operate memory addresses by
loading either a 16-bit offset address into a general-purpose register or a register
together with a segment address into either DS or ES.
2. Data processing instruction
Data processing instructions include both arithmetic and logic instructions. The arithmetic
instructions provide computational abilities for processing numbers, while logic instructions
provides abilities of performing logic decisions. These instructions are performed by ALU
(Arithmetic Logic Unit).
3. Program control instructions
The program control instructions direct the flow of a program and allow the flow of the program
to change:
a. Jump instruction: The jump (JMP), allows the programmer to skip sections of a program and
branch to any part of the memory for the next instruction. A jump may of any of the
following types:
a. Unconditional
b. Conditional
c. Loop

Q 5: WHAT IS INSTRUCTION CYCLE? EXPLAIN DIFFERENT PHASES OF CPU INSTRUCTION CYCLE.

Ans:

ATIF FAHEEM KHAN


10 | P a g e
CHAPTER – 3 CENTRAL PROCESSING UNIT

Instruction cycle is the time period during which one instruction is fetched from memory and executed
when a computer is given an instruction in machine language. This cycle is also called the machine cycle.
There are typically four stages of an instruction cycle that the CPU carries out:

1. Fetch instruction: Read instruction code from address in Program Counter (PC) and place in
Instruction Register (IR). ( IR ← Memory[PC] )
2. Decode instruction: Hardware determines what the opcode/function is, and determines which
registers or memory addresses contain the operands.
3. Execute: Perform the function of the instruction. If arithmetic or logic instruction, utilize the ALU
circuits to carry out the operation on data in registers. This is the only stage of the instruction
cycle that is useful from the perspective of the end user.
4. Store result in memory if necessary: If destination is a memory address, initiate a memory write
cycle to transfer the result from the CPU to memory. Depending on the situation, the CPU may
or may not have to wait until this operation completes. If the next instruction does not need to
access the memory chip where the result is stored, it can proceed with the next instruction
while the memory unit is carrying out the write operation.

It can be shown with the following diagram:

ATIF FAHEEM KHAN


11 | P a g e

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy