Friday, 11 April 2014

What is instruction group in computer architecture?

What is instruction group in computer architecture?


All instruction which computer use to perform different operation are grouped. That groups are called instruction groups. There are mainly four instruction groups which i am listing it below.

1. data moving instruction group:

used for moving data from one place to another.

Example:
move ax,bx
load 1234


2. Arithmetic and logic instruction group:

used when and arithmetical or logical operation is required.

Examples:
add bx,0534
add bx,1234
add bx,[1200]


3: program control instruction group:

used for control the program execution and keep the instruction in a sequence and in specified queue one after another.

4: special instruction group:

used for changing the processor behaviors. example: cli, sti.


************************************************************

*Like it please if you found this post helpful.

Thursday, 10 April 2014

What is computer Register?

What is computer Register?

computer register is the very small amount of very fast memory. It can be read or write very fast by the processor. It acts like a small ram for the processor but it holds data temporarily.
There are so many types of register. like
1. AC
2. DR
3. TR
4. IR
5. AR
6. PC
7. INPR
8. OUTR

Tuesday, 8 April 2014

Data Structure C++ Programming Code of Stack Insertion

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();

int stack[100],loc,top,item,max=100;


cout<<"\n------ Stack Insertion using Array ------";
cout<<"\n\nEnter Value of Stack Top : ";
cin>>top;

if(top>=max)
{
cout<<"\nStack is Full";
getch();
return;
}

cout<<"\nEnter Elements in Stack :\n";
for(loc=0;loc<=top;loc++)
{
cin>>stack[loc];
}

cout<<"\nEnter Item you want to Insert : ";
cin>>item;

top=top+1; //Increment the Top
stack[top]=item;         //Insert Element

cout<<"\nStack After Insertion :\n";
for(loc=0;loc<=top;loc++)
{
cout<<stack[loc]<<endl;
}
getch();
return;
}

Data Structure C++ Programming Code of Insertion Sort

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[100],i,n,p,ptr,temp;

cout<<"\n------------ INSERTION SORT ------------ \n\n";

cout<<"Enter No. of Elements : ";
cin>>n;

cout<<"\nEnter Elements : \n";
for(i=0;i<n;i++)
{
cin>>a[i];
}

for(p=1;p<n;p++)                 // Here the loop start from p=1, as we know that in insertion sort
                                 // the actual passing start from the 2nd element and in C++ 0=1st element
                                 // and 1=2nd element.
{
temp=a[p];
ptr=p-1;

while(ptr>=0&&temp<a[ptr])      // we set ptr>=0, because the selcted value will be compared with the previous
                                // element i.e element 2 will be compared with element 1(A[1] will be compared with A[0])
{
a[ptr+1]=a[ptr];                // Move Element Forward
a[ptr]=temp;                 // Insert Element in Proper Place
ptr--;
}
}
cout<<"\nAfter Sorting : \n";
for(i=0;i<n;i++)
{
cout<<a[i]<<endl;
}
getch();
}

Data Structure: C++ Programming of Bubble Sort

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[100],i,n,p,j,temp;

cout<<"\n------------ BUBBLE SORT ------------ \n\n";

cout<<"Enter No. of Elements : ";
cin>>n;

cout<<"\nEnter Elements : \n";
for(i=0;i<n;i++)
{
cin>>a[i];
}


for(p=0;p<n-1;p++)             // Loop for Pass
{

for(j=0;j<n-p;j++)             // The element will be compared with n-p elements.
                               // If we have 4 elements in the array, then for the first pass (p=0), the element will be
                               // compared with 3 elements i.e (n-p=3-0=3)
{
if(a[j]>a[j+1])
{
temp=a[j];                      // Interchange Values
a[j]=a[j+1];
a[j+1]=temp;
}
}

}

cout<<"\nAfter Sorting : \n";
for(i=0;i<n;i++)
{
cout<<a[i]<<endl;
}

getch();
}

What is Computer Architecture?

What is Computer Architecture?

Computer Architecture is the conceptual design and fundamental operational structure of computer system.

MCS Department BKUC

                Welcome to Computer Science Department BKUC
Here you can download all your courses related to Computer Science Department BKUC. Just select your Class from the following list and follow the instruction to get your specific download.

BCS:

BCS (1st Semester)
BCS (2nd Semester)
BCS (3rd Semester)
BCS (4th Semester)
BCS (5th Semester)
BCS (6th Semester)
BCS (7th Semester)
BCS (8th Semester)


MCS:

MCS (Ist Semester)
MCS (2nd semester)
MCS (3rd Semester)
MCS (4th Semester)

* If you need a slide or any type of suggestion or a problem you are facing in the availability of this blog , just comment here below. We will cooperate with you.

BKUC

Welcome to Bacha Khan University Charsadda.

Here you can download all your courses related to any department of Bacha Khan University. Just select your department from the following list and follow the instruction to get your specific download.


Computer Science Department

Mathematics Departement









