Showing posts with label Computer Architecture Tutorials. Show all posts
Showing posts with label Computer Architecture Tutorials. Show all posts

Thursday, 20 December 2012

Interrupt-All Computer Topics


Interrupts:-Interrupts are the signals which tells the CPU that an output and input required.The action on interrupts are taken by Operating System.
Each interrupt has their own priority level(means those signal who has high priority than they execute first).

Interrupt are divided into different-2 categories:-



1)Hardware Interrupts:-Hardware Interrupts are those interrupts which are generated by Hardware
devices like keyboard,microprocessor etc.

2)Software Interrupts:-Software Interrupts are those interrupts which are generated by Software.
That programs called as trap.

3)Internal Interrupts:-Internal Interrupts are those interrupts which are generated by internal device.

4)External Interrupts:-External Interrupts are those interrupts which are generated by external device.

5)Vector Interrupt:-Vector Interrupts are those interrupts in which interrupts device supply the address of subroutine.

7)Non-Vector Interrupt:-Non-Vector Interrupts are those interrupts in which interrupts device does not supply the address of subroutine.

8)Priority Interrupts:-Priority Interrupts are those interrupts in which each signal are described at their priority level.High devices gives as high priority like disc and low device as low priority like keyboard.



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.


Addressing mode


Addressing modes are the modes which are used to specified the address of data and operands.
Address of Operand also called as effective address.

Types of Addressing Modes:-


1)Direct Addressing Mode:-Direct Addressing Mode are the mode in which instruction itself contains the address of data.


2)Indirect Addressing Mode:-Indirect Addressing Mode are the mode in which instruction doesn't 
contain the address of data but instruction specified address of memory which contains the address of memory.

3)Immediate Addressing Mode:-In this mode operand is specified the instruction.

Some other type of Addressing Modes are:-


4)Register Addressing Mode:-In this mode op code contains the address of register.





5)Indirect Addressing Register Mode:-In this mode op code redirects to another register.





6)Auto Increment and Auto decrement Addressing Mode:-In this mode register is automatically 

incremented or decremented after its value is needed to access memory location.




Effective Address=Address of IP+Content of PC.


7)Index Addressing Mode:-In this mode effective address is equals to the address part of IR plus

Content of Index Register.




8)Base Addressing Mode:-In this mode effective address equals to content of bade address plus

Address part of IR.






If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Monday, 17 December 2012

Pipeline Technique in Computers


Pipeline is an technique which is used in many modern computer's.In this technique more than one process run simultaneously.The concept of Pipeline is quite simple means while one instruction is being executed,computer is decoding next instruction simultaneously.

Pipeline Technique is divide into 2 types:-

1)Instruction Pipeline:-In Instruction Pipeline,while one instruction is being executed,computer is fetching next instruction.The main advantage of instruction Pipeline is it reduce the time of process.

Point to Remember:-No. of Stage is directly proportional to Performance of CPU.

Instruction Pipeline has 6 phases:-

1)Fetch Instruction:-Read the instruction from memory.

2)Decode Instruction:-Determine the op code and operand.

3)Calculate Operand:-Its calculate the address of Operand.

4)Fetch Operand:-Its Fetch Operand from memory.

5)Execute Instruction:-It is used to execute the instruction.

6)Write Operand:-It is used to write operation in memory.

Arithmetic Pipeline:-Arithmetic Pipeline is used when we considered complex operation like floating point operation.

Simple example of Arithmetic Pipeline:-

Addition of 2 binary no. P=P*2a and Q=Q*2b.Find:-

1)In stage 1 compare exponent,
2)In stage 2 Align mantissa,
3)In stage 3 add mantissa,
4)In stage 4 normalise the result.




Disadvantage/Drawbacks of Pipeline:-

1)Branching Problem.
2)Data Dependency.



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Associative Memory


Associative Memory is also called as Content Addressable Memory because its memory unit is accessed by its content.Associative Memory is mostly used in Application.The disadvantage of this memory is that it is very costly as compared to RAM(Random Access Memory) but its storage area is good.


Block Diagram of Associative Memory:-





Block Diagram consists:-

1)Argument Register.
2)Key Register.
3)Array&Logic of Computer.
4)Match Register.

When a word is written in a Associative Memory then no address,name,relative position is given.
Associative memory is also capable to find the unused or empty location to store words.In Associative memory each cell has storage capability as well as logic circuit.



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Sunday, 16 December 2012

Division Algorithm


Division Algorithm is an Algorithm which is frequently used in computer Architecture.It is used to divide the two numbers,example 20%3.




Step 1:-Start the Algorithm.

Step 2:-BR=Divisor and Dividend in ACQR.

Step 3:-Set E=0,SC=n-1,Q(s)=AC xor BR.

Step 4:-Now perform EAC<--AC+(BR)'+1 operation.

Step 5:-In decision phase,if bit is 1 then perform DVF<--1 and EAC<--AC+BR and end divide overflow error.

Step 6:-If bit o then DVF<--0,EAC<--AC+BR and perform left shift operation.

