Dpco Unit 3
Dpco Unit 3
Dpco Unit 3
UNIT III
COMPUTER FUNDAMENTALS
PART-A
1. Classify the instructions based on the operations they perform and give one example to each
category. AU: Dec.-18
.
2.What is Instruction set architecture ?AU : Dec-15
Ans. : One of the most imporant abstraction is the interface between the hardware and the lowest-level
softwrae. Because of its importance, it is given a special name:The instruction set architecture of a
computer. It includes anything programmer needs to know to make a binary machine language program
work correctly, including instructions, I/O devices and so on.
3. Differentiate direct and indirect addressing mode.AU: Dec.-08
Ans. : In direct addressing mode the address of the location of the operand is given explicitly as a part of the
instruction. On the other hand, in indirect addressing mode, the effective address of the operand is the
contents of a register or the main memory location whose address is given explicitly in the instruction.
4. What do you mean by big endian and little endian ?
Ans. : When lower byte addresses are used for the more significant bytes (the leftmost bytes) of the word,
addressing is called big endian.
Ans. : When the lower byte addresses are used for, the less significant bytes (the rightmost byte) of the word,
addressing is called little-endian.
1
5. Compare machine level, assembly level and high level languages.
• An address computed by the processor when executing a memory access or branch instruction or when
fetching the next sequential instruction is known as Effective Address (EA). An effective address can be
made up from as many as three elements: The base, index and displacement.
• An addressing mode specifies how to calculate the effective of an operand by using elements of effective
information held in registers and/or constants contained within a machine instruction or elsewhere.
8. List the types of addressing modes
The various types of addressing modes are:
• Implicit addressing mode. • Register addressing mode.
• Immediate addressing mode. • Register indirect addressing mode.
• Direct addressing mode. • Auto-increment/decrement addressing mode.
• Indirect addressing mode. • Relative addressing mode.
2
PART-B
1. Outline the von neumann architecture.(13)
Von-Neumann Model
Von-Neumann proposed his computer architecture design in 1945 which was later known as Von-Neumann
Architecture. It consisted of a Control Unit, Arithmetic, and Logical Memory Unit (ALU), Registers and
Inputs/Outputs.
Von Neumann architecture is based on the stored-program computer concept, where instruction data and
program data are stored in the same memory. This design is still used in most computers produced today.
o Buses
o Memory Unit
3
The part of the Computer that performs the bulk of data processing operations is called the Central Processing
Unit and is referred to as the CPU.
The Central Processing Unit can also be defined as an electric circuit responsible for executing the
instructions of a computer program.
The CPU performs a variety of functions dictated by the type of instructions that are incorporated in the
computer.
The major components of CPU are Arithmetic and Logic Unit (ALU), Control Unit (CU) and a variety of
registers.
The Arithmetic and Logic Unit (ALU) performs the required micro-operations for executing the instructions.
In simple words, ALU allows arithmetic (add, subtract, etc.) and logic (AND, OR, NOT, etc.) operations
to be carried out.
Control Unit
The Control Unit of a computer system controls the operations of components like ALU, memory and
input/output devices.
The Control Unit consists of a program counter that contains the address of the instructions to be fetched and
an instruction register into which instructions are fetched from memory for execution.
Registers
Registers refer to high-speed storage areas in the CPU. The data processed by the CPU are fetched from the
registers.
Following is the list of registers that plays a crucial role in data processing.
Registers Description
AC (Accumulator)
This register holds the intermediate arithmetic and logic results.
PC (Program Counter)
This register contains the address of the next instruction to be executed.
Buses
Buses are the means by which information is shared between the registers in a multiple-register configuration
system.
A bus structure consists of a set of common lines, one for each bit of a register, through which binary
information is transferred one at a time. Control signals determine which register is selected by the bus
during each particular register transfer.
4
Von-Neumann Architecture comprised of three major bus systems for data transfer.
Bus Description
Address Bus
Address Bus carries the address of data (but not the data) between the processor and
the memory.
Data Bus
Data Bus carries data between the processor, the memory unit and the input/output
devices.
Memory Unit
A memory unit is a collection of storage cells together with associated circuits needed to transfer information
in and out of the storage. The memory stores binary information in groups of bits called words. The
internal structure of a memory unit is specified by the number of words it contains and the number of bits
in each word.
5
2.What is an addressing mode? Outline the types of addressing modes with an example.(13)
6
7
3. Explain about operation and operands of computer(13)
Every computer must be able to perform arithmetic. The MIPS assembly language notation add a, b, c
instructs a computer to add the two variables b and c and to put their sum in a. This notation is rigid in
that each MIPS arithmetic instruction performs only one operation and must always have exactly three
variables. For example, suppose we want to place the sum of four variables b, c, d, and e into variable a.
Operands are definite elements of computer instruction that show what information is to be operated on. The
most important general categories of data are
1. Addresses
2. Numbers
3. Characters
4. Logical data
In many cases, some calculation must be performed on the operand reference to determine the main or virtual
memory address.
8
In this context, addresses can be considered to be unsigned integers. Other common data types are numbers,
characters, and logical data, and each of these is briefly described below. Some machines define
specialized data types or data structures. For example, machine operations may operate directly on a list
or a string of characters.
Addresses
Addresses are nothing but a form of data. Here some calculations must be performed on the operand reference
in an instruction, which is to determine the physical address of an instruction.
Numbers
All machine languages include numeric data types. Even in non-numeric data processing, numbers are
needed to act as counters, field widths, etc. An important difference between numbers used in ordinary
mathematics and numbers stored in a computer is that the latter is limited. Thus, the programmer is faced
with understanding the consequences of rounding, overflow and underflow.
Here are the three types of numerical data in computers, such as:
1. Integer or fixed point: Fixed point representation is used to store integers, the positive and negative whole
numbers (… -3, -2, -1, 0, 1, 2, 3, …). However, the programmer assigns a radix point location to each
number and tracks the radix point through every operation. High-level programs, such as C and BASIC
9
usually allocate 16 bits to store each integer. Each fixed point binary number has three important
parameters that describe it:
o The position of the radix point to the right side of the sign bit (for signed numbers), or the position of the
radix point to the most significant bit (for unsigned numbers).
o And the number of fractional bits stored.
2. Floating point: A Floating Point number usually has a decimal point, which means 0, 3.14, 6.5, and-
125.5 are Floating Point
The term floating point is derived from the fact that there is no fixed number of digits before and after the
decimal point, which means the decimal point can float. There are also representations in which the
number of digits before and after the decimal point is set, called fixed-point representations. In general,
floating-point representations are slower and less accurate than fixed-point representations, but they can
handle a larger range of numbers.
3. Decimal number: The decimals are an extension of our number system. We also know that decimals can
be considered fractions with 10, 100, 1000, etc. The numbers expressed in the decimal form are called
decimal numbersor decimals. For example:1, 4.09, 13.83, etc. A decimal number has two parts, and a dot
separates these parts (.) called the decimal point.
o Whole number part: The digits lying to the left of the decimal point form the whole number part. The
places begin with ones, tens, hundreds, thousands and so on.
o Decimal part: The decimal point and the digits laying on the right of the decimal point form the decimal
part. The places begin with tenths, hundredths, thousandths and so on.
Characters
A common form of data is text or character strings. While textual data are most convenient for humans. But
computers work in binary. So, all characters, whether letters, punctuation or digits, are stored as binary
numbers. All of the characters that a computer can use are called character sets. Here are the two common
standards, such as:
ASCII uses seven bits, giving a character set of 128 characters. The characters are represented in a table
called the ASCII table. The 128 characters include:
o 26 upper-case letters
o 26 lower-case letters
Logical data
10
Normally, each word or other addressable unit (byte, half-word, and so on) is treated as a single unit of data.
Sometimes, it is useful to consider an n-bit unit consisting of 1-bit items of data, each item having the
value 0 or 1. When data are viewed this way, they are considered to be logical data.
The Boolean data can only represent two values: true or false. Although only two values are possible, they
are rarely implemented as a single binary digit for efficiency reasons. Many programming languages do
not have an explicit Boolean type, instead of interpreting 0 as false and other values as true. Boolean data
refers to the logical structure of how the language is interpreted to the machine language. In this case, a
Boolean 0 refers to the logic False, and true is always a non zero, especially one known as Boolean
11
Disadvantages of CISC
• Slower execution: CISC processors take longer to execute instructions because they have more
complex instructions and need more time to decode them.
• More complex design: CISC processors have more complex instruction sets, which makes them more
difficult to design and manufacture.
• Higher power consumption: CISC processors consume more power than RISC processors because
of their more complex instruction sets.
CPU Performance
Both approaches try to increase the CPU performance
• RISC: Reduce the cycles per instruction at the cost of the number of instructions per program.
CPU Time
• CISC: The CISC approach attempts to minimize the number of instructions per program but at the
cost of an increase in the number of cycles per instruction.
Earlier when programming was done using assembly language, a need was felt to make instruction do more
tasks because programming in assembly was tedious and error-prone due to which CISC architecture
evolved but with the uprise of high-level language dependency on assembly reduced RISC architecture
prevailed.
RISC vs CISC
RISC CISC
An instruction executed in a single clock cycle Instruction takes more than one clock cycle
An instruction fit in one word. Instructions are larger than the size of one word
Simple and limited addressing modes. Complex and more addressing modes.
12
RISC CISC
Here, Addressing modes are less. Here, Addressing modes are more.
13
5.(i)Discuss the interaction between assembly language and high level language. (6)
14
15
5.(ii) Discuss about instruction cycle (6)
In computer organization, an instruction cycle, also known as a fetch-decode-execute cycle, is the basic
operation performed by a central processing unit (CPU) to execute an instruction. The instruction
cycle consists of several steps, each of which performs a specific function in the execution of the
instruction. The major steps in the instruction cycle are:
1. Fetch: In the fetch cycle, the CPU retrieves the instruction from memory. The instruction is typically
stored at the address specified by the program counter (PC). The PC is then incremented to point to
the next instruction in memory.
2. Decode: In the decode cycle, the CPU interprets the instruction and determines what operation needs
to be performed. This involves identifying the opcode and any operands that are needed to execute the
instruction.
3. Execute: In the execute cycle, the CPU performs the operation specified by the instruction. This may
involve reading or writing data from or to memory, performing arithmetic or logic operations on data,
or manipulating the control flow of the program.
4. There are also some additional steps that may be performed during the instruction cycle, depending on
the CPU architecture and instruction set:
5. Fetch operands: In some CPUs, the operands needed for an instruction are fetched during a separate
cycle before the execute cycle. This is called the fetch operands cycle.
6. Store results: In some CPUs, the results of an instruction are stored during a separate cycle after the
execute cycle. This is called the store results cycle.
7. Interrupt handling: In some CPUs, interrupt handling may occur during any cycle of the instruction
cycle. An interrupt is a signal that the CPU receives from an external device or software that requires
immediate attention. When an interrupt occurs, the CPU suspends the current instruction and executes
an interrupt handler to service the interrupt.
These cycles are the basic building blocks of the CPU’s operation and are performed for every
instruction executed by the CPU. By optimizing these cycles, CPU designers can improve the
performance and efficiency of the CPU, allowing it to execute instructions faster and more efficiently.
The Instruction Cycle –
Each phase of Instruction Cycle can be decomposed into a sequence of elementary micro-operations. In
the above examples, there is one sequence each for the Fetch, Indirect, Execute and Interrupt Cycles.
16