Search This Blog

Showing posts with label Computer Architecture. Show all posts
Showing posts with label Computer Architecture. Show all posts
Wednesday, 8 May 2013

Resources for Learning the Architecture of a Computer

0 comments

Resources for Learning the Subject - COA

Following are resources for Teaching and Learning the Subject - Computer Organization and Architecture:
  1. Presentation on Architecture of a Digital Computer.
  2. Digital Notes on Fundamentals of Computer Architecture
  3. Lecture Notes on Memory Management 
  4. Lecture Notes on Hazards in Pipelining
  5. A Post on Organization of a Digital Computer



Continue reading →
Tuesday, 7 May 2013

Previous Year Question Paper on COA

0 comments
Anna University Chennai
B.E./B.Tech. DEGREE EXAMINATION, MAY/JUNE 2012
Fourth Semester
Computer Science and Engineering
CS 2253/141403/CS 43/CS1252 A/10144 CS 404/080250011  
COMPUTER ORGANISATION AND ARCHITECTURE
(Regulation 2008)

PART A-(10*2 = 20 MARKS)

1. What is SPEC? Specify the formula for SPEC rating.

     SPEC is a nonprofit consortium of 22 major computer vendors whose common goals are “to provide the industry with a realistic yardstick to measure the performance of advanced computer systems” and to educate consumers about the performance of vendors’ products. SPEC creates, maintains, distributes, and endorses a standardized set of application-oriented programs to be used as benchmarks. The formula for SPEC rating is as follows:

     SPEC rating (ratio) = TR / TC;
     where,
          TR = Running time of the Reference Computer;
          TC = Running time of the Computer under test;

     If the SPEC rating = 50 means that the computer under test is 50 times as fast as the ultra sparc 10. This is repeated for all the programs in the SPEC suit, and the geometric mean of the result is computed.

2. What is relative addressing mode? When is it used?  

     In relative addressing mode, we can specify only a constant (offset) for accessing the address of an operand. The address is calculated by adding the constant to the current value of the PC. On many machines, the target address within the machine code for branch instructions is done this way. The MIPS architecture does this. 

3. Write the register transfer sequence for storing a word in memory.

     The procedure of writing a word into memory location is similar to that for reading one from memory. The only difference is that the data word to be written is first loaded into the MDR, the write command is issued.

     As an example assumes that the data word to be stored in the memory is in register R1 and that the memory address is in register R2. The memory write operation requires the following sequence:
  1. MAR <-- [R2]
  2. MDR <-- [R1]
  3. Write
  4. Wait for MFC
4. What is hard-wired control? How is it different from micro-programmed control? 

     A hardwired control unit has a processor that generates signals or instructions to be implemented in correct sequence. This was the older method of control that works through the use of distinct components, drums, a sequential circuit design, or flip chips. It is implemented using logic gates & flip flops. It is faster, less flexible & limited in complexity

     A micro programmed control unit on the other hand makes use of a micro sequencer from which instruction bits are decoded to be implemented. It acts as the device supervisor that controls the rest of the subsystems including arithmetic and logic units, registers, instruction registers, off-chip input/output, and buses. It is slower, more flexible & greater complexity

5. What is meant by data and control hazards in pipelining?
     Data hazards are also known as data dependency. Data dependency is the condition in which the outcome of the current operation is dependent on the outcome of a previous instruction that has not yet been executed to completion because of the effect of the pipeline.

     Control hazard is caused by uncertainty of execution path, branch taken or
not taken. It is a hazard that arises when an attempt is made to make a decision before condition is evaluated. It results when we branch to a new location in the program, invalidating everything we have loaded in our pipeline.

6. What is meant by speculative execution?

7. What is meant by an interleaved memory?

8. An address space is specified by 24 bits and the corresponding memory space by 16 bits: How mmany words are in the
     (a) virtual memory
     (b) main memory

9. Specify the different I/O transfer mechanisms available.

10. What does isochronous data stream means?


PART B-(5*16 = 80 marks)

11. (a) (i) What are addresing modes? Explain the various addressing modes with examples. (8)
          (ii) Derive and explain an algorithm for adding and substracting 2 floating point binary numbers (8)
