Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

AdityaRoyKarmakar - 201001102018 (Comp Org. Assignment-2)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

ASSIGNMENT 2

NAME OF THE STUDENT : ADITYA ROY KARMAKAR

STUDENT ID : 201001102018

STREAM : BCA(H)

BATCH : BCA 1

SEMESTER NO. : 2

SUBJECT : COMPUTER ORGANIZATION

DATE : 25/07/2021
1. What is a Number System? How many types of Number
Systems are there in Computer arithmetic?

Ans: A number system is defined as the representation of numbers by using


digits or other symbols in a consistent manner. The value of any digit in a
number can be determined by a digit, its position in the number, and the base
of the number system. The numbers are represented in a unique manner and
allow us to operate arithmetic operations like addition, subtraction, and
division.
There are different types of number systems in which the four main types are:
● Binary number system (Base - 2)
● Octal number system (Base - 8)
● Decimal number system (Base - 10)
● Hexadecimal number system (Base - 16)

2. Briefly describe the Octal Number system. How to convert a


number with an Octal base to a Decimal number? State with
an example.

Ans: The octal number system uses eight digits: 0,1,2,3,4,5,6 and 7 with the
base of 8. The advantage of this system is that it has lesser digits when
compared to several other systems, hence, there would be fewer
computational errors. Numbers like 8 and 9 are not included in the octal
number system. Just as the binary, the octal number system is used in
minicomputers but with digits from 0 to 7.

An octal number can be converted to a decimal number by following simple


rules.
● Step 1: Find out the number of digits in the number.
● Step 2: Let the number have n digits.
● Step 3: Think of the digits nth position from the right to the left as the
position. This means you are showing the position of each digit as an
increasing power of 8.
● Step 4: Multiply each digit with 8n-1, n being the position.
● Step 5: Add all the individual results from this multiplication process.
● Step 6: The result will be the decimal equivalent of the given octal number.

EXAMPLE :
7268 = 7×82 + 2×81 + 6×80

= 448 + 16 + 6

= 47010

3. State the significance of Signed Magnitude notation in the


Number system. Discuss the disadvantages of SM numbers.

Ans: The sign-magnitude binary format is the simplest conceptual format. In


this method of representing signed numbers, the most significant digit (MSD)
takes on extra meaning.
● If the MSD is a 0, we can evaluate the number just as we would any
normal unsigned integer. And also we shall treat the number as a
positive one.
● If the MSD is a 1, this indicates that the number is negative.
The other bits indicate the magnitude (absolute value) of the number. Some of
the signed decimal numbers and their equivalent in SM notation follow
assuming a word size of 4 bits.
Disadvantages :
● There are two notations for 0(0000 and 1000), which is very
inconvenient when the computer wants to test for a 0 result.
● It is not convenient for the computer to perform arithmetic.

4. Differentiate between Fixed point and Floating point


numbers in Number System.

Ans:
FIXED POINT FLOATING POINT

A representation of real data type A formulaic representation of a real


for a number that has a fixed number as an approximation so as to
number of digits after the radix support a trade-off between range
point. and precision.

Used to represent a limited range of Used to represent a wide range of


values. values.

Higher Performance. Lower Performance.

Less Flexible More Flexible.

5. Define the key differences between 1’s complement and


2’scomplement representation of a number. Perform the
subtraction in 2’s complement : (110101)2 – (0100111)2 ,(111)2 -
(01011)2.

Ans:

1’s complement 2’s complement

To get 1’s complement of a binary To get 2’s complement of a binary


number, simply invert the given number, simply invert the given
number. number and add 1 to the least
significant bit (LSB) of the given result.

1’s complement of binary 2’s complement of binary


number 110010 is 001101 number 110010 is 001110

A simple implementation that uses Uses NOT gate along with full adder for
only NOT gates for each input each input bit.
bit.

Can be used for signed binary Can be used for signed binary
number representation but is not number representation and is most
suitable as an ambiguous suitable as an unambiguous
representation for number 0. representation for all numbers.
0 has two different representations 0 has only one representation for -0
one is -0 (e.g., 1 1111 in five-bit register), and
and the second is +0 (e.g., 0 0000 +0 (e.g., 0 0000 in the five-bit
in a five-bit register). register).
Zero (0) is considered as always
positive (sign bit is 0)

For the k bits and registers, the For the k bits and registers, the positive
positive largest number that can largest number that can be stored is
be stored is(2(k-1)-1) and the (2(k-1)-1) and the negative lowest
negative lowest number that can number that can be stored is -(2(k-1)).
be stored is -(2(k-1)-1).

end-around-carry-bit addition occurs end-around-carry-bit addition does


in 1’s complement arithmetic not occur in 2’s complement
operations. It added to the LSB of the arithmetic operations. It is ignored.
result.

1’s complement arithmetic operations 2’s complement arithmetic


are not easier than 2’s complement operations are much easier than 1’s
because of the addition of complement because there is no
end-around-carry-bit. addition of
end-around-carry-bit.

