Sunday, December 8, 2019
Computer Organization and Architecture
Questions: 1. A digital computer has a memory unit with 16 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory.a)How many bits are needed for the opcode? b)How many bits are left for the address part of the instruction?c)What is the maximum allowable size for memory?d)What is the largest unsigned binary number that can be accommodated in one word of memory? 2. Consider the MARIE program below. a) List the hexadecimal code for each instruction.b) Draw the symbol table.c) What is the value stored in the AC when the program terminates? Hex AddrLabelInstruction 100 Start,Load A 101 Add B 102 Store Temp 103 Load C 104 Add D 105Add Temp 106 Store F 107 Output 108HALT 109 A, DEC 5 10A B, DEC 3 10B C, DEC 4 10C D, DEC 13 10D E, DEC 3 10ETemp, HEX 00FD 10FF, HEX 00FE3. Write code to implement the expression F = (A+B) /(C*D*E) on 2-, 1- and 0-address machines. Answers: 1.a) For the Opcode 7 bits are needed [As 2^6=64 (not enough) and 2^7=128 (more than enough)]. 1.b) 16-7 = 9 bits are left for the address part of Instruction. 1.c) 2^9 = 512 is the maximum allowable size for memory. 1.d) 2^16 = 65536 is the largest unassigned binary number. 2.a) Addr Label Instruction HEXADECIMAL CODE 100 START Load A 1109 101 Add B 310A 102 Store Temp 210E 103 Load C 110B 104 Add D 310C 105 Add Temp 310E 106 Store F 210F 107 Output 6000 108 HALT 7000 109 A, DEC 5 0005 10A B, DEC 3 0003 10B C, DEC 4 0004 10C D, DEC 13 000D 10D E, DEC 3 0003 10E Temp, HEX 00FD 00FD 10F F, HEX 00FE 00FE 2.b) Symbol Table SYMBOL LOCATION A 109 B 10A C 10B D 10C E 10D TEMP 10E START 100 F 10F 2.c) 0 X 0019 is the value that stored in the AC during the program terminate 3. Implementation of the Expression F = (A+B) /(C*D*E) on 2-, 1- and 0-address machines Instruction Set for 2- Address Machine MOV R1, A ADD R1, B MOV R2, C MUL R2, D MUL R2, E DIV R1, R2 MOV F, R1 Instruction Set for 1- Address Machine LOAD A ADD B STORE T2 LOAD C MUL D MUL E STORE T1 LOAD T2 DIV T1 STORE F Instruction Set for 0- Address Machine PUSH A PUSH B ADD PUSH C PUSH D MUL PUSH E MUL DIV POP F Bibliography Mueller, S. M., Paul, W. J. (2013).Computer architecture: complexity and correctness. Springer Science Business Media. Gonzalez, R. E., Kuskin, J., Ho, R. (2016). Mark Horowitz and His Impact on Computer Architecture.IEEE Solid-State Circuits,31. Cuthbert, A. J., Xu, P. (2015).U.S. Patent No. 20,150,310,290. Washington, DC: U.S. Patent and Trademark Office. Watanabe, H., Ambai, M., Kawamura, T., Ogura, N. (2013, March). Towards aspect-oriented state machine language for embedded software. InProceedings of the 8th international workshop on Advanced modularization techniques(pp. 23-26). ACM. Kranz, J., Sepp, A., Simon, A. (2013, December). Gdsl: A universal toolkit for giving semantics to machine language. InAsian Symposium on Programming Languages and Systems(pp. 209-216). Springer International Publishing. Hill, M. D. (2014, February). 21st century computer architecture. InACM SIGPLAN Notices(Vol. 49, No. 8, pp. 1-2). ACM.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.