Or
(b) (i) Explain instruction sequencing in detail. (10)
    (ii) Differentiate RISC and CISC architectures. (6)


12. (a) (i) With a neat diagram explain the internal organisation of a processor. (6)
          (ii) Explain how control signals are generated using microprogrammed control. (10)
Or
(b) (i) Explain the use of multiple-bus organisation for executing a three-operand instruction. (8)
    (ii) Explain the design of hardwired control unit. (8)


13. (a) (i) Discus the basic concepts of pipelining. (8)
          (ii) Describe the data path and control considerations for pipelining. (8)
Or
      (b) Describe the techniques for handling data and instruction hazards in pipelining. (16)


14. (a) (i) Explain synchronous DRAM technology in detail. (8)
          (ii) In a cache-based memory system using FIFO for cache page replacement, it is found that the cache hit ratio H is low. The following proposals are made for increasing.
            (1) Increase the cache page size.
            (2) Increase the cache storage capacity.
            (3) Increase the main memory capacity.
            (4) Replace the FIFO replacement policy by LRU.
Analyse each proposal to determine its probable impact on H. (8)
Or
(b) (i) Explain the varios mapping techniques associated with cache memories. (10)
    (ii) Explain a method of translating virtual address to physical address. (6)


15. (a) Explain the following:
          (i) Interrupt priority schemes. (8)
         (ii) DMA. (8)
Or
      (b) Write an elaborated note on PCI, SCSI and USB bus standards. (16)
Continue reading →
Tuesday, 12 February 2013

A Test on the Basic of Computer Organization and Architecure

0 comments

FAQ on the Basics of Computer Organization and Architecture

(Follow the Link to download some useful material for answering this Test)
Two Marks (2 x 5 = 10)
1.      What does the term hertz refer to?
2.      Compare RISC with CISC architecture.
3.      Under what situations the micro program counter is not incremented after a
new instruction is fetched from micro program memory?
4.      What is virtual memory and what are the benefits of virtual memory?
5.      How is the number 25 represented in BCD and ASCII code?
Big Questions (8 + 16 + 16 = 40)
1.         Describe the role of system software to improve the performance of
a computer.                                                                                                                      (8)
(OR)
2.         Draw the diagram of the single Bus Organization of the data
path inside a processor.                                                                                                    (8)

3.         a)  Describe the connections between the processor and memory with a
neat structure diagram.                                                                                                    (8)
b)  What are the special registers in a typical computer? Explain their
purposes in detail.                                                                                                            (8)
(OR)
4.         Explain in detail various addressing modes used in an Instruction Set Architecture (ISA)
(16)

5.         a)  Examine the relationships between pipeline execution and
addressing modes.                                                                                                           (8)
b)  Draw and explain the block diagram of a complete processor.                                  (8)
(OR)
6.         Explain in detail how Instructions are encoded.                                                                         (16)

ALL THE BEST!
Continue reading →
Wednesday, 6 February 2013

Test Your Knowledge on Processor & Memory

0 comments

Self Evaluation Test

Two Marks (2 x 7 = 14)
  1. What is Byte Addressing?
  2. How does the Processor Load and Store operations?
  3. What is ISA?
  4. Classify Addressing Modes.
  5. Differentiate CISC and RISC.
  6. Write an assembly language program to add N numbers.
  7. What are the various operations performed by the ALU.
Big Question  (1 x 16 = 16)
1    a) Discuss in detail the different kinds of Addressing Modes with an example.  (10)
b) List and explain the steps involved in the execution of a complete instruction.  (6)
Continue reading →
Tuesday, 5 February 2013

Use of Addressing Modes in Assembly Language

1 comments

Addressing Modes
            A program is a set of instructions that operate on data that reside in the computer's memory.  Programs are normally written in a high-level language, which enables the programmer to use constants, local and global variables, pointers, and arrays.  When translating a high-level language program into assembly language, the compiler must be able to implement these constructs using the facilities provided in the instruction set of the computer in which the program will be run.  The different ways in which the location of an operand is specified in an instruction are referred to as addressing modes.

