. ANAND INSTITUTE OF HIGHER TECHNOLOGY Chennai-603 103 DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERING CS2071 COMPUTER ARCHITECTURE 2 Marks and 16 Marks Question Bank Faculty Name: C.MAGESHKUMAR YEAR / SEMESTER: IV / VII EIE A & B UNIT I – INSTRUCTION SET ARCHITECTURE Introduction to computer architecture - Review of digital design – Instructions and addressing –procedures and data – assembly language programs – instruction set variations UNIT II – ARITHMETIC LOGIC UNIT Number representation – design of adders – design of simple ALUs – design of Multipliers and dividers – design of floating point arithmetic unit UNIT III DATA PATH AND CONTROL Instruction execution steps – control unit synthesis – microprogramming – pipelining – pipeline performance UNIT IV – MEMORY SYSTEM Main Memory concepts – types of memory – cache memory organization – secondary storage –virtual memory – paging UNIT V – I/O AND INTERFACES I/O devices – I/O programming – polling – interrupts – DMA – buses – links – interfacing – context switching – threads and multithreading TEXT BOOKS 1. B. Parhami, “Computer Architecture”, Oxford University Press, 2005. 2. Carl Hamacher, Zvonko Vranesic, Safwat Zaky, “Computer Organization”, Fifth Edition, Tata McGraw Hill, 2002 NOTE: PLEASE REFER THE TEXT BOOKS FOR PERFECTNESS OF THE ANSWERS. 1 CMageshKumar_AP_AIHT CS2071_Computer Architecture ANAND INSTITUTE OF HIGHER TECHNOLOGY Chennai-603 103 DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERING CS2071 COMPUTER ARCHITECTURE – Question Bank Faculty: C.MAGESHKUMAR Date: 15.07.2013 UNIT I – INSTRUCTION SET ARCHITECTURE CLASS: FINAL EIE A&B PART A – (2 Marks) 1. Define Computer Architecture. Computer Architecture is an area of study that deals with the computer at the interface between hardware and software. Computer Architecture deals with the structure and behavior of a computer including the information formats. Computer Architecture encompasses a set of ideas that are applicable to design or understand any computer virtually from tiniest embedded microprocessors to most powerful supercomputers 2. List out the reasons to study computer architecture. The purposes of studying architecture are To gain knowledge about designing / building a new computer To gain knowledge about designing / building a new version of computer To improve software performance To find solution with embedded computer system To purchase a new computer 3. What is computer organization? Computer organization deals with operational units and interconnections that realize computer architectural specifications. Architectural specifications refers to control signal, interface between computers, interface between CPU, memory, input/output peripherals. Microarchitecture, also known as Computer organization is a lower level, a detailed description of the system that is sufficient for completely describing the operation of all parts of the computing system, and how they are inter-connected and inter-operate in order to implement the ISA. 4. Define abstraction: Abstraction is a process by which data and program are defined with a representation similar in form to its meaning. 5. Define word In computer architecture, word can be defined as a 32-bit data element stored in a register or memory location with an address. A word is a unit of data of a defined bit length (32 bit in miniMIPS) that can be addressed and moved between storage and the computer processor. 6. Define word length Word length is defined as the total number of bits used to represent. In general 1 word equals 32 bits. Usually, the defined bit length of a word is equivalent to the width of the computer's data bus so that a word can be moved in a single operation from storage to a processor register. For any computer architecture with an eight-bit byte, the word will be some multiple of eight bits. 7. Define addressing modes. (EIE Nov’11) Addressing mode is the method by which location of an operand is specified within an instruction. The way in which the location of an operand is specified in an instruction. A method used to specify where operands are to be found and where result must go. 2 CMageshKumar_AP_AIHT CS2071_Computer Architecture 8. What are the addressing modes in MiniMIPS? MiniMIPS uses six addressing modes as follows: 1. Implied addressing mode 2. Immediate addressing mode 3. Register addressing mode 4. Base addressing 5. PC-Relative addressing. 6. Pseudo direct addressing. 9. Give an example each of zero-address, one-address, two-address, and three address instructions. The examples are as follows: 1. zero-address instruction – syscall –(control transfer) 2. One –address instruction-jump instructions Syntax: j verify where verify-holds the address of a procedure 3. Two –address instructions -mult, div, addi Syntax: mult $s0,$s1 4. Three address instructions – add,sub,and,or Syntax: add $t0, $s0,$s1 10. What is operand? (CS May’11) In computer programming languages, the definitions of operator and operand are almost the same. In computing, an operand is the part of a computer instruction which specifies what data is to be manipulated or operated on, whilst at the same time representing the data itself. In assembly language, an operand is a value (an argument) on which the instruction, named by mnemonic, operates. The operand may be a processor register, a memory address, a literal constant, or a label. 11. What is an opcode? How many bits are needed to specify 32 distinct operations? (CS May’11) An opcode (operational code) is a binary code or bit pattern that defines an operation. An opcode (operation code) is the portion of a machine language instruction that specifies the operation to be performed. Example: opcode for Addition operation is 32 100010 in binary 5 bits are needed to specify an opcode in 32 bit instruction,distinct operations 12. What is a Procedure? A procedure is a subprogram that when called or initiated performs a specific task, leading to one or more results, based on the input parameters (arguments) with which it is provided and returns to the point of call. Instruction: jal proc Opcode for jal instruction = 3 (000011) 13. What are the functions of program counter (PC)? To monitor the sequence of instruction execution To store the address of next instruction to be executed 14. What is the difference between Pseudoinstructions & Macroinstructions? Pseudoinstructions are incorporated in the design of assembler and are thus fixed for the user but macros are user defined. Pseudo instructions looks exactly like an instruction, but macro looks more like a procedure in a high level language. 15. Write down the instructions to push a value onto stack. A new data in register $t4 can be pushed onto stack by the following statements: addi $sp, $sp,-4 sw $t4,0($sp) 3 CMageshKumar_AP_AIHT CS2071_Computer Architecture 16. Write down the instructions to pop a value from the stack. The top element from the stack is copied into register $t5 by the following instructions: lw $t5, 0($sp) addi $ 17. What is the function of linker? Ensuring correct interpretation (resolution) of labels in all modules Determining the placement of text and data segments in memory Evaluating all data addresses and instruction labels. Forming an executable program with no unresolved references. 18. What is the function of loader? Determining the memory needs of the program from its header. Copying text and data from the executable program file into memory. Modifying / shifting addresses, where needed during copying. Placing program parameters onto stack. Initializing all machine registers, including stack pointer Jumping to a startup routine that calls the main routine. 19. What are the instruction set attributes? 1. Consistency 2. Orthogonality 3. Transparency 4. Ease of learning 5. Extensibility 6. Efficiency 20. What are the features of RISC architecture? Small set of instructions, each of which can be executed in approximately same amount of time. Load/Store architecture Limited addressing modes that eliminate or speed up address calculations. Simple, uniform instruction formats that facilitate extraction/decoding of various fields and allow overlap between opcode interpretation and register readout. 21. What are the advantages of CISC architecture? Economy in the number of instructions used translates to smaller storage space requirements, fewer memory accesses and more effective use of cache space. Closer correspondence between machine instructions and operations commonly found in high level languages facilitate program compilation, understanding, troubleshooting and modification. 22.List out the methods used to improve system performance. The methods used to improve system performance are 1. Processor clock 2. Basic Performance Equation 3. Pipelining 4. Clock rate 5. Instruction set 6. Compiler 23. What is Byte Addressability? Byte Addressability is used for assigning successive memory address to successive memory location. This type of assigning is used in modern computers. One byte=8 bits. Ex:32bits Address:0,4,8.... 4 CMageshKumar_AP_AIHT CS2071_Computer Architecture 24. What is meant by Bid-Endian and Little Endian? 1. The name big-Endian is used when lower byte addresses are used for the most significant bytes (the left most bytes) of the word. (most significant byte has lowest address) 2. The name little-Endian is used when lower byte addresses are used for the less significant bytes (the right most bytes) of the word. (Least significant byte has lowest address) 25. What are the steps in transforming an assembly language program to an executable program residing in memory? More abstract, machine-independent; More concrete, machine-specific, error-pronLeib; rary routines easier to write, read, debug, or maintain harder to write, read, debug, or maintain (machine language) Very High-level Assembly Machine high-level language language language Executable looabrn jtgeacustakivsgee s reter statements relip imnsnterumcotino incs , relbm ibnisntarruyc (t iho enxs), L i nker mlparnaogcguhraainmgee L o ader Mcoenmteonrty Sawnadp vv[[ii+]1 ] pretnI tvve[[miip]+==1vv][[=iit]+e 1m]p moC aaadddddd $$$222,,,$$$524,,,$$$ 522 essA 000000a48522111000222 000 llww $$1156,,04(($$ 22 )) 88cc6f22000000 04 sw $16,0($2 ) acf2000 0 sw $15,4($2 ) ac62000 4 jr $31 03e0000 8 One task = One statement = Mostly one-to-one many statements several instructions 26. What are the available instruction formats in miniMIPS? 1. Register (R) 2. Immediate (I) 3. Jump (J) Note: for q. no. 27, 28, and 29 Give the number of fields, Give the number of bits in each field and its usuage 27. Write notes on register instruction format. op rs rt rd sh fn 31 25 20 15 10 5 0 R 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits Opcode Source Source Destination Shift Opcode register 1 register 2 register amount extension Example: ADD $t0,$s0,$s1 - t0=s0+s1 28. Write notes on immediate instruction format. op rs rt operand / offset 31 25 20 15 0 I 6 bits 5 bits 5 bits 16 bits Opcode Source Destination Immediate operand or base or data or address offset Example: ADD $t0,$s0,91 - t0=s0+91 5 CMageshKumar_AP_AIHT CS2071_Computer Architecture 29. Write notes on Jump instruction format. op jump target address 31 25 0 J 6 bits 1 0 0 0 0 0 0 0 0 0 0 0 260 b0it s 0 0 0 0 0 0 1 1 1 1 0 1 Opcode Memory word address (byte address divided by 4) Example: J EIE - goto memory location named “EIE” 30. Short notes on Pseudoinstructions. Psudoinstructions allow us to formulate computations and decisions in alternative forms that are not directly supported by hardware . MiniMIPS assembler takes care of translating these alternative forms to basic form that is supported by existing hardware instruction (hardware supported instruction). Pseudoinstruction are predefined, fixed, and look like machine instructions 31. Short notes on Macroinstructions. A macroinstructions (macro) is a mechanism to give a name to an often-used sequence of instructions (shorthand notation) to avoid having a specify sequence in full each time. Macros are user-defined and resemble procedures (have arguments – input parameters) 32. How is a macro different from a procedure? Control is transferred to and returns from a procedure After a macro has been replaced, no trace of it remains. 33. What are the different data types? In miniMIPS, there are 3 datasize as follows, 1. Byte –8 bits 2. Word – 4 bytes (32 bits) 3. Double word – 8 bytes (64 bits) S.no. Data types Datasize 1 Signed integer byte word - 2 Unsigned integer byte word - 3 Floating point number - word doubleword 4 Bit string byte word doubleword Example: Type 8-bit number Value 32-bit version of the number Unsigned 0010 1011 43 0000 0000 0000 0000 0000 0000 0010 1011 Unsigned 1010 1011 171 0000 0000 0000 0000 0000 0000 1010 1011 Signed 0010 1011 +43 0000 0000 0000 0000 0000 0000 0010 1011 Signed 1010 1011 –85 1111 1111 1111 1111 1111 1111 1010 1011 34. Define Instruction set/ Define Instruction. Instruction is a word/ language easily interpreted by machine/hardware Instructions are the language of the machine An instruction set, or instruction set architecture (ISA), is the part of the computer architecture related to programming, including the native data types, instructions, registers, addressing modes, memory architecture, interrupt and exception handling, and external I/O. An ISA includes a specification of the set of opcodes (machine language), and the native commands implemented by a particular processor. 6 CMageshKumar_AP_AIHT CS2071_Computer Architecture 35. Classify instruction sets. A complex instruction set computer (CISC) has many specialized instructions, which may only be rarely used in practical programs. A reduced instruction set computer (RISC) simplifies the processor by only implementing instructions that are frequently used in programs; unusual operations are implemented as subroutines, where the extra processor execution time is offset by their rare use. Theoretically important types are the minimal instruction set computer (MISC) and the one instruction set computer (IISC) but these are not implemented in commercial processors. Another variation is the very long instruction word (VLIW) where the processor receives many instructions encoded and retrieved in one instruction word. 36. Classify instruction types. Computer must have instructions capable of performing four types of operations 1. Data transfer between memory and processor 2. Arithmetic and logic operations 3. Program sequencing and control 4. Input / output transfer 37. Draw the flow of instruction cycle. (EIE Nov’11) 38. What are the Digital Computer Subsystems? or What are the major components of computer architecture? (EIE Dec 2012) Memory Control Input Processor Link Input/Output Datapath Output CPU To/from network I/O 39. Define stack and stack pointer. Stack is a list of data element usually words or bytes with accessing restriction that the data elements can be added or removed at only one end of the list only. Stack pointer is a register used to hold the address of the stack. Stack pointer is denoted by $SP in MIPS register 7 CMageshKumar_AP_AIHT CS2071_Computer Architecture 40. Brief note on MIPS registers. In MIPS, the operands must be registers. • 32 registers are provided • each register stores a 32-bit value • compilers associate variables with registers • registers are referred to by names such as $s0 and $t1 • we use the “s” registers for values that correspond to variables in our programs • we use the “t” registers for temporary values For example, consider this example from the text: f = (g + h) - (i + j); We choose registers to store the values of our variables: f in $s0, g in $s1, h in $s2, i in $s3, and j in $s4. We’ll also need to store temporary values, which we will store in $t0 and $t1. The MIPS code: add $t0, $s1, $s2 add $t1, $s3, $s4 sub $s0, $t0, $t1 41. Short notes on Jump Instruction. Jump instruction causes the program execution to proceed to the location whose address is provided instead of continuing with next instruction in sequence. Example: j eie Jump instruction follows jump (J) instruction format op jump target address 31 25 0 J 6 bits 1 0 0 0 0 0 0 0 0 0 0 0 260 b0it s 0 0 0 0 0 0 1 1 1 1 0 1 Opcode Memory word address (byte address divided by 4) 42. What is assembly language? Assembly language is a low level language in which there is a very strong one-to-one correspondence between language and computer architecture’s machine code instruction. Example: add $to, $s8, $s5 addi $t1, $s7, 43 43. Mention the advantage of assembly language. Extreme efficiency An assembly language program uses up much less memory Runs much faster. 44. How is a floating number represented? Give one example. In computing, floating point describes a method of representing an approximation of a real number in a way that can support a wide range of values. The numbers are, in general, represented approximately to a fixed number of significant digits (the mantissa) and scaled using an exponent. The base for the scaling is normally 2, 10 or 16. The typical number that can be represented exactly is of the form: Significant digits × baseexponent Example: 152853.5047 = 1.528535047×105 8 CMageshKumar_AP_AIHT CS2071_Computer Architecture PART B 1. Discuss about instructions formats, instruction and addressing modes (16). (EIE Dec 2011) 2. What are the types of basic instruction formats? Explain each type with an example. (CS Nov’10) 3. Explain the Data transfer, Logic and Program Control Instructions with examples? (16) (EIE Dec’ 2009) 4. Define addressing mode and describe in detail the different addressing mode with an example(8).(May’08) 5. Describe the addressing modes and instructions designed for control flow (10) 6. Explain the following: (EIE Dec 2011, EEE Dec 2010) (i) Procedures and data. (8) (ii) Instruction set. (8) 7. What is the difference between register addressing and direct addressing? Is it possible to combine register addressing and directing addressing? Explain. 8. What are the steps in transforming an assembly language program to an executable program residing in memory? Explain in detail. 9. List the various addressing modes with example. Give the importance of each in detail. (EIE Dec 2012) 10. How do you classify the instruction set of a processor? Explain usage of each classification with a suitable example. (EIE Dec 2012) 9 CMageshKumar_AP_AIHT CS2071_Computer Architecture . ANAND INSTITUTE OF HIGHER TECHNOLOGY Chennai-603 103 DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERING CS2071 COMPUTER ARCHITECTURE – Question Bank Faculty Name: C.MAGESHKUMAR Date: 15.07.2013 UNIT II – ARITHMETIC LOGIC UNIT CLASS: FINAL EIE A&B PART A – (2 Marks) 1. Draw a half adder circuit. (EIE Dec 2012) 2. Write the logic equations of a binary half adder. (CS May’11) 4. State the purpose of binary adder. (EIE Nov’11) A device that could add two binary bits together. Such a device is known as a half-adder. In this sense, digital arithmetic circuits aren't much different from analog arithmetic (operational amplifier) circuits: they do exactly what they're wired to do, no more and no less. We are not, however, restricted to designing digital computer circuits in this manner. It is possible to embed the mathematical "rules" for any arithmetic operation in the form of digital data rather than in hard-wired connections between gates. The result is unparalleled flexibility in operation, giving rise to a whole new kind of digital device: the programmable computer. 5. Write down the equation for carry generate and propagate. The auxiliary binary signal carry generate (gi) as being 1 for the positions at which carry is generated and 0 elsewhere. g is the logical and of x and y. i i i The auxiliary binary signal carry propagate (pi) is defined as being 1 iff digit position i propagates an incoming carry. Carry generate equation: g=x. y i i i propagate equation: p=x xor y i i i 6. Define a multiplier. (EIE Nov’11) A binary multiplier is an electronic circuit used in digital electronics, such as a computer, to multiply two binary numbers. It is built using binary adders. A variety of computer arithmetic techniques can be used to implement a digital multiplier. Most techniques involve computing a set of partial products, and then summing the partial products together. In binary encoding each long number is multiplied by one digit (either 0 or 1), and that is much easier than in decimal, as the product by 0 or 1 is just 0 or the same number. Therefore, the multiplication of two binary numbers comes down to calculating partial products (which are 0 or the first number), shifting them left, and then adding them together 10 CMageshKumar_AP_AIHT CS2071_Computer Architecture
Description: