Lab9Answers.pdf

This preview shows page 1 - 2 out of 5 pages.

Introduction to Computer Architectures 1 ICAR Laboratory Answers : PicoBlaze Lab 2 Task 1 Question : What is the final value stored in register S0? What is the value of 0x10 in decimal? The value 0x10 has different meanings for different instructions, for load it is a constant data value, for input / output it is a constant memory address. Final value in S0 is 0x10. 0x10 = 16 decimal. start: load S0, 0x10 ; Register S0 loaded with value 0x10 wrprt S0, 0x10 ; Register S0 data written to external memory location 0x10 i.e. data 0x10 load S0, 00 ; Register S0 loaded with value 0x00 rdprt S0, 0x10 ; Data stored in external memory location 0x10 read and loaded into register S0 loop: Jump loop ; trap, stop program Task 2 Should be as previous described. Task 3 Same result as previous, this time register S1 is used to hold the address of the memory location i.e. 0x10, the address is no longer statically / directly defined but accessed from an indirect source. Note, the processor doesn’t distinguish the difference between data and addresses i.e. we could swap registers S0 and S1 around and the program would still work. The advantages of indirect addressing modes is that you do not need to know the address before run time, it can be data dependent, calculated by other parts of the program, also need less bits to define the address i.e. only need 4bits to select the register that contains the actual address. Disadvantage, require at least two instruction, one to load the address into the register and one to access the data, also makes internal processor hardware a little more complex as the address is not directly defined in the instruction.
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern