You are on page 1of 11

Assignment 7

Name: Ajit Maharjan Roll no: 1

1. Explain the CPU and its component with necessary diagram.

→ The computer's central processing unit (CPU) is the portion of a computer that retrieves
and executes instructions. The CPU is essentially the brain of a CAD system. It consists of an
arithmetic and logic unit (ALU), a control unit, and various registers. The CPU is often
simply referred to as the processor. The ALU performs arithmetic operations, logic
operations, and related operations, according to the program instructions.

The control unit controls all CPU operations, including ALU operations, the movement of
data within the CPU, and the exchange of data and control signals across external interfaces
(system bus). Registers are high-speed internal memory-storage units within the CPU. Some
registers are user-visible; that is, available to the programmer via the machine instruction set.
Other registers are dedicated strictly to the CPU for control purposes. An internal clock
synchronizes all CPU components. The clock speed (number of clock pulses per second) is
measured in megahertz (MHz) or millions of clock pulses per second. The clock speed
essentially measures how fast an instruction the CPU processes.
2. Explain the importance of computer memory in detail with examples.

→ Computer memory is any physical device capable of storing information temporarily, like
RAM (random access memory), or permanently, like ROM (read-only memory). Memory
devices utilize integrated circuits and are used by operating systems, software, and hardware.

Each device in a computer operates at different speeds and computer memory gives your
computer a place to quickly access data. If the CPU had to wait for a secondary storage
device, like a hard disk drive, a computer would be much slower.

Memory is an essential component of a computer. Computers operate on the concept of


“stored programs”. Instructions of a program are stored in memory locations. They are picked
up one by one and are executed, under the direction of the control unit, without human
intervention, making the processing automatic.

3. What is register? Why are registers used in CPU?

→ Register are used to quickly accept, store, and transfer data and instructions that are being
used immediately by the CPU, there are various types of Registers those are used for various
purpose. Among of the some Mostly used Registers named as AC or Accumulator, Data
Register or DR, the AR or Address Register, program counter (PC), Memory Data Register
(MDR), Index register, Memory Buffer Register.

These Registers are used for performing the various Operations. While we are working on the
System then these Registers are used by the CPU for Performing the Operations. When We
Gives Some Input to the System then the Input will be Stored into the Registers and When the
System will give us the Results after Processing then the Result will also be from the
Registers. So that they are used by the CPU for Processing the Data which is given by the
User.
Registers Perform:

• Fetch: The Fetch Operation is used for taking the instructions those are given by the
user and the Instructions those are stored into the Main Memory will be fetch by using
Registers.
• Decode: The Decode Operation is used for interpreting the Instructions means the
Instructions are decoded means the CPU will find out which Operation is to be
performed on the Instructions.
• Execute: The Execute Operation is performed by the CPU. And Results those are
produced by the CPU are then Stored into the Memory and after that they are
displayed on the user Screen.

4. What do you mean by cache memory? Explain the need of cache memory.

→ The Cache Memory is the volatile computer memory which is very nearest to the CPU so
also called CPU memory, all the Recent Instructions are Stored into the Cache Memory. It is
the fastest memory that provides high-speed data access to a computer microprocessor. Cache
meaning is that it is used for storing the input which is given by the user and which is
necessary for the computer microprocessor to Perform a Task. But the Capacity of the Cache
Memory is too low in compare to Memory (random access memory (RAM)) and Hard Disk.

→ The cache memory lies in the path between the processor and the memory. The cache
memory therefore, has lesser access time than memory and is faster than the main memory. A
cache memory has an access time of 100ns, while the main memory may have an access time
of 700ns.

The cache memory stores the program (or its part) currently being executed or which may be
executed within a short period of time. The cache memory also stores temporary data that the
CPU may frequently require for manipulation.

The cache memory works according to various algorithms, which decide what information it
has to store. These algorithms work out the probability to decide which data would be most
frequently needed. This probability is worked out on the basis of past observations.
5. What are the functions of CPU?

→ The CPU processes instructions it receives in the process of decoding data. In processing this
data, the CPU performs four basic Functions:

Fetch: Each instruction is stored in memory and has its own address. The processor takes this
address number from the program counter, which is responsible for tracking which instructions
the CPU should execute next.

Decode: All programs to be executed are translated into Assembly instructions. Assembly code
must be decoded into binary instructions, which are understandable to your CPU. This step is
called decoding.

Execute: While executing instructions, the CPU can do one of three things: Do calculations with
its ALU, move data from one memory location to another, or jump to a different address.