bkuclab.blogspot.com is a free and quick way for the students of Bacha Khan to get a quick access to their related course and concern slides and books which is available here in every format.
* If you want to get a notification of my latest updates time to time through email just write your email in the email box.
* If you need a slide or any type of suggestion or a problem you are facing in the availability of this blog , just comment here below. We will cooperate with you.
* Invite your friends if you find this blog helpful. Keep visiting our blog for latest updates and slides.  We will solve your problem.

Monday, 7 April 2014

History of PHP

developed in 1995 by Rasmus Lerdorf (member of the Apache Group)
§originally designed as a tool for tracking visitors at Lerdorf's Web site
§within 2 years, widely used in conjunction with the Apache server
§developed into full-featured, scripting language for server-side programming
§free, open-source
§server plug-ins exist for various servers
§now fully integrated to work with mySQL databases
PHP is similar to JavaScript, only it’s a server-side language
§PHP code is embedded in HTML using tags
§when a page request arrives, the server recognizes PHP content via the file extension (.php  or .phtml)
§the server executes the PHP code, substitutes output into the HTML page
§the resulting page is then downloaded to the client

§user never sees the PHP code, only the output in the page

Software Engineering

Software Engineering chap#2

C++ : A Program For Finding The Largest Number in an Array

#include <iostream.h>
#include <conio.h>
void main()
{
cout<<"Enter ten numbers\n";
int a[10];
int i,large;
for (i=0;i<10;i++)   //for input values 
cin>>a[i];
large=a[0];
for(i=0;i<10;i++)    //to find the largest number 
{
if(a[i]>large)
large=a[i];
}
cout<<"largest number="<<large;
getch();
}

Data Structure C++ Code for Selection Sort

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[100],i,n,p,k,min,loc,temp;

cout<<"\n------------ SELECTION SORT ------------ \n\n";
cout<<"Enter No. of Elements=";
cin>>n;
cout<<"\nEnter Elements=\n";
for(i=0;i<n;i++)
{
cin>>a[i];
}

for(p=0;p<n-1;p++)              // Loop for Pass: Here the loop is running from p=0 to p<n-1.
{                               // From 0 t0 n-1, its normal beacuse in C++ the counting starts from 0 so for 10 elements it will be 0 to 9.
                                // Here it is p<n-1 beacuase in selection sort we compare the first element with the rest of the elements n-1.
                                // As we are using C++, so the full array will be from 0 to n-1 and if we take out the first element for comparison
                                // then we have to run the loop till p<n-1 because the first element is already taken out for comparison.


min=a[p];                       // Element Selection
loc=p;

for(k=p+1;k<n;k++)              // Finding Minimum Value: Here the loop goes from p+1 to n, because the selected element will be compared with all the remaining
{                               // elements of the array.
if(min>a[k])
{
min=a[k];
loc=k;
}
}

temp=a[p];                        // Swap Selected Element and Minimum Value
a[p]=a[loc];
a[loc]=temp;

}

cout<<"\nAfter Sorting : \n";
for(i=0;i<n;i++)
{
cout<<a[i]<<endl;
}
getch();
}

Data Structure C++ Code of Array Insertion of Elements

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[100],i,n,item,loc,j;

cout<<"\n------------ INSERT ELEMENT INTO ARRAY ------------ \n\n";

cout<<"Enter No. of Elements : ";
cin>>n;

cout<<"\nEnter Elements : \n";
for(i=0;i<n;i++)
{
cin>>a[i];
}

cout<<"\nEnter Item you want to Insert : ";
cin>>item;

cout<<"\nEnter Location where you want to Insert Item : ";
cin>>loc;

j=n;                             // Initialize Counter

while(j>=loc)
{
a[j+1]=a[j];                     // Move Element Downward
j--;
}

a[loc]=item;                     //Insert Element
n=n+1;

cout<<"\nArray after Insertion : \n";
for(i=0;i<n;i++)
{
cout<<a[i]<<endl;
}
getch();
}

Networking Chap#2

Networking Chp#2

Networking Chp#3 IP Addressing

Data Structure C++ Code of Array Deletion of Elements

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[100],i,n,item,loc,j;

cout<<"\n------------ DELETE ELEMENT FROM ARRAY ------------ \n\n";

cout<<"Enter No. of Elements : ";
cin>>n;

cout<<"\nEnter Elements : \n";
for(i=0;i<n;i++)
{
cin>>a[i];
}

cout<<"\nEnter Location of Element, you want to Delete : ";
cin>>loc;


item=a[loc];

for(j=loc;j<n-1;j++)                  // "j" is initliazed by by "n-1" becasue in C++ language array subscript is started from 0 index number.     
{
a[j]=a[j+1];                         // Move Elemets Upward
}

n=n-1;                               // Reset the No. of Elemets in Array

cout<<"\nArray after Deletion : \n";
for(i=0;i<n;i++)
{
cout<<a[i]<<endl;
}

cout<<"\nElement "<<item<<" is deleted";
getch();
}