3i Infotech Papers: Sample Questions 977 - 978 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 977

» Languages » Assembly Language

Essay Question▾

Describe in Detail

What do you mean by wait state? Why is it needed?

Explanation

  • A wait state is the delay experienced by a microprocessor when accessing external memory or another device that is slow to respond.

  • Similarly to access slow memory the microprocessor must be able to delay the transfer until the memory access is complete.

  • Some microprocessors provide a special control input called READY to allow the memory to set its own memory cycle time- controlling the processor cycle.

  • After sending an address out, the microprocessor waits until it receives a READY input from memory- it enters a wait state for as long as READY line is in 0 state.

  • When the memory access is complete, the READY goes high to indicate that the memory is ready for specified transfer.

Question number: 978

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is virtual class and friend class?

Explanation

Virtual Base Class:

  • Used in context of multiple inheritance in C++.

  • Used to derive two classes from a class, and further derive one class from the two classes in the second level (diamond hierarchy).

  • We need to declare the uppermost base class as ‘virtual’ in the inherited classes (so that methods inherited from both class are implemented).

  • This prevents multiple copies of the uppermost base class data members when an object of the class at the third level of hierarchy is created.

Friend class:

  • Friend class has complete access to data and methods including private and protected data methods.

  • It is not bi-directional-

  • If A declares B as its friend, it does not mean that A can access private data of B.

  • B can access all data of A.