Store: The CPU must give feedback after executing an instruction, and the output data is written
to the memory.

6. What is instruction format? Describe the format of an instruction.

→Instruction format describes the internal structures (layout design) of the bits of an
instruction, in terms of its constituent parts. Instruction format must include an opcode, and
address is dependent on an availability of particular operands.

when the assembler processes an Instruction, it converts the instruction from its mnemonics
form to standard machine language format called the "Instruction format". In the process of
conversion, the assembler must determine the type of instruction, convert symbolic labels and
explicit notation to a base/displacement format, determine the lengths of certain operands and
parse any literal and constants.
7. What is the function of operation code and operand code in an instruction?

→ Operation and operand both are main component of instruction format. The operators indicate
what action or operation to perform. The operands indicate what items to apply the action to.
An operand can be any of the following kinds of data items: Constant, Variable, Array
element, Function, Substring. Operators are special tokens that represent computations like
addition, multiplication and division. The values the operator works on are called operands.
An operator performs a function on one, two, or three operands. An operator that requires one
operand is called a unary operator.

8. Define Instruction set. What is the significance of the Instruction set in the CPU ?

→ An instruction set (used in what is called ISA, or Instruction Set Architectur e) is code that
the computer processor (CPU) can understand. The language is 1s and 0s, or machine
language. It contains instructions or tasks that control the movement of bits and bytes within
the processor.

→ An instruction set is a group of commands for a CPU in machine language. The term can
refer to all possible instructions for a CPU or a subset of instructions to enhance its
performance in certain situations.

All CPUs have instruction sets that enable commands to the processor directing the CPU to
switch the relevant transistors. Some instructions are simple read, write and move commands
that direct data to different hardware.

9. Define Instruction Cycle. Give a detailed working of the instruction cycle.

→A program residing in the memory unit of a computer consists of a sequence of


instructions. These instructions are executed by the processor by going through a cycle f or
each instruction.

In a basic computer, each instruction cycle consists of the following phases


• Fetch Stage: The next instruction is fetched from the memory address that is currently
stored in the program counter and stored into the instruction register. At the end of the
fetch operation, the PC points to the next instruction that will be read at the next cycle.
• Decode Stage: During this stage, the encoded instruction presented in the instruction
register is interpreted by the decoder.
• Read the effective address: In the case of a memory instruction (direct or indirect), the
execution phase will be during the next clock pulse. If the instruction has an indirect
address, the effective address is read from main memory, and any required data is
fetched from main memory to be processed and then placed into data registers (clock
pulse: T3). If the instruction is direct, nothing is done during this clock pulse. If this is
an I/O instruction or a register instruction, the operation is performed during the clock
pulse.
• Execute Stage: The control unit of the CPU passes the decoded information as a
sequence of control signals to the relevant functional units of the CPU to perform the
actions required by the instruction, such as reading values from registers, passing them
to the ALU to perform mathematical or logic functions on them, and writing the result
back to a register. If the ALU is involved, it sends a condition signal back to the CU.
The result generated by the operation is stored in the main memory or sent to an output
device. Based on the feedback from the ALU, the PC may be updated to a different
address from which the next instruction will be fetched.
• Repeat Cycle
10. Describe the features of CISC architecture.

→ Features of CISC Processors:

a. CISC chips have complex instructions.

A CISC processor would come prepared with a specific instruction (call it "MULT"). When
executed, this instruction loads the two values into separate registers, multiplies the operands
in the execution unit, and then stores the product in the appropriate register. Thus, the entire
task of multiplying two numbers (2, 3) can be completed with one instruction: MULT 2, 3

MULT is what is known as a "complex instruction." It operates directly on the computer's


memory banks and does not require the programmer to explicitly call any loading or storing
functions. It closely resembles a command in a higher level language.

b. CISC processors have a variety of instructions:

There are a variety of instructions many of which are complex and thus make up for smaller
assembly code thus leading to very low RAM consumption

c. CISC machines generally make use of complex addressing modes.

CISC processes have a variety of different addressing modes in which the operands can be
addressed from the memory as well as located in the different registers of the CPU.

There are many instructions that refer memory as opposed to RISC architecture

d. CISC processors have variable length instructions:

The decision of CISC processor designers to provide a variety of addressing modes leads to
variable-length instructions. For example, instruction length increases if an operand is in
memory as opposed to in a register.

e. Easier compiler design:

Compilers have very little to do when executing on a computer having CISC architecture. The
complex instruction set and smaller assembly code meant little work for the compiler and thus
eased up compiler design
f. CISC machines uses micro-program control unit:

CISC uses micro programmed control unit. These systems consist of micro programs which
are nothing but series of microinstructions, which control the CPU at a very fundamental level
of hardware circuitry. This is then stored in a control memory like ROM from where the CPU
accesses them and generates control signals.

g. CISC processors are having limited number of registers.

CISC processors normally only have a single set of registers. Since the addressing modes give
provisions for memory operands, limited number of “costly” register memory is sufficient for
the functions.

11. Describe Features of RISC Processors:

→The features of RISC processors are:

a. RISC processors use a small and limited number of instructions.

RISC processors only support a small number of primitive and essential instructions. This
puts emphasis on software and compiler design due to the relatively simple instruction set.

b. RISC machines mostly uses hardwired control unit.

Most of the RISC processors are based on the hardwired control unit design approach. In
hardwired control unit, the control units use fixed logic circuits to interpret instructions and
generate control signals from them. It is significantly faster than its counterpart but are rather
inflexible.

c. RISC processors consume less power and have high performance.

RISC processors have been known to be heavily pipelined this ensures that the hardware
resources of the processor are utilized to a maximum giving higher throughput and also
consuming less power.

d. Each instruction is very simple and consistent.


Most instructions in a RISC instruction set are very simple that get executed in one clock
cycle.

e. RISC processors use simple addressing modes.

RISC processors don’t have as many addressing modes and the addressing modes these
processors have are rather very simple. Most of the addressing modes are for register
operations and do not refer memory.

f. RISC instruction is of uniform fixed length.

The decision of RISC processor designers to provide simple addressing modes leads to
uniform length instructions. For example, instruction length increases if an operand is in
memory as opposed to in a register. a. This is because we have to specify the memory address
as part of instruction encoding, which takes many more bits. This complicates instruction
decoding and scheduling.

g. Large Number of Registers.

The RISC design philosophy generally incorporates a larger number of registers to prevent in
large amounts of interactions with memory the features of RISC architecture.

12. Define a system bus. Explain control, address and data bus.

→ A system bus is a high-speed internal connection. System uses are used to send control
signals and data between the processor and other components.

Three types of bus are used.

Address bus - carries memory addresses from the processor to other components such as
primary storage and input/output devices. The address bus is unidirectional.

Data bus - carries the data between the processor and other components. The data bus is
bidirectional.

Control bus - carries control signals from the processor to other components. The control bus
also carries the clock's pulses. The control bus is unidirectional.
13. Explain the factors that affect the performance of the computer.

→Factors that affect the performance of the computer:

1) The speed of the CPU

The speed of the CPU is also known as the clock speed of the CPU. The clock speed of the
CPU is the frequency of which the processor executes instructions or the frequency by which
data is processed by the CPU. It is measured in millions of cycles per second or megahertz
(MHz). If the Clock speed of the CPU is fast then definitely the performance of the computer
will be affected positively, in other words the computer will carry out processing functions at
a faster pace.

2) The size of the RAM (Random Access Memory)

The RAM is referred to as the active part of the computer. This is because the RAM has the
capability of storing data that the computer is currently using, because of the fact that it is fast
to retrieve data stored in the RAM. With the definition above, a large RAM size will mea n a
faster computer performance and a smaller RAM size will result to slower computer
performance.

3) The speed of the hard disk

The hard disk speed is defined as the rate at which material and content can be read and
written on it. The hard disk speed of different hard disks is not consistent because they vary
by manufacturer, drive type and the use of the hard disk. It therefore means that the higher the
speed of the hard disk the faster the performance of the computer and vice versa.

4) Hard disk space

The bigger the space on the hard disk will result to faster performance of the computer. The
smaller the space on the hard disk will result in a slower performance of the computer. The
hard disk is filled with data this will use most of the memory leaving less memory for the
operations of the processor.

5) Multiple applications running on the computer


Multi-tasking tends to slow down the performance of the computer because memory is used to
support more than one application compared to when one application has all the memory to
itself. This means that the more applications that are running the slower the computer will
perform. Likewise, if less or one application is running the performance of the computer will
be faster.

6) Type of graphic card

When it comes to quality of pictures and animations graphic cards are the main factors. So if a
machine processes many graphics and it has a weak graphic card it will perform slower. This
means that the more powerful the graphic card is the faster the performance of the computer.

7) Defragmenting files

Files that are broken or it takes long to read them will mean that the computer will have to
defragment them first. This will slow down the performance of the computer.

You might also like