Step 7:-Then perform EAC<--AC+(BR)'+1.

Step 8:-In decision phase,if bit 1 then perform Q(n)<--1 and if bit 0 then then perform EAC<--AC+BR operation.

Step 9:-Then perform SC<--SC-1.If SC=0 then end else jump to upper section of Algorithm.



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Instruction Cycle


Instruction Cycle is the cycle which is used to fetch,decode,execute the instruction of the computer which was given by us.Instruction Cycle has mainly 4 phase that are Fetch Phase,Decode Phase,Decision Phase and Execution Phase.

Flow Chart/Diagram of Instruction Cycle:-




where AR=Address Register,
PC=Program Counter,
IR=Instruction register,
MRI=Memory Reference Instruction,
RRI=Register Reference Instruction,
I/O I=Input-Output Instructions.

Fetch Phase:-In Fetch phase,SC=0,AR<--Pc,IR<--M[AR] then PC<--PC+1.

Decode Phase:-In decode phase  we decode operation code and perform AR<--IR and I<--IR operations.

Decision Phase:-In decision phase we decide where the instruction goes.

Execute Phase:-In this phase we execute instructions.



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Saturday, 15 December 2012

Booth's Algorithm of Multiplication


The main purpose or use of this algorithm is to multiply 2 binary no.s.Booth's Algorithm is multiplies two number in 2's Complement.

General Steps of Booth's Algorithm:-


Step 1:-In step 1 firstly we take a multiplicand BR and multiplier Q(R) and set value of AC,Q(n+1),SC are 0,0,0 respectively.


Step 2:-In step 2 We check Q(n) and Q(n+1).


Step 3:-In step 3 if bits are 0,1 then add BR with AC and after that perform Right Shift Operation.


Step 4:-If bits are 1,0 then perform AC+(BR)'+1 then perform Right Shift Operation.


Step 5:-Check if SC is set as o.


Step 6:-Repeat Step 2,3,4 until SC<--0.


Flow Chart/Diagram of  Booth's Algorithm of Multiplication:-





Example of 
Booth's Multiplication Algorithm:-Multiply 7 with 3 with the help of Booth's Algorithm.


AC Q(R) Q(n+1) SC
0000 0011 0 4
1001(SHR) 0011(SHR) 0 4
1100(SHR) 1001(SHR) 1 3
1110 0100 1 2
0101(SHR) 0100(SHR) 0 1
0010(SHR) 1010(SHR) 0 1
0001 0101 0 0




If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Wednesday, 12 December 2012

Shifter(Bit Shifter) in Computer's and its Circuit Diagram


In my previous post I explained you the function of Shift micro-operation(It perform shift operation on data stored in register).Now I discuss the Shifter functional table and its circuit diagram.

Functional Table:-



Select(S) H(0) H(1) H(2) H(3)
0 I(R) A(0) A(1) A(2)
1 A(1) A(2) A(3) I(L)


In a processor with many register is more efficient to implement the shift operation with a combinational Circuit.

Circuit Diagram of Shifter:-




In above circuit diagram we used 4 shifter with 4 inputs i.e. A(0),A(1),A(2),A(3) and produce 4 data outputs H(0),H(1),H(2),H(3). 



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Tuesday, 11 December 2012

Bus Implementation by using Mux and Instate Buffer


Bus can be implemented through Mux and instate buffer.Firstly I discuss Bus Implementation by using Mux.

Table:-



S(1) S(0) Register
0 0 Reg A
0 1 Reg B
1 0 Reg C
1 1 Reg D

Point to remember:-

                                       
                     No. of Mux=No. of Register    
                     Size of Mux=No. of Register 



In above diagram we using 4 mux and 4 
register(reg1,reg2,reg3,reg4).

Bus Implementation using Instate buffer:-


Table:-



S(1) S(0) D(0) D(1) D(2) D(3)
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1






If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Monday, 10 December 2012

Register Transfer Language


Register Transfer Language is a language which is used to transfer data from one register to another register and also describe the sequence of micro-operations.But the description of micro-operation is too lengthy and difficult so we used symbolic notations.This symbol of notation describe by R.T.L.

Symbol                    Describe                    Examples
1)Letters and        Register Name        R1,R2,R3.....
Numerals 

2)Parenthesis       Part of Register      R1(0-7)
                                                                          Dr(11-5)

3)Arrow's               data transfer fr-      R1<--Ac
                                   om one place to
                                   another.

4)Comma(,)          Separate 2 micr-
                                   ooperations.
                                  

5)Control Signal  It is denoted as le-  P:R1<--R2
                                    tter and colon.  


Let us take an example,Show conditional statement by 2 register transfer statement with control function.

if(P==1) then (R1<--R2)
else
if(Q==1) then (R1<--R3)

Sol.  P: R1<--R2
          P'Q: R1<--R3


If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter. 
      

Micro-Operations


Micro Operations are the operations which are used to create assembly language instruction.Some common example of Micro-operation of Computer Organization are:-

