You are on page 1of 9

Question 1: Explain the working of Central Processing Unit (CPU) of a computer.

Central Processing Unit


Central Processing Unit is the heart of Computer. The basic functional components of Central processing unit is shown in Fig.

Its major structural components are Control unit, ALU, Registers and CPU interconnections. Control Unit: It controls the operations of the CPU and hence the computer system. Arithmetic Logic Unit: It performs the computers data processing functions. Registers: It forms the internal memory for CPU. It provides storage internal to the CPU. CPU interconnections: It provides means for communication among the control unit, ALU and registers of the CPU.

The CPU must carry out the task given below:


The CPU must carry out the task given below. Decode them. Get operands for execution. Process the instruction. Give out / Store the result.

To carry out these tasks the CPU needs to temporarily store some data. It must remember the location of the last instruction so that it can know where to get the next instruction. It needs to store instruction and data temporarily while an instruction is being executed. In general the CPU needs an internal memory for all store either instruction or data. The CPU contains a handful of registers which acts like local variables. The CPU runs instructions and performs computations, mostly by the ALU. The registers are the only memory the CPU has. Register memory is very fast for the CPU to access, since it resides on the CPU itself.
1

However, the CPU has rather limited memory. All the local memory it uses is in registers. It has very fast access to registers, which are on board on the CPU. It has much slower access to RAM. Question 2: How is the memory system of computer classified? Explain.

Memory System
Memory is basically a large array of bytes. Main function of a memory unit is to store the information needed by the system. Memory system of a
computer can be broadly classified into four groups.

1. Internal Memory: Internal memory refers to a set of CPU registers. These serve as working memory, storing temporary results during the computation process. They form a general purpose register file for storing the data as it is processed. Since the cost of these registers is very high only few registers can be used in the CPU. 2. Primary Memory: Primary memory is also called as main memory, which operates at electronic speeds. CPU can directly access the program stored in the primary memory. Main memory consists of large number of semiconductor storage cells. Each cell is capable of storing one bit of information. Word is a group of these cells. Main memory is organized so that the contents of one word, containing n bits, can be stored or retrieved in one basic operation. 3. Secondary Memory: This memory type is much larger in capacity and also much slower than the main memory. Secondary memory stores system programs, large data files and the information which is not regularly used by the CPU. When the capacity of the main memory is exceeded, the additional information is stored in the secondary memory. Information from the secondary memory is accessed indirectly through the I/O programs that transfer the information between the main memory and secondary memory. Examples for secondary memory devices are magnetic hard disks and CDROMs. 4. Cache Memory: The performance of a computer system will be severely affected if the speed disparity between the processor and the main memory is significant. The system performance can be improved by placing a small, fast acting buffer memory between the processor and the main memory. This buffer memory is called as cache memory. Cost of this memory is very high. Question 3: Explain the different types of computer architectures.

Computer Architecture

Computer Architecture is the art that specifies the relations and part of a computer system. There are many different kinds of computer architectures available but the three most popular computer architectures discuss below:
1. The Stack Machine: A stack machine implements a stack with

registers. The operands of the ALU are always the top two registers of the stack and the result from the ALU is stored in the top register of the stack. Examples of the stack machine include: Hewlett Packard RPN calculators and the Java Virtual Machine (JVM).

2. The Accumulator Machine: An accumulator machine has a special register, called an accumulator, whose contents are combined with another operand as input to the ALU, with the result of the operation replacing the contents of the accumulator. accumulator = accumulator [op] operand

3. The Load/Store Machine: Registers: Provide faster access but are expensive. Memory: Provides slower access but is less expensive. A small amount of high speed memory (expensive), called a register file, is provided for frequently accessed variables and a much larger but slower memory (less expensive) is provided for the rest of the program and data. (SPARC: 32 register at any one time) This is
3

based on the principle of locality" at a given time, a program typically accesses a small number of variables much more frequently than others.

Question 4: Draw the block diagram of Intel 8085 CPU organization and explain the different flag bits supported by the 8085 CPU.

Intel 8085 CPU

Intel 8085 CPU organization The different flag bits supported by the 8085 CPU are: 1. Z: It stands for Zero Flag. This bit is set when the result of ALU operation is zero. 2. S: It stands for Sign Flag. This bit is set when the result of ALU operation is negative.
4

3. P: It stands for Parity Flag. This bit is set when the result of ALU operation results in even parity. That is the result when expressed in binary has even number of ones in it. 4. CY: It stands for carry Flag. This bit is set when the result of ALU operation results in overflow. 5. AC: It stands for Auxiliary carry Flag. This bit is set when the result of ALU operation results in carry between fourth and fifth bit. The CPU of 8085 is organized around a single 8 bit internal bus. Connected to the Bus are the following components. Accumulator: Used as a temporary buffer to store input to the ALU. It is also user visible and is addressed in some instructions. Temporary Register: Used as input for ALU which is other than Accumulator. Flags: These are nothing but condition codes. The result of ALU operations are reflected back in the register as flags. Question 5: What are the different types of control lines used in computer? Explain about its functions.