Implementation of Variables and Constants:
            Variables and constants are the simplest data types and are found in almost every computer program.  In assembly language, a variable is represented by allocating a register or a memory location to hold its value.  The  addressing modes that are used for specifying the constants and variables in an assembly language are: Immediate mode, Register mode and Absolute mode.
            Constant values are used frequently in high-level language programs.  For example, the statement
                                    A = B + 6
contains the constant 6.  Assuming that A and B have been declared earlier as variables and may be accessed using the Absolute mode, this statement may be compiled as follows:
                                    Move B, R1
                                    Add #6, R1
                                    Move R1, A
            In the above example, the first instruction Move B, R1 uses two addressing modes to access the variable B.  Normally, operands available in a variable are accessed by specifying the name of the register or the address of the memory location where the operand is located.  By moving the content of the variable B into the register R1, the first operand is accessed in the first instruction.  Now R1 contains the first operand.
The two addressing modes used for this purposes are explained here:
Register mode:  The operand is the contents of a processor register; the name (address) of the register is given in the instruction.
Absolute mode: The operand is in a memory location; the address of this location is given explicitly in the instruction as in the instruction given below:
                                    Move LOC, R2
            In Immediate mode, the operand is given explicitly in the instruction.  For example, the instruction:
                                    Add 6immediate, R1
