Department of Computer Science

Introduction to Computing Environments

Fetch and Execute Cycle


(1) Start a browser and go to the url http://homepages.feis.herts.ac.uk/~msc_ice/fe2.

(2) Select Option 1 ('Run the simulation'). The simulator currently has 4 four programs available. In addition to the programs already available, it is possible to create new programs or edit existing ones. The use of this simulator is fairly intuitive, and you are expected to explore its advanced features in your own time.

(3) For this practical, select the ADD TWO NUMBERS program and then click on RUN SIMULATION to start the simulation. The simulator is configured to pause for each RTL (Register Transfer Language).

(4) On every pause, the message ‘Press PLAY to move on to the next RTL command’ will be displayed. There will be one pause for each RTL command. Although there will be several pauses during the simulation, the Program Counter (PC) will not change with each pause. During this practical you will need to identify the values required in Tables 1, 2 and 3 for each different PC.

(5) Figure 1 shows the status of the Simulation Window on the first pause, when the PC is equal to 0. Please note that the values of this stage of the simulation are already transferred to Table 1.

Figure 1

(6) For each iteration observe the changes in each register. At every pause, if the Program Counter (PC) changes, transfer the required values to Table 1. The first two (PC = 0000 and PC = 0001) are already done. Complete the table for PC values from 0002 to 0006.

(7) The program requires the input of two numbers in hexadecimal. For this practical, enter 000B as the first number and 000A as the second number. Figure 2 illustrates the hexadecimal 000B being input as the first number.

(8) Answer the following questions:

    1. What do you expect to be the result of 000B + 000A (in hexadecimal)?
    2. What is the equivalent – in decimal – of the hexadecimal 000B?
    3. What is the equivalent – in decimal – of the hexadecimal 000A?
    4. If you add the decimal values obtained in (b) and (c), which result would you expect to obtain (in decimal)?
    5. Is the hexadecimal value obtained in (a) equivalent to the value you obtained in (d)?
    6. What do you expect to be the result of 000B - 000A (in hexadecimal)?
    7. If you subtracted the decimal values obtained in (b) and (c), which result would you expect to obtain?
    8. Are the values in (f) and (g) equivalent?

(9) The process is finished after the instruction HLT is executed.

Figure 2

(10) Repeat the whole process, this time adding two different numbers in hexadecimal. Enter 001A as the first number and 0018 as the second number. Transfer all the values required into Table 2. The process is finished after the instruction HLT is executed.

(11) Answer the following questions:

    1. What do you expect to be the result of 001A + 0018 (in hexadecimal)?
    2. What is the equivalent – in decimal – of the hexadecimal 001A?
    3. What is the equivalent – in decimal – of the hexadecimal 0018?
    4. If you add the decimal values obtained in (b) and (c), which result would you expect to obtain (in decimal)?
    5. Is the hexadecimal value obtained in (a) equivalent to the value you obtained in (d)?
    6. What do you expect to be the result of 001A - 0018 (in hexadecimal)?
    7. If you subtracted the decimal values obtained in (b) and (c), which result would you expect to obtain?
    8. Are the values in (f) and (g) equivalent?

(12) Modify the current program. Amend the instruction STA 63 to STA 62. Amend the instruction ADD 63 to ADD 62. The numbers in hexadecimal to be added are 000A and 000B (just like the first part of this practical). Transfer all the values required on Table 3 in the same way as you have done for Table 1 and Table 2. The process is finished after the instruction HLT is executed.




Table 1

Go to Top of document


Table 2

Go to Top of document


Table 3

Go to Top of document



The completed tables can be seen here.


Last Updated: 09/10/2002 by Mariana, Daniel or Colin

© University of Hertfordshire Higher Education Corporation (2002)

Disclaimer