Lab6.pdf

This preview shows page 1 - 3 out of 16 pages.

Introduction to Computer Architectures 1 ICAR Laboratory : CPUSim Lab 2 The aim of this lab is to build upon the simple register transfer level (RTL) simulation model of a von Neumann CPU developed in CPUSim laboratory 1. For information on how to setup and use CPUSim please refer to the previous lab script. In this lab the processor’s instruction set will be expanded to allow it to execute programs like the one shown in figure 1 (discussed in lecture). Finally, a functional, gate level simulation written in VHDL will be used to examine this processor’s architecture. Figure 1 : test program Figure 2 : Register transfer level block diagram To start the CpuSim simulator select : Start -> All programs -> Hardware Development -> CpuSim -> Von_Neumann This will launch the CPU Sim simulator. To load your simulation model from the previous lab click on File -> Open Machine Then browse to the saved .cpu file. If you do not have last labs simulation model Mike Freeman 22/11/2016
Image of page 1

Subscribe to view the full document.

Introduction to Computer Architectures 2 you can download a basic design from the VLE (under lab script) i.e. the core processor modules, registers (shown in figure 2), micro-instructions and machine code instructions. Figure 3 : INPUT instruction Task 1 To allow the processor to read data stored in external memory implement the INPUT instruction shown in figure 3. This instruction uses the absolute address (pp) to read external memory, storing the retrieved data in the ACC. If you get stuck the required micro-instruction and instruction field definitions are shown in figure 4. IMPORTANT , the difference between LOAD and INPUT instructions can catch you out (myself included), remember a LOAD instruction loads the ACC with a constant (kk), whilst an INPUT instruction reads data from an external memory address (pp). Task 2 Enter the assembly language test program below. To simplify the task of remembering where our data values are stored in memory we can use symbolic labels, or links e.g. input A . The assembler will replace the symbol A with the number 4. start: input A ; add 02 ; A: .data 2 100 B: .data 2 50 Note , in the lecture slides the register label ACC was included in the assembly language format to highlight where data was stored (figure 1), however, as there is only has one general purpose register (ACC) it will be removed in the CPUSim instructions. Question , What does .data 2 100 define? What happens if the 2 is replaced with a 1? Rerun the program is the result the same? How have the values stored in memory changed? Refer to Help menu, or Appendix A (end of script) for more info Question , can you see why symbol A is replaced with the number 4? What value will be used to replace symbol B ? Note, decimal 100 = Hex 64, decimal 50 = Hex 32. Assemble, load and step through this program for five machine instructions. Is each machine instruction executed correctly? What is the final result? Make sure you understand what instructions have been executed before proceeding.
Image of page 2
Image of page 3
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