There is almost always some sequential overhead to

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ad to programs that cannot be made parallel. 4. Student ID number Full credit is given if the student’s name and ID number are at the top of their solution, and their student ID number is listed as the answer to this problem. For my solution (and for problem #5), I will use the simple number 00123456. 5. Number conversion Part 1: For converting to binary, I used the strategy of dividing by two, and writing a 0 for every even number, and a 1 for every even number: 123,456 61,728 30,864 15,432 7,716 3,858 1,929 964 482 241 120 60 30 15 7 3 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 So, 123,45610 = 111100010010000002. To convert to hexadecimal, just group the bits in groups of 4 (from the right) and convert each group: 0001 1 1110 E 0010 2 0100 4 0000 0 Finally, 123,45610 = 1E24016 (which is 20 bits). Part 2: To negate a two’s complement number, invert the bits and add one, and reconvert to hexadecimal. 00011110001001000000 inverted becomes: 11100001110110111111 +1 11100001110111000000 1110 E 0001 1 1101 D 1100 C 0000 0 So, -123,45610 = E1DC016 (using two’s complement, 20 bits). Part 3: When using biased notation, add the bias, then convert to unsigned binary (not two’s complement). The bias is 219 -1, or 524,28710, or even more simply, 011111111111111111112. I will simplify my work even more by viewing this as 8000016 – 1. Then, to add the bias, I’ll do the math in hexadecimal (ignoring any overflow) and I’ll end up with the right answers. Part 3: +219 -1 1E24016 +8000016 9E24016 -116 9E23F16 Part 4: +219 -1 E1DC016 +8000016 61DC016 -116 61DBF16 Notice how I ignored the overflow in part 4, and kept the answer as a 20-bit number. 6. MARS MIPS Simulator warm up code This problem asked you to run the mystery code in the assignment. The mystery code took an integer input, divided it by 2.5, and displayed the resulting quotient. For example, if you input 421, the program would output 168 because 421/2.5 = 168 (using integer division). Students should have done the following: Written down their ID number divided by 2.5, and Written down their ID number multiplied by 2.5 (ok to be slightly over). Credit will also be given if you clearly describe the behavior of the program....
View Full Document

Ask a homework question - tutors are online