CH 3 1st Year (Nouman) Central Processing Unit
CH 3 1st Year (Nouman) Central Processing Unit
SHORT QUESTIONS
Arithmetic Unit deals with arithmetic calculations such as addition (+), subtraction (-)
and multiplication (x), whereas Logic Unit (LU) deals with all logical comparisons such as
greater than (>), less than (<), equals to (=) etc.
1
Coordinates means to make many different things work effectively as a whole
2
Cable is a conductor for transmitting electrical or optical signals or electric power.
3
A buffer is a data area shared by ( )اشتراک میں – مل کر استعمال کرتے ہیںhardware devices or program that operate
at ( )کام کرتے ہےdifferent speeds
Data transfer instructions: The data transfer instructions are used to transfer
data from one location in computer to another location without changing the
content.
Data processing instructions: Data processing instructions are used to perform
arithmetic and logic operations
Program control instructions: Program control instructions are used to alter ( تبدیل
)کرناthe sequence ( )ترتیبof program execution.
Miscellaneous instructions: The miscellaneous instructions involve various
special operations.
Op-code field is used to define different operations such as LOAD, STORE, ADD,
SHIFT etc.
Operand field can have data or it carries address of data.
CPU controls all instructions, storage of data, input and output operations and functions
of all devices attached.
AU deals with arithmetic calculations such as addition (+), subtraction (-) and
multiplication (x), whereas LU deals with all logical comparisons such as greater than (>),
less than (<), equals to (=) etc.
3. Registers:
Register is a high speed small storage area within the CPU. Register temporarily stores
currently executing instruction and pass ( )منتقل کرناinformation to other parts of CPU and
to main memory. For example, if two numbers are added, both numbers must be in
registers and the result is also placed in a register.
The register can also contain the address of a memory location where data is stored
rather than the actual data itself.
4. Cache:
Cache memory is extremely fast static RAM (SRAM) that is built into CPU or located
( )بٹھائ – رکھی جاتی ہےnext to ( )ملحقCPU and is effective because most programs access
the same data or instructions over and over again. Caches stores repeatedly used
information. CPU accesses it quickly and more efficiently.
4
a signal is an electrical or radio wave that conveys information
The register can also contain the address of a memory location where data is stored
rather than the actual data itself.
The number of registers that a CPU has and the size of each register determines ( تعین کرتا
)ہےthe power and speed of a CPU. For example, a 32-bit CPU is one in which each
register is 32-bits wide. Therefore, each CPU instruction can manipulate 32 bits of data.
Accumulator (AX)
Base register (DX)
Counter register (BX)
Data register (CX)
Most of the system buses are made up of 50 to 100 lines for communication. The
system bus consists of three types of buses:
Data bus
Address bus
Control bus
1. Data bus:
Data bus handles the transfer of data and instructions. It transfers the instructions from
memory to CPU for execution. It carries data (operand) from the CPU to memory and
from memory to CPU when required. It is also used to transfer data between memory
and I/O devices during input/output operation. It can transfer data in both directions i.e.
from CPU to memory and memory to CPU. It means that it is bidirectional bus but works
at one side at a time. A data bus is 32 to 64-bits wide. At a time a 32 bit of data can
travel through 32-bits wide data bus.
5
Cable is a conductor for transmitting electrical or optical signals or electric power.
3. Control bus:
Control bus is used by processor to direct and monitor the action of other components
of computer. It also transfers some control signals like Read, write, interrupt etc. This is
a dedicated bus, because all timing signals are generated according to control signal.
The size of this bus ranges from 8 to 16 bits.
Operand code tells the parameters ( )حدof action. It depends on operation that
will be performed. It can be data or memory address.
MOV A,B
LD destination
LD A
The above instruction will load the data from memory to register A.
3.1. JMP instruction: This instruction jumps to begin the execution at another
location.
3.2. CMP instruction: This instruction is used to compare the operand with numeric
value.
3.3. Loop instruction: It is used to run the statements repeatedly.
...
L7:
There are four phases of an instruction cycle. These are: Fetch, Decode, Execute and
Store
1. Fetch:
In the first phase of instruction cycle, the instruction is fetched from memory. The
address of instruction to be fetched is obtained form Program Counter (PC). After being
fetched the instruction is stored in Instruction Register (IR).
2. Decode:
At this phase, the decoder translates the instruction. The instruction may include
immediate6, direct7 or indirect8 operand. If the instruction has an indirect address then
an effective address is also read from memory and any required data is fetched from
memory and is placed into data register.
3. Execute:
At execute phase the instructions are executed. The decoded instructions are passed to
the relevant places for execution by the CPU. For example mathematical instructions are
sent to ALU etc.
4. Store:
This is the last phase in which the result of the executed instructions is stored in the
main memory or sent to the output device. Usually this phase is not included in the
instruction cycle.
6
Immediate: instructions use their operand to hold the data needed to complete the instruction.
7
Direct: instructions use their operand to hold the memory address of the data. The effective address of the
operand in memory is part of the instruction.
8
Indirect: The instruction uses their operand to contain a memory address, which contains the effective address of
the operand in memory.
MCQ's-
i) Which of the following performs the arithmetic and logic operations on data?
ii) Coordinates and controls the computer system, just like the brain controls the
human body.
iv)_______ Is a small memory device available in the CPU to store data temporarily.
v)___is the small amount of memory located between a main memory and Processor.
Vi.) Which of the followings cache memories resides inside the microprocessor and is
very fast from the other memories?
vii) ____Register can perform arithmetic and data movement and it has some special
addressing abilities.
viii) Which of the following register has a special role in multiply and divide
operations?
ix) Register holds either the address of the instruction being executed or the address
of the next instruction to be executed.
xi) Which of the following steps, in instruction cycle, interpret the instruction?
A.1 B. 2 C. 3 D. 0