Control Lines
Generally a "control" line is one which doesn't carry data, but carries a signal which controls the device. Types of Control Lines Memory Write: Causes data on the bus (data bus) to be written into the addressed location. Memory Read: Memory read: Causes data from the addressed location to be placed on the bus (data bus). I/O Write: Causes data on the data bus to be output to the addressed I/O port. I/O Read: Causes data from the addressed I/O port to be placed on the bus (data bus). Transfer ACK: Indicates that data has been accepted from or placed on the bus. Bus Request: Indicates that a module needs to gain control of the bus. Bus Grant: Indicates that a requesting module has been granted control of the bus. Interrupt Request: Indicates that an interrupt is pending. Interrupt ACK: Acknowledges that the pending interrupt has been recognized. Clock: Used to synchronize operations. Reset: Initializes all modules.

Question 6: Explain the steps to be followed for the addition of floating point numbers. Answer: Addition of Floating Point Numbers The steps of a floating point addition: 1. The exponents of the two floating-point numbers to be added are compared to find the number with the smallest magnitude. 2. The significand of the number with the smaller magnitude is shifted so that the exponents of the two numbers agree. 3. The significands are added. 4. The result of the addition is normalized. 5. Checks are made to see if any floating-point exceptions occurred during the addition, such as overflow. 6. Rounding occurs.

Example:
s=x+y

Numbers to be added are x = 1234.00 and y = 567.8 These are represented in decimal notation with a mantissa (significand) of four digits Six stages (A F) are required to complete the addition
Step X Y S A 0.1234E4 0.05678E3 B 0.12340E4 0.05678E4 0.066620E4 0.6662E3 0.6662E3 0.6662E3 C D E F

(For this example, we are throwing out biased exponents and the assumed 1.0 before the magnitude. Also all numbers are in the decimal number system and no complements are used.)

Question 7: Explain Relative addressing mode and Base Register addressing Mode with example. Answer: Relative Addressing: This is a version of displacement addressing where
R = Program counter, PC EA = A + (PC) 6

I.E.: Get operand from A cells from current location pointed to by PC.

Base Register Addressing: In this addressing mode A holds displacement


R holds pointer to base address and it may be explicit or implicit

I.E.: Segment registers in 80x86.

Question 8: What is memory interleaving? Explain it with necessary figures

Memory Interleaving
Memory interleaving divides the system into a number of modules and arranges them so that successive words in the address space are placed in different modules. If memory access requests are made for consecutive addresses, then the access will be made for different modules. Since parallel access to these modules is possible, the average rate of fetching words from the main memory can be increased.

In the figure main memory is divided into 4 different modules. When an instruction FETCH is issued by the processor, a memory access circuit creates four consecutive addresses and places them in four MARs. A memory read command reads all the four modules simultaneously and retrieves four instructions. These are sent to the processor. Thus each FETCH instruction fetches 4 consecutive instructions. One may combine interleaving and cache to reduce the speed mismatch between the cache memory and main memory. To illustrate this consider the time required for transferring a block of data from the main memory to the cache when a read miss occurs. Assume that a cache with 8word
7

blocks is used. When cache miss occurs, the block that contains desired word must be copied from the main memory into the cache. Question 9: Explain the two bus organization and its working principle.

Two Bus Structure


In this structure all the register outputs are connected to bus A, and all register inputs are connected to bus B. The bus tie G connects two buses together. When G is enabled, it transfers data on bus A to bus B and when it is disabled two buses are electrically disconnected. The temporary register Z is not required in this organization because, when bus tie G is disabled, the output of ALU can be transferred directly to the destination register.

Two Bus Structure Question 10: How are numbers represented in Computer system? Explain any number representation briefly.

Number Representations
Computers are built using logic circuits that operate on information represented by two valued electrical signals. We label the two values as 0 and 1, and we define the amount of information represented by such a signal as a bit of information, where bit stands for binary digit. The most natural way to represent a number in a computer system is by a string of bits, called a binary number. A text character can also be represented by a string of bits called a character code. We will first describe binary number representations and arithmetic operations on these numbers, and then describe character representations. There are different ways for Number Representations: Non Negative Integers Negative Integers Infinite Precision Ten's Complement
8

Finite Precision Ten's Complement Finite Precision Two's Complement Rational Numbers

Non Negative Integers: The easiest numbers representations are the Non Negative Integers. This is the same how we represent number in the decimal system. A number such as 1604 is interpreted as: 1*103 + 6*102 + 0*101 + 4*100 But there is nothing special with the base 10, so we can just as well use base 2. In base 2, each digit value is either 0 or 1, which we can represent for instance by false and true, respectively. In fact, we have already hinted at this possibility, since we usually write 0, and 1 instead of false and true. All the normal algorithms for decimal arithmetic have versions for binary arithmetic, except that they are usually simpler.

You might also like