Partial preview of the text
Download Arithmetic Numbers - Homework Problems | CMPE 12 and more Assignments Engineering in PDF only on Docsity!
(CMPE 12 Spring 2006 Homework # Name: Due Tuesday, April 25 email: (@Quese.edu 1)(5 pts) The following problems ask you to do arithmetic on two or more numbers, For all questions, first convert the numbers into 8-bit unsigned binary numbers, then perform the operations, and show your work, a) add 13 and 157, b) subtract 37 from 148, ¢) subtract 43 from 68 and add 100 to the total, d) multiply 10 by 5. 2)(5 pts) The following problems ask you to do arithmetic on two or more signed numbers. a) add together the 8-bit signed magnitude representations of -7 and 7. b) add together the 8-bit one’s complement representations of -7 and 7, c) add together the 8-bit two’s complement representations of -7 and 7, d) add together the 8-bit biased notation representations of -7 and 7. The bias is 127, 3)(7 pts) The following problems ask you to do arithmetic on two or more signed numbers, For all questions use the 8-bit two's complement binary representations, and show your work, a) add 11 and -5. b) subtract 15 from -27. c) add 100 to 95, d) add 12 to -3, subtract 14 from the total, and multiply the result by 8. Hint: Multiplication for part (d) doesn’t need “long multiplication”. 4)(5 pts) Provide the opeode for these LC-3 instructions. a) JSR b) LD ) ST 4) AND 5)(5 pts) What instructions do these LC-3 opeodes represent? a) 0001 b) 100 c) LOLI dy 0110 6)(5 pts) The following 16-bit numbers are LC-3 instructions. Look up their opcodes and formats, and give the assembly mnemonic transcription for them, specifying operation, registers, ect. a) 0001001001000010 b) 0101001001 100000 7\(5 pts) Provide the machine code for these instructions, indicate what each part of the code represents. a) LD RO, #5 b) ADD RO, RI, #3 8)(3 pts) What is the value in register R2 after this code completes execution? AND RO, RO, 0 ADD RI, RO, 5 ADD R2, RO, RI