Nt1330 Unit 1 Question Paper

590 Words2 Pages

1. Write generic instructions to compute (p + q) / (r - p) + p * (r – q) using a processor that supports: (i) 2-address instructions (ii) 1-address instructions (iii) 0-address instructions on a stack based processor. You may assume operations in the following table where x, y, z are registers; A is a memory address. 2-address meaning 1-address 0-address add x,y x←x+y add A push A sub x,y x←x-y sub A pop A mul x,y x←x*y mul A add div x,y x←x/y div A mul load x,A load A div store x,A store A sub 2 Assume an 11-bit floating point format in which the most significant bit is the sign bit, the next 4 bits represent the 4-bit biased exponent field, and the last 6 bits represent the normalized significand with implied bit. …show more content…

(ii) Determine the range of binary numbers that can be represented and represent on a number line including overflows and underflows. (iii) What is the 11-bit floating point representation of 257? (iv) What is the decimal result of adding 257 and 11 using the 11-bit floating point representation? 3 Assuming a two’s complement integer representation, use Booth’s algorithm to multiply multiplicand, 11011(-5) and multiplier, 11011 (-5). 4 Consider a one word, one-address instruction. The instruction's memory address is X. The address field of the instruction contains Y. Write down an expression in terms of X and Y for the address of the corresponding operand in each of the following addressing modes: (i) immediate (ii) direct (iii) indirect (iv) PC …show more content…

6. Write a machine language routine that copies the least significant four bits from memory location A5 into the most significant four bits of location A6 while leaving the other bits at location A6 unchanged. 7. Write a machine language routine that places 0s in all the memory cells from address B1 through D1 but is small enough to fit in the memory cells from address 00 through 13 (hexadecimal). A Machine language to be used in Assignment 2 The Machine Architecture The machine has 16 general purpose 8-bit registers numbered 0 through F (in hexadecimal). Each register can be identified in an instruction by specifying the hexadecimal digit that represents its register number. Thus register 0 is identified by hexadecimal 0 and register 10 is identified by hexadecimal A. Main memory size is 256 bytes. Each byte has a unique 8-bit address consisting of an integer in the range 00 (hexadecimal) to FF (hexadecimal). Integer values are stored using a two’s complement representation. Floating-point values are stored in an 8-bit representation: sign bit, followed by a 3-bit biased exponent and a 4-bit normalized significand with implied bit. The Machine

More about Nt1330 Unit 1 Question Paper

Open Document