ISA term project Anawil C. 5912087
Create a list of register Assign pointer to point to array Code Create 2 variable to find clock cycle and how many time instruction has been executed Function to find register, once we receive input from user and return index of register’s array
Convert register into binary for calculation to Code (Cont.) find encoded value Function to move the value in the register Function addition
Function subtraction Code (Cont.) Function multiplication Function divide
Code (Cont.) Function carry, carry = 1 after Convert int to sum 1 + 1, or binary carry = 0 after sum 1 + 0 or 0 + 1 Convert int to binary from 16-bits to 32-bits, after do multiplication
Waiting for input And assign value to Code (Cont.) variable that is already define It will keep adding instruction When we’re going to everytime there is loop to keep executing new command until the user are done with the calculation Print the number of instructions and clock cycles, and CPI
Print 32-bit value Code (Cont.) inside the register after doing multiplication of specific register. In this case we have 8 register so it’s going to have this if else 7, register number 7 (start from 0) will be temp register that keep track of multiplication and Keep the discard after divide(previous value) doing multiplication For example 16 divide the size is double, after with 2, register 7(r7) is done it should have will keep 16 inside the temp value that is register assign somewhere inside the register to keep the value of it
Code (Cont.) If there is no multiplication, then we can print normally with 16-bits register And waiting for new command, to end/quit the program (end 0 0)
Recommend
More recommend