adds the value 6 with the content of R1.  Clearly, the Immediate mode is only used to specify the value of a source operand.  Using a subscript to denote the Immediate mode is not appropriate in assembly languages.  A common convention is to use the sharp sign (#) in front of the value to indicate that this value is to be used as an immediate operand.  Hence we write the instruction above in the form
                                    Add #6, R1

Indirection and Pointers:
            In indirect mode of addressing, the instruction does not give the operand or its address explicitly.  Instead, it provides information from which the memory address of the operand can be determined.  We refer to this address as the effective address (EA) of the operand.  We denote indirection in an instruction by placing the name of the register or the memory address in parentheses as illustrated below:
                                    Move (A0), DO
            In this instruction, the address of the first operand is specified in the register A0, which is used for fetching it and then moving it into the register DO for further processing.
           

             Thus in the  indirect mode, the effective address of the operand is the contents of a register or memory location whose address address appears in the instruction.  The register or memory location that contains the address of an operand is called a pointer.  Indirection and the use of pointers are important and powerful concepts in programming.  The following program illustrates the use of indirect addressing in programming:
                                    Move N, R1
                                    Move #2000, R2
                                    Clear R0
                                    Add (R2), R0
                                    Add #4, R2
                                    Decrement R1
                                    Branch>0 LOOP
                                    Move R0, SUM
            In this program, Indirect addressing is used to access successive numbers in the list.  Register R2 is used as a pointer to the numbers in the list, and the operands are accessed indirectly through R2.  The initialization section of the program loads the counter value n from memory location N into R1 and uses the Immediate addressing mode to place the address value 2000, which is the address of the first number in the list, into R2.  Then it clears R0 to 0.
            The first two instruction in the loop:
                        Add (R2), R0
                        Add #4, R2
implement the unspecified instruction block starting at LOOP.  The first time through the loop, the instruction
                        Add (R2), R0
fetches the operand at location 2000 and adds it to R0.  The second Add instruction adds 4 to the contents of the pointer R2, so that it will contain the address value of the next number in the list.  After each iteration is over, the value of R1, which acts as a counter is decremented and checked if it reaches the value 0.  Till it reaches the value zero, the process is repeated to find the sum of all the items in the list.

Indexing and Arrays:
            The next addressing mode is Index mode, which is useful in dealing with lists and arrays.  In this addressing mode, the effective address of the operand is generated by adding a constant value to the contents of a register.  The register used may be a special register for this purpose, or more commonly, it may be any one of a set of general-purpose registers in the processor.  In either case, it is referred to as an index register.
            We indicate the Index mode symbolically as:
                        X(Ri)
where X denotes the constant value contained in the instruction and Ri is the name of the register involved.  The effective address of the operand is given by:
                        EA = X + [Ri]
            The contents of the index register are not changed in the process of generating the effective address.  In an assembly language program, the constant X may be given either as an explicit number or as a symbolic name representing a numerical value.
            There are two ways of using the Index mode:
1.      Offset is given as a constant
2.      Offset is in the index register
            Consider the example:
                        Add 20(R1), R2
            In this example, offset is given as a constant (20).  The effective address is calculated by adding the constant 20 with the content of the register R1 (1000), which is equivalent to 1020 (20 + 1000).  The following example illustrates the use of second method:
                        Add 1000(R1), R2
            In this instruction, the offset value is given in the register R1, which may contain the value 20.  Now, the effective address is calculated by adding 1000 with 20, which results in 1020.  The following sample assembly program illustrates the use of Index addressing in accessing a list of test scores:
                                    Move #LIST, R0
                                    Clear R1
                                    Clear R2
                                    Clear R3
                                    Move N, R4
            LOOP             Add 4(R0), R1
                                    Add 8(R0), R2
                                    Add 12(R0), R3
                                    Add #16, R0
                                    Decrement R4
                                    Branch>0 LOOP
                                    Move R1, SUM1
                                    Move R2, SUM2
                                    Move R3, SUM3
Continue reading →
Saturday, 2 February 2013

System Software - The Interface Between Computer and Its User

1 comments

Hardware – Software Interface

  • In order to load and run an application program in a CPU, the computer must already have some system software running in its memory. 
  • An Operating System is a system software, which is responsible for the coordination of all activities in a computing system.
  • A System software is a collection of programs that are executed as needed to perform functions such as:
    1. Receiving and interpreting user commands like a command prompt
    2. Entering and editing application programs and storing them as files in secondary storage devices such as a text editor
    3. Managing the storage and retrieval of files in secondary storage devices
    4. Running standard application programs such as word processor, spreadsheets, or games, with data supplied by the user
    5. Controlling I/O units to receive input information and produce output results
    6. Translating programs from source form prepared by the user into object form consisting of machine instructions
    7. Linking and running user-written application programs with existing standard library routines, such as numerical computation packages

Need for Compiler:

  • Application programs are usually written in a high-level programming language, such as C, C++, Java, or Fortran, in which the programmer specifies mathematical or text-processing operations. 
  • These operations are described in a format that is independent of the particular computer used to execute the program.
  • A programmer using a high-level language need not know the details of machine program instructions.
  • A system software program called a compiler translates the high-level language program into a suitable machine language program containing instructions such as the Add and Load instructions that can be understood by the CPU

Need for Text Editor:

    • Another important system program that all programmers use is a text editor, which is used for entering and editing application programs. 
    • Text editor allows the statements of a source program to be entered through a keyboard and accumulated in a file
    • A file is simply a sequence of alphanumeric characters or binary data that is stored in memory or in secondary storage. 
    • A file can be referred to by a name chosen by the user.
    Operating System (OS):
    • Operating System (OS) is a large program, or actually a collection of routines, that is used to control the sharing of and interaction among various computer units as they execute application program. 
    • The OS routines perform the tasks required to assign computer resources to individual application programs. These tasks include the following:
      1. Assigning memory and magnetic disk space to program and data files
      2. Moving data between memory and disk units and
      3. Handling I/O operations
    • In order to understand the basics of operating systems, let us consider a system with one processor, one disk, and one printer.  
    • Assume that an application program which involves reading a data file from the disk into the memory, performing some computation on the data, and printing the result.
    • The program has been compiled from a high-level language form into a machine language form and stored on the disk. 
    • Now, the OS performs the execution of the program as follows:
      1. The first step in executing this program is to transfer this file into main memory. 
      2. When the transfer is complete, execution of the program begins by the CPU
      3. When the execution of the program reaches the point where the data file is needed, the program requests the Operating System (OS) to transfer the data file from the disk to memory. 
      4. The OS performs the transfer of file from memory and passes execution control back to the application program, which then proceeds to perform the required computation. 
      5. When the computation is over and the results are ready to be printed, the application program again sends a request to the OS. 
      6. The OS runs a routine which will cause the printer to print the result.
    Continue reading →
    Wednesday, 30 January 2013

    Test Your Knowledge on Basics of Computers

    0 comments

    FAQ on Basics of Computer Architecture



    Two Marks: (2 x 5 = 10)
    1. Define Computer.
    2. Differentiate between Program and Data.
    3. Identify various internal hardware devices of a computer.
    4. What is the need for Cache Memory in a computer.
    5. Define System Bus.
    Big Question: (1 x 10 = 10)
    1. a) Classify Computer.
      b) Write in detail the basic operational concept of a Digital Computer.
    Continue reading →
    Tuesday, 29 January 2013

    Metrics for Measuring the Performance of a Computer

    0 comments

    Performance Measurement

    The most important measure of the performance of a computer is its speed of execution.  The speed with which a computer executes programs is affected by the design of its hardware and its machine language instructions.  The time required for executing a computer program is affected mainly by the speed of the processor, the main memory and the hard disk.

    Generally, performance describes how quickly a given system can execute a program (called execution time).  Systems that execute programs in less time are said to have high performance.  In order to find out the performance of a computer, computer architects have come up with a variety of metrics.  Some of them are discussed here:

    Million Instructions Per Second (MIPS):

                An early measure of computer performance was the rate at which a given machine executed instructions.  This is calculated by dividing the number of instructions executed in running a program by the time required to run the program and typically expressed in millions of instructions per second (MIPS).

    CPI/IPC:

    Another metric used to describe computer performance is the number of clock cycles required to execute each instruction, known as cycles per instruction, or CPI.  The CPI of a given program on a given system is calculated by dividing the number of clock cycles required to execute the program by the number of instructions executed in running the program.  For systems that can execute more than one instruction per cycle, the number of instructions executed per cycle, or IPC, is often used instead of CPI.  IPC is calculated by dividing the number of instructions executed in running a program by the number of clock cycles required to execute the program.
               
    Suppose 100-instruction loop is executed 42 times, the total number of instructions executed is 100 x 42 = 4200.  It takes 16,000 cycles to execute the program, so the CPI is 16,000/4200 = 3.81.  That means 3.81 (around 4 cycles) are required to execute a single machine instruction.  To compute the IPC, we divide 4200 instructions by 16,000 cycles, getting an IPC of 0.26.

    Processor Clock:

    Processor circuits are controlled by a timing signal called a clock.  The clock defines regular time intervals, called clock cycles.  To execute a machine instruction, the processor divides the action to be performed into a sequence of basic steps (e.g., fetch, decode etc.), such that each step can be completed in one clock cycle.  The length P of one clock cycle is an important parameter that affects processor performance.

    Clock Rate:

    The inverse of P (1/P) is the clock rate (R), which is measured in cycles per second.  Processors used in today’s personal computers and workstations have clock rates that range from a few hundred million to over a billion cycles per second.  In standard electrical engineering terminology, the term “cycles per second” is called hertz (Hz).  The term “million” is denoted by the prefix Mega (M), and “billion” is denoted by the prefix Giga (G).

    Basic Performance Equation:

    Let T be the processor time required to execute a program that has been prepared in some high-level language.  The elapsed time (T) is totally depend on all units in a computer system, which includes processor, memory and I/O devices).  The compiler generates a machine language object program that corresponds to the source program.  

    Assume that the complete execution of the program requires the execution of N machine language instructions.  The number N is the actual number of instruction executions, and is not necessarily equal to the number of machine instructions in the object program.  Some instructions may be executed more than once, which is the case for instructions inside a program loop.  Others may not be executed at all, depending on the input data used.

    Suppose that the average number of basic steps needed to execute one machine instructions is S, where each basic step is completed in one clock cycle.  If the clock rate is R cycles per second, the program execution time is given by:


    This is often referred to as the basic performance equation.  To achieve high performance, the computer designer must seek ways to reduce the value of T, which means reducing N and S, and increasing R.

    The value of N is reduced if the source program is compiled into fewer machine instructions.  The value of S is reduced if instructions have a smaller number of basic steps to perform or if the execution of instructions is overlapped.  Using a higher-frequency clock increases the value of R, which means that the time required to complete a basic execution step is reduced.


    Continue reading →
    Tuesday, 22 January 2013

    FAQ on Computer Hardware and Software

    2 comments

    FAQ on Basics of Computer Organization

    1. Define Computer.
    Computer is a fast electronic calculating machine that accepts digitized input information, processes it according to a list of internally stored instructions, and produces the resulting output information. The list of instructions is called a computer program, and the internal storage is called computer memory.

    2. Define Hardware and Software.
    Software, or program enables a computer to perform specific tasks, as opposed to the physical components of the system (hardware). This includes application software such as a word processor, which enables a user to perform a task, and system software such as an operating system, which enables other software to run properly, by interfacing with hardware and with other software or custom software made to user specifications.
    Computer hardware is the physical part of a computer, including the digital circuitry, as distinguished from the computer software that executes within the hardware. The hardware of a computer is infrequently changed, in comparison with software and data, which are "soft" in the sense that they are readily created, modified or erased on the computer.

    3. What are the various functions units of a computer? How do they work together to achieve a task in a computer?
    A computer consists of five functionally independent main parts: input, memory, arithmetic and logic, output and control units. The input unit accepts coded information from human operators, from electromechanical devices such as keyboards, or from other computers over digital communication lines. The information received is either stored in the computer's memory for later reference or immediately used by the arithmetic and logic circuitry to perform the desired operations. The processing steps are determined by a program stored in the memory. Finally, the results are sent back to the outside world through the output unit.
    4. Differentiate between Program and Data.
    A list of instructions that perform a task is called a program. Usually the program is stored in the memory. The processor then fetches the instructions that make up the program from the memory, one after another, and performs the desired operations.
    Data are numbers and encoded characters that are used as operands by the instructions. The term data, however, is often used to mean any digital information. Within this definition of data, an entire program (that is , a list of instructions) may be considered as data if it is to be processed by another program.

    5. List various I/O devices.
    The following are either standard or very common I/O devices:
    Input devices
    • Text input devices
    Keyboard
    • Pointing devices
    Mouse
    Trackball
    • Gaming devices
    Joystick
    Game pad
    Game controller
    • Image, Video input devices
    Image scanner
    Webcam
    • Audio input devices
    Microphone
    Output devices
    • Image, Video output devices
    Printer: Peripheral device that produces a hard copy. (Inkjet, Laser)
    Monitor: Device that takes signals and displays them. (CRT, LCD)
    • Audio output devices
    Speakers: A device that converts analog audio signals into the
    equivalent air vibrations in order to make audible sound.


    Headset: A device similar in functionality to that of a regular
    telephone handset but is worn on the head to keep the hands free.

    6.List down the basic operations of a computer.
    The operation of a computer can be summarized as follows:
    1. The computer accepts information in the form of programs and data through an input unit and stores it in memory.
    2. Information stored in the memory is fetched, under program control, into an arithmetic and logic unit, where it is processed.
    3. Processed information leaves the computer through an output unit.
    4. All activities inside the machine are directed by the control unit.

    7. Identify the various internal hardware devices of a computer.
    Motherboard or system board holding the following parts:
    1. Central processing unit (CPU)
    2. Computer fan - used to cool down the CPU
    3. Random Access Memory (RAM) - for program execution and short term data storage, so the computer does not have to take the time to access the hard drive to find the file(s) it requires. More RAM will normally contribute to a faster PC. RAM is almost always removable as it sits in slots in the motherboard, attached with small clips. The RAM slots are normally located next to the CPU socket.
    4. Basic Input-Output System (BIOS) or Extensible Firmware Interface (EFI) in some newer computers
    5. Buses
    6. Power supply - a case that holds a transformer, voltage control, and (usually) a
    7. Storage controllers of IDE, SATA, SCSI or other type, that control hard disk,
    8. Floppy disk, CD-ROM and other drives; the controllers sit directly on the
    9. Video display controller that produces the output for the computer display. This will either be built into the motherboard or attached in its own separate slot (PCI,PCI-E or AGP), requiring a Graphics Card.
    10. Computer bus controllers (parallel, serial, USB, FireWire) to connect the computer to external peripheral devices such as printers or scanners
    11. Hard disk - for medium-term storage of data.
    12. Sound card - translates signals from the system board into analog voltage levels, and has terminals to plug in speakers.
    13. Networking components like Modem or Network card for for connecting the computer to the Internet and/or other computers
    14. Expansion slots for connecting any other peripherals

      Click here for downloading presentations related to this.
    Continue reading →