Sign extension is used for converting Sign extension is used for converting
a signed integer from one size to a signed integer from one size to
another. another.
(110101)2 – (0100111)2 :
(111)2 - (01011)2 :
6. What do you understand by Computer Instruction? Define
Instruction cycle in computer organization.
Ans: Computer instructions are a set of machine language instructions that
a particular processor understands and executes. A computer performs tasks on
the basis of the instruction provided. An instruction comprises groups called
fields.
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 for each instruction.

Each computer's CPU can have different cycles based on different instruction sets,
but will be similar to the following cycle:

1. 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.
2. Decode Stage: During this stage, the encoded instruction presented in the
instruction register is interpreted by the decoder.
3. 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.
4. 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.
5. Repeat Cycle

7. Differentiate between Direct addressing mode and Indirect


addressing mode with a proper diagram.

Ans:

DIRECT ADDRESSING INDIRECT ADDRESSING

Contains the actual operand in the The address field of the instruction
address field of the instruction code. holds the address of the operand.

The number of memory references The number of memory references


required is two. required is three.

Amount of address space is small. Amount of address space is large.

Additional calculation not required The additional calculation is the only


way to perform the operation.
Speed is more. Speed is less.

8. Compare and contrast between Hardwired Control unit and

Microprogrammed Control unit, part of Control Unit.

Ans:

Hardwired Control Unit Microprogrammed Control Unit

The hardwired control unit generates Microprogrammed control unit


the control signals needed for the generates the control signals with
processor using logic circuits the help of microinstructions stored
in control memory

The hardwired control unit is faster This is slower than the other as
when compared to the microinstructions are used for
microprogrammed control unit as the generating signals here
required control signals are
generated with the help of hardware

Difficult to modify as the control Easy to modify as the modification


signals that need to be generated need to be done only at the
are hard wired instruction level
Costlier as everything has to be Less costly than hardwired control as
realized in terms of logic gates only microinstructions are used for
generating control signals

It cannot handle complex instructions It can handle complex instructions


as the circuit design for it becomes
complex

An only a limited number of Control signals for many instructions


instructions are used due to the can be generated
hardware implementation

9. Define the significance of Pipelining in Computer


organization. State the types of the same.

Ans: Pipelining is a technique where multiple instructions are overlapped


during execution. Pipeline is divided into stages and these stages are
connected with one another to form a pipe-like structure. Instructions enter
from one end and exit from another end.

Pipelining increases the overall instruction throughput.

In the pipeline system, each segment consists of an input register followed by a


combinational circuit. The register is used to hold data and a combinational
circuit performs operations on it. The output of the combinational circuit is
applied to the input register of the next segment.

It is divided into 2 categories:

1. Arithmetic Pipeline
2. Instruction Pipeline

Arithmetic Pipeline
Arithmetic pipelines are usually found in most of the computers. They are used for
floating point operations, multiplication of fixed point numbers etc. For example:
The input to the Floating Point Adder pipeline is:

X = A*2^a

Y = B*2^b
Here A and B are mantissas (significant digit of floating point numbers), while a
and b are exponents.

Instruction Pipeline

In this a stream of instructions can be executed by overlapping fetch, decode and


execute phases of an instruction cycle. This type of technique is used to increase
the throughput of the computer system.

An instruction pipeline reads instruction from the memory while previous


instructions are being executed in other segments of the pipeline. Thus we can
execute multiple instructions simultaneously. The pipeline will be more efficient if
the instruction cycle is divided into segments of equal duration.

10. State the working principle of Hardware Interrupt. State the


differences between Hardware and Software Interrupts.

Ans: Hardware interrupt is caused by any peripheral device like mouse,


keyboard, printer, etc. For example, if we are using a word processor and press a
key, the program must process the input immediately. Typing the word “Mama’’
creates five interrupts requests, which allows the program to display the letters we
typed. Similarly, each time we click a mouse button or tap on a touchscreen, we
send an interrupt signal to the device.

Hardware Interrupt Software Interrupt

A hardware interrupt is an interrupt A software interrupt is an interrupt


generated from an external device or that is generated by any internal
hardware. system of the computer.

It does not increment the program It increments the program


counter. counter.

Hardware interrupts can be invoked Software interrupts can be invoked


with some external device such as a with the help of INT instruction.
request to start an I/O or the
occurrence of a hardware failure.
It has the lowest priority than It has the highest priority among all
software interrupts interrupts.

A hardware interrupt is triggered by A software interrupt is triggered by


external hardware and is considered software and considered one of the
one of the ways to communicate with ways to communicate with kernel or
the outside peripherals, hardware. to trigger system calls, especially
during error or exception handling.

It is an asynchronous event. It is a synchronous event.

Hardware interrupts can be Software interrupts can be classified


classified into two types : 1. Maskable into two types : 1. Normal Interrupts. 2.
Interrupt. 2. Non-Maskable Exception.
Interrupt.

Keystroke depressions and All system calls are examples of


mouse movements are examples of software interrupts
a hardware interrupt.

END

You might also like