1)Register Transfer Micro-operation:-The main purpose of Register Transfer Microoperation is to transfer binary information from register to another register.

2)Arithmetic Micro-operation:-The main purpose of Arithmetic Micro-operation is to perform arithmetic operation on numeric data.

3)Logical Operation:-The main purpose of Logical Operation is to perform bit manipulation on numeric data.

4)Shift Micro-operation:-The main purpose of Shift Micro-operation is to shift the temporary data which are present in register.

Now shift micro-operation are divided into 3 categories:-

a)Logical Shift

  • Logical Shift Right(SHR)
  • Logical Shift Left(SHL)

b)Circular Shift

  • Circular Right(CIR)
  • Circular Left(CIL)

c)Arithmetic Shift

  • Arithmetic Shift Right(ASHR)
  • Arithmetic Shift Left(ASHL)



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Floating Point Representation of a Number


Firstly I explain you What is Floating Point Number,as we know that number has two parts i.e. part before decimal and part after decimal.The part before decimal is an integer part and part after decimal is a fractional part.

Point to Remember:-In floating point representation the second register is used to store that number which specify decimal of that number.

Let us take an example,the number 345.55 can also be written as 3.4555 * 10^2.So from this example we conclude that a no. is a combination of Mantissa(or fraction) and exponent.

Representation of a number(Examples):-

1)64*10^3

0    1    0    0    0    0    0    0        =Mantissa

0    0    0    0    0    0    1    1         =Exponent

2)-64*10^3

1    1    0    0    0    0    0    0         =Mantissa

0    0    0    0    0    0    1    1         =Exponent

3)64*10^-3

0    1    0    0    0    0    0    0         =Mantissa

1     1    1     1     1     1    0    1          =Exponent


If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter. 

Saturday, 8 December 2012

Data Representation:1's Complement and 2's Complement


1's Complement Representation:-Reverse of the value is called as 1's complement of that value.Look at the table below:-


First table is normal(from 0 to 7)
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
Second table is the example of 1's complement(from -0 to -7)

1 1 1 1
1 1 1 0
1 1 0 1
1 1 0 0
1 0 1 1
1 0 1 0
1 0 0 1
1 0 0 0


From above tables,the Range of 1's complement is:-

Range=-7 to +7
=(2^3-1) to (2^3-1)

Range=-(2^k-1) to +(2^k-1)

2's Complement Representation:-2's complement is equal to 1's complement + 1.


First table is normal(from 0 to 7)
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1

Second table is the example of 2's complement(from -0 to -7)
-01000
-11111
-21110
-31001
-41000
-51111
-61110
-71001

From above tables,the Range of 2's complement is:-


-2^3 to + (2^3-1)
=-8 to +7 

Range=-(2^k) to +(2^k-1)



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

Data Representation:Binary Arithmetic


In this Binary Arithmetic Representation,we concerned on this topics:-Binary Addition,Binary Subtraction,Binary Multiplication and Binary Division.So starting with Binary Addition.

Binary Addition:-

A B A+B Cout
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

Example 1: 11101.11 + 11010.10


     1     1     1     0     1     .     1      1

     1     1     0     1     0    .     1     0
-------------------------------------------
1    1    1     0     0     0    .    0     1      
-------------------------------------------

Example 1: 111000.01+1111101.10


                   1      1      1      0     0     0     .     0     1

             1    1      1      1      1      0     1      .     1     0
---------------------------------------------------------
      1    0    1      1      0     1      0     1      .     1      1
---------------------------------------------------------

Binary Subtraction:-



ABA-BBout
0000
0111
1010
1100


Example 1:-1110-1001


1     1      1      0

1     0     0     1
-----------------
o     1     0     1
-----------------

Example 2(using 2's Complement):-


When 1st value is lesser than 2nd value then we use 2's Complement.


->0101-1010


First we take 1's complement of bigger value=0101


Then we takes 2's complement 


   0101

        +1
----------
    0110
----------

then, (add)

0     1     1     0
0     1     0     1
-----------------
1     0     1      1   =-5
-----------------

Binary Multiplication:-


Example 1:-


                    1     1     0     1      1     0     1

                                          *      1     0     1
------------------------------------------------
                     1     1      0     1      1     0     1
                0   0    0     0     0     0    0     X
           1    1   0    1      1      0     1    X     X 
-------------------------------------------------
      1   0    0   0    1     0     0     0    0     1
-------------------------------------------------    

Example 2:-




         1     1     0     1      1     0     1
                               *      1     1      1
------------------------------------------------
        1      1     0    1      1      0     1   
     1 1      0    1     1      0     1      X
  1 1  0    1     1     1      0     X     X
-------------------------------------------------
1   0    1   1    1     1     1     1    1     1
-------------------------------------------------    



Binary Division:-

                    
             10011           
    --------------------------
11|1     1     1     0     1     1          

      1     1     

                   -------------
                    1      0     1
                            1      1
                                  ---------
                                  1        0
                                  ---------



If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.