Showing posts with label musi c. Show all posts
Showing posts with label musi c. Show all posts
Thursday, November 12, 2015
Computer Science Past Questions On Computer Architecture 2012/2013
UNIVERSITY OF CALABAR
DEPARTMENT OF MATHS AND COMPUTER SCIENCE
YEAR 3 EXAMINATIONS 2012/2013
CSC 3321: COMPUTER ARCHITECTURE 1
ANSWER 2 QUESTIONS FROM EACH SECTION TIME 21/2 HRS
SECTION A
1(a) When the computer is running the control unit is doing fetch and execute. Name
the three cases of the execute phase.
(b) Explain how information is stored and how it is retrieved.
(c) Differentiate active retrieval from passive retrieval of information.
Also Read: Computer Science Past Question On Computer Laboratory 2012/2013
2(a) Explain (i) Syllable (ii) Shift-and Count (iii) Overflow (v) Index Register
(b) Explain what a flag is; and name five flags-giving their functions.
(c) How is overflow detected and how is it corrected?
(d) Name and explain the three microprocessor instruction formats.
Also Read: Past Questions On Introduction To Basic Programming 2011/2012
3(a) Name the four things involved in operations and processes in computing.
(b) Name and explain five control instructions.
(c) When does system interrupt occur?
(d) Name five typical instruction types that involve stores and registers, and state the
lengths of the instructions.
Also Read: Past Questions On Introduction To Computer Science CSC1101 2011/2012
(b) Comment briefly on the limitations of manual computation known to you
(c) Discuss the factors that can lead to high performance of a computer architecture
Also Read: Past Question On Computer Systems 2012/2013
2 (a) With the aid of suitable diagrams differentiate between human and machine
computational architectures
(b) Every computer human or machine must have a set of components, comment
briefly on these components stating clearly their functions.
(c) Suppose that an algorithm A is to be executed by a computer. Two questions can
be raised concerning the difficulty of the algorithm. Comment briefly on these questions.
Also Read: Past Question On Computer Systems 2011/2012
3 (a) With the aid of a simple diagram discuss the architecture of Charles Babbage analytical
Engine.
(b) Describe the function of the following instruction set of the IAS computer.
(i) MQ ← M(X)
(ii) AC ← AC + M(X)
(iii) AC.MQ ← MQ X M(X)
(iv) AC ← AC – M(X)
(v) AC ← AC + I M(X)I
(c) Explain the function(s) of the following in S/360-370 computer
(i) R.R
(ii) RX
(iii) RS
(Iv) SI
(v) SS
C++ Program to Find Prime Number Or Not
This c++ program checks if a number is a prime or not. A number which is greater than 1 and can only be divided by 1 and itself are prime numbers. These prime numbers include 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 and so on. A FOR loop is implemented in this program. If the number entered by the user can be divided by another number that is within its range to give zero as the remainder then, this number is not a prime number.
Read more »
#include <iostream.h>
#include <math.h>
void main()
{
int num, a=0;
cout<<"enter a number: ";
cin>>num;
for(int i=2;i<num;i++)//loop begins at 2 since 1 can divide any number
{
if(num%i==0)
{
a++;
}
}
if(a==0)
{
cout<<num<<" is a prime number";
}
else
cout<<num<<"is not a prime";
}
Wednesday, November 11, 2015
C++ Program to Compute The Least Common Multiple of Integers
C++ program to compute the LCM of two numbers. Least Common Multiple can be gotten by dividing the numbers by their common factors.Using the logic below, we can also find write a program to calculate the LCM for more numbers.
Read more »
//C++ program that computes the least common multiple of two integers. These are represented as a and b below.
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,i,j; //Variable declarations
clrscr;
cout<<"enter a number: ";
cin>>a;
cout<<"enter a number: ";
cin>>b;
i=a ;
j=b;
if(a==0||b==0) //Checks if either a OR b is 0
cout<<" The LCM is 0"; //If 0 from the condition above, a display message is output to the screen
else
{
while(a!=b)//While the value of a is not equal to b execute the statements below
{
if(a>b)
b=b+j;
else
if(a<b)
a=a+i;
}
cout<<"LCM:"<<" "<<a;
}
}
C++ Program to Compare The Greatest Of Three Integers
C++ program to compare which is the greatest among three numbers. An IF statement is used to set the condition to know which is less or greater than which.
Read more »
#include<iostream.h>
#include<math.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
cout<<"enter the first value";
cin>>a;
cout<<"enter the second value";
cin>>b;
cout<<"enter the third value";
cin>>c;
if (a>b&&b>c)
cout<<"The greatest is: "<<a;
else
if(a<b&&b>c)
cout<<"The greatest is: "<<b;
else
if(a<b&&b<c)
cout<<"The greatest is: "<<c;
else
if(a==b&&b==c)
cout<<"Non is greater!!";
}
Subscribe to:
Posts (Atom)