Input Unit: Five Basic Components of Computer System

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

1.

2. A) Illustrate the basic functional units of a digital computer and functions of each unit.
B) Explain briefly the principle of carry look ahead addition. Draw the circuit diagram of 4 bit
carry look ahead adder with proper design.
c) With the help of suitable examples, differentiate between R type and I type instructions in
MIPS machine language

4. A) with examples for each, explain the addressing modes available in MIPS
B) what is micro architecture? List the state elements of MIPS processor and their functions
C) write a short note on performance analysis of computer systems

Five basic components of computer system


 Input Unit.
 Output Unit.
 Storage Unit.
 Central Processing Unit (CPU)
 Arithmetic and Logic Unit (ALU)
 Control Unit.

Input Unit
An input unit performs the following functions.
1. It accepts (or reads) the list of instructions and data from the outside world.
2. It converts these instructions and data in computer acceptable format.
3. It supplies the converted instructions and data to the computer system for
further processing.

Output Unit
Following functions are performed by an output unit.
1. It accepts the results produced by the computer which are in coded form and
hence cannot be easily understood by us.
2. It converts these coded results to human acceptable (readable) form.
3. It supplied the converted results to the outside world.
Storage Unit
the specific functions of the storage unit are to store:
1. All the data to be processed and the instruction required for processing
(received from input devices).
2. Intermediate results of processing.
3. Final results of processing before these results are released to an output
device.

Central Processing Unit (CPU)


It controls all internal and external devices, performs “Arithmetic and Logical
operations”. The operations a Microprocessor performs are
called “instruction set” of this processor. The instruction set is “hard wired” in
the CPU and determines the machine language for the CPU. The control Unit
and the Arithmetic and Logic unit of a computer system are jointly known as
the Central Processing Unit (CPU). The CPU is the brain of any computer
system.

Arithmetic And Logic Unit (ALU)


The arithmetic and logic unit (ALU) of a computer system is the place where
the actual execution of the instructions take place during the processing
operations. All calculations are performed and all comparisons (decisions)
are made in the ALU. The data and instructions, stored in the primary
storage prior to processing are transferred as and when needed to the ALU
where processing takes place.

2. In ripple carry adders, for each adder block, the two bits that are to be added are
available instantly. However, each adder block waits for the carry to arrive from its
previous block. So, it is not possible to generate the sum and carry of any block until
the input carry is known. The ith block waits for the i-1th block to produce its carry. So
there will be a considerable time delay which is carry propagation delay.
A carry look-ahead adder reduces the propagation delay by introducing more
complex hardware. In this design, the ripple carry design is suitably transformed such
that the carry logic over fixed groups of bits of the adder is reduced to two-level
logic.

Column i produces a carry out by either generating a carry out or


propagating a carry in to the carry out
– Generate (Gi) and propagate (Pi) signals for each column:
• Column i will generate a carry out if Ai AND Bi are both 1.

Gi = Ai Bi
• Column i will propagate a carry in to the carry out if Ai OR Bi is 1.

Pi = Ai + Bi
• The carry out of column i (Ci) is:
Ci = Ai Bi + (Ai + Bi )Ci-1 = Gi + Pi Ci-1
3.
There are different MIPS addressing modes. We have already seen some
examples in the previous labs.
Here are the four addressing modes:

 register addressing mode

 base addressing mode

 immediate addressing mode

 PC-relative addressing mode

In the following sections, we will examine each of these modes, observe how they
are implemented using the above formats and
introduce indexed addressing mode, which is implemented by the assembler as a
pseudo instruction.

MIPS Register addressing


The simplest addressing mode is the register addressing. Instructions using
registers execute fast because they do not have
the delay associated with memory access. But, the number of registers is limited
since only 5-bits are reserved to select a register.
Register addressing is a form of direct addressing. The value in the register is an
operand instead of being a memory address to an operand.

Now look at an example:

The following table shows some of the opcodes used by MIPS.


The value of rs, rd, rt should be the actual register number, and can fit in five bits
since there are 32 registers.

MIPS Base addressing


In the C programming language, a record or a structure can be defined.
For example:
struct marks
{
int CS100;
int Math110;
int BIOL101;
int PHYS100;
int ENGL100;
};

In base register addressing we add a small constant to a pointer held in a register.


The register may point to a structure or some other collection of data, and we need
to load a value at a constant offset from the beginning of the structure.
Because each MIPS instruction fits in one word, the size of the constant is limited
to 16 bits.
Now look at the syntax.
lw rd,i(rb)

For example, if $t0 pointed to the base of a record or structure, we could get at the
fields using
lw $t1,4($t0)
lw $t1,8($t0)
lw $t1,16($t0)
etc ...
We have used a form of base addressing with zero offset in the program length.s.

This kind of addressing is known as indirect addressing since the operand is at


the memory location whose address is in the register.

MIPS Immediate addressing


MIPS immediate addressing means that one operand is a constant within the
instruction itself.
The advantage of using it is that there is no need to have extra memory access to
fetch the operand.
But keep in mind that the operand is limited to 16 bits in size.

Now let's look at an example in our early example length.s.

The jump instruction format can also be considered as an example of immediate


addressing, since the destination is held in the instruction.
Let's look at another example from length.s.
Here is a reference for you: The Jump Instruction

MIPS PC-relative addressing


4. PC-relative addressing is used for conditional branches. The address is the
sum of the program counter and a constant in the instruction.

2) microarchitecture is the logical design of all electronic components and data paths
present in the microprocessor, laid out in a specific way that it allows for optimal execution of
instructions. In academe this is called computer organization.

MIPS State Elements


3) short note on performance analysis of computer system

Microarchitecture :
There are many ways to measure the performance of a computer
system, and marketing departments are infamous for choosing the
method that makes their computer look fastest, regardless of whether
the measurement has any correlation to real-world performance

The execution time of a program, measured in seconds, is given by

Single cycle processor

Tc = tpcq_PC + tmem +max½tRFread, tsext +tmux_


+tALU +tmem + tmux +tRFsetup

In most implementation technologies, the ALU, memory, and register


file accesses are substantially slower than other operations. Therefore, the
cycle time simplifies to
Tc = tpcq_PC + 2tmem + tRFread +tALU +tmux + tRFsetup

Micro architecture

The execution time of an instruction depends on both the number of


cycles it uses and the cycle time. Whereas the single-cycle processor performed
all instructions in one cycle, the multicycle processor uses varying
numbers of cycles for the various instructions. However, the multicycle
processor does less work in a single cycle and, thus, has a shorter cycle
time.

Pipelined processor

The pipelined processor ideally would have a CPI of 1, because a new instruction
is issued every cycle

You might also like