TUTORIAL 5
1. What is ISA and describe why ISA is important for computer architecture.
     Ans:-
      Instruction set architecture, is the level defines the interface between the compilers and the
     hardware. It is the language that both of them have to understand. It is important as ISA is
     the communication between hardware and software
  2. Discuss the three questions which usually emerge during ISA level. How can these
     questions be answered?
     Ans:-
            ‘‘Is it compatible with its predecessor?’’
            ‘‘Can I run my old operating system on it?’’
            ‘‘Will it run all my existing application programs unmodified?’’
             Solution:
                      backward compatible
  3. Discuss in two points what makes a good ISA.
     Ans:-
        A good ISA should define a set of instructions that can be implemented efficiently in
         current and future technologies, resulting in cost-effective designs over several
         generations.
        A good ISA should provide a clean target for compiled code. Regularity and
         completeness of a range of choices are important traits that are not always present in
         an ISA.
  4. Explain the important of ISA regards to three aspects: programmability, implement
     ability, compatibility.
     Ans:- The important of ISA regards to three aspects:-
     a. Programmability
           • Easy to express programs efficiently.
   b. Implement ability
       • Easy to design high-performance implementations
       • Easy to implement on more recent technology
       • Easy to design low-power implementations
       • Easy to design high-reliability implementations
       • Easy to design low-cost implementations
   c. Compatibility
           • Easy to maintain programmability (implement ability) as languages and programs
           (technology) evolves – for both current and future technology
5. How can ISA be implemented regards to forward compatibility?
Ans:- Some of the ISA implemented regards to forward compatibility are:
          Old processors must support new programs (with software help).
          New processors redefine only previously-illegal opcodes.
          Allow software to detect support for specific new instructions.
          Old processors emulate new instructions in low-level software.
6. Discuss how memory is structured in ISA level.
   Ans:- To structure memory in ISA level are:-
          All computers divide memory up into cells that have consecutive addresses.
          The most common cell size at the moment is 8 bits, but cell sizes from 1 bit to 60
           bits have been used.
          An 8-bit cell is called a byte. The reason for using 8-bit bytes is that ASCII
           characters are 7 bits, so one ASCII character plus a parity bit fits into a byte.
          If UNICODE comes to dominate the industry in the future, then future computers
           may be based on 16-bit consecutively numbered units.
          Bytes are generally grouped into 4-byte (32-bit) or 8-byte (64-bit) words with
           instructions available for manipulating entire words.
          Many architectures require words to be aligned on their natural boundaries, so, for
           example, a 4-byte word may begin at address 0, 4, 8, etc., but not at address 1 or
           2. Similarly, an 8-byte word may begin at address 0, 8, or 16, but not at address 4
           or 6.
7. Discuss the relationship between registers from microarchitecture level and ISA level.
   Provide the reason why all the registers from ISA level can be seen from
   microarchitecture level.
   Ans:- Some of the reason why all the registers from ISA level can be seen from
   microarchitecture level are:-
          All computers have some registers visible at the ISA level.
          They are there to control execution of the program, hold temporary results, and
           for other purposes.
          In general, the registers visible at the microarchitecture level, such as TOS and
           MAR, are not visible at the ISA level.
          However, a few of them, such as the program counter and stack pointer, are
           visible at both levels.
          On the other hand, registers visible at the ISA level are always visible at the
           microarchitecture level since that is where they are implemented.
8. What are the differences between special purpose and general purpose register?
   Ans:- The differences between special purpose and general purpose register are:
          The special-purpose registers include things like the program counter and stack
           pointer, as well as other registers with a specific function.
          In contrast, the general-purpose registers are there to hold key local variables, and
           intermediate results of calculations.
9. Describe the functions of LOAD, STORE and MOVE instruction in ISA level.
      Ans:- The functions of LOAD, STORE and MOVE instruction in ISA level are:
              LOAD to go from memory to a register.
              STORE to go from a register to memory.
              MOVE to go from one register to another register
10. Describe the advantages and disadvantages of having different length instructions. How
   about if instructions are in same length.
       Ans:-
          Different length instructions are good as can allocate the instructions in the
           memory as long as the memory has enough free space. However, it often makes
           decoding more complex.
          Having all the instructions be the same length is simpler and makes decoding
           easier but often wastes space, since all instructions then have to be as long as the
           longest one.
11. What is opcode expansion and why it is useful?
       Ans:-
           Opcode expansion is trying to reduce the number of bit for opcode (instructions)
           and increase the number of bit for addressable memory It is useful to increase
           execution performance and resolution.
12. Calculate the following using opcode expansion mechanism.
           a. One 4 bit opcode with three 4 bit address
           Ans:- K=4; n=12 (k-1) (n+1) = 2^3, 2^13
           b. Two 3 bit opcode and four 3 bit address
           Ans:- K=6;n=12 (k-1) (n+1) = 2^5, 2^13
           c. Two 8 bit opcode and two 8 bit address
           Ans:- K=16; n=16 (k-1) (n+1) = 2^15, 2^17
13. Describe the differences between direct addressing and register addressing.
          Direct address allows an operand to have its full address together in the memory.
          Direct addressing is restricted in its use: the instruction will always access exactly
           the same memory location. So while the value can change, the location cannot.
          Register addressing is conceptually the same as direct addressing but specifies a
           register instead of a memory location.
          Because registers are so important (due to fast access and short addresses) this
           addressing      mode   is   the   most   common    one   on    most   computers.
14. Describe the differences between dyadic and monadic instructions.
           Ans:- The differences between dyadic and monadic instructions are:
              Dyadic operations are those that combine two operands to produce a result.
              Monadic operations have one operand and produce one result.
15. Describe the two reasons that data may be copied from one location to another.
   Ans: The two reasons that data may be copied from one location to another are:
   -   Data duplication
   -   Data manipulation- To do calculation
   -   Security – saving
   -   Data Sharing
16. What are procedure call instructions?
   Ans: A procedure is a group of instructions that performs some task and that can be
   invoked (called) from several places in the program.