Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPU performs the bulk of data processing operations CPU performs the bulk of data processing operations The CPU is made up of three parts. They are Control.

Similar presentations


Presentation on theme: "CPU performs the bulk of data processing operations CPU performs the bulk of data processing operations The CPU is made up of three parts. They are Control."— Presentation transcript:

1

2 CPU performs the bulk of data processing operations CPU performs the bulk of data processing operations The CPU is made up of three parts. They are Control unit, ALU and resisters The CPU is made up of three parts. They are Control unit, ALU and resisters CPU is the brain of a computer CPU is the brain of a computer

3 CONTROL REGISTER SET ALU

4

5 Register Registers are the memory locations for storing data temporary for the data processing time.

6 Arithmetic Logic Unit (ALU) R1 R2 R3 R4 R5 R6 R7 MUX B MUX A 3 X 8 Decoder INPUT A Bus B Bus R3 -> R1 + R2 R1 Select value of R1 R2 Select value of R2 8 bit REGISTER SEL B SEL A SEL D OPR Output

7 Encoding for register selection fields BINARY CODESEL ASEL BSEL D 000 001 010 011 100 101 110 111 Input R1 R2 R3 R4 R5 R6 R7 INPUT R1 R2 R3 R4 R5 R6 R7 INPUT R1 R2 R3 R4 R5 R6 R7

8

9 A stack is a storage device that stores information in such a manner that the item stored last is the first item retrieved. A stack is a storage device that stores information in such a manner that the item stored last is the first item retrieved. Stack is a LIFO (Last In First Out ) list. Stack is a LIFO (Last In First Out ) list. The register that hold the address of the stack called a stack pointer (SP) The register that hold the address of the stack called a stack pointer (SP) The operation of inserting items to a stack is called push deletion operation is called pop The operation of inserting items to a stack is called push deletion operation is called pop

10 C B A 63 4 3 2 1 0 SP FULLEMPTY Now the value of SP is 3. because C is the top of the stack.

11 SP SP+1 // Increment stack pointer M[SP] DR // Write item on top of stack If(SP==0) then // Check the stack is full (FULL 1) EMPTY 0 // Stack not empty

12 DR M[SP] // read item on top of stack [SP] SP-1 // Decrement stack pointer If(SP==0) then // Check the stack is empty (EMPTY 1) FULL 0 // set the Stack not full

13 The common arithmetic expressions are written in Infix notation, operators written between the operands. The common arithmetic expressions are written in Infix notation, operators written between the operands. A * B + C * D A * B + C * D In prefix or (Polish notation) operators before the operands ( +AB) In prefix or (Polish notation) operators before the operands ( +AB) In postfix or (Reverse Polish notation) operators after the operands (AB+) In postfix or (Reverse Polish notation) operators after the operands (AB+)

14 A * B + C * D Infix format A B * C D * + prefix format (Reverse polish) The stack perform the Reverse polish notation. For example : Consider the arithmetic operation :- (3*4) + (5*6) In reverse polish notation :- 3 4 * 5 6* +

15 3 4 312 5 6 5 30 1242 3 4 * 5 6 * + STACK operations to evaluate 3 *4 +5*6

16

17 The no of address fields in The instruction format is depends on the internal organization of the registers in a CPU. The no of address fields in The instruction format is depends on the internal organization of the registers in a CPU. 3 types of CPU Organizations :- 3 types of CPU Organizations :- 1.Single Accumulator organization 2.General register organization 3.Stack organization

18 Types of address instructions Three address instruction Mainly used in register operations Example x= (a+b)*(c+d) ADD R1, A, B R1<-M[A]+M[B] ADD R2, C, DR2<-M[C]+M[D] MUL X, R1, R2R1*R2

19 Two address instruction Mainly used in register operations Example x= (a+b)*(c+d) MOV R1, A R1<-M[A] ADD R1, BR1<-R1+M[B] MOVE R2, C R2<-M[C] ADD R2, DR2<-R2+M[D] MUL R1, R2R1<- R1*R2 MOV X, R1M[X]<-R1

20 One address instruction Mainly used in accumulator registers Example x= (a+b)*(c+d) LOAD A AC <-M[A] ADD BAC <-AC+M[B] STORE T M[T]<-AC LOAD C AC <-M[C] ADD DAC <-AC+M[D] MUL TAC <- AC*M[T] STORE XM[X] <-AC

21 Zero address instruction used in STACK registers. Push and pop are the operations. TOS is the top of the stack. Example x= (a+b)*(c+d) PUSH A TOS <- A PUSH B TOS <- B ADDTOS <- (A+B) PUSH C TOS <- A PUSH D TOS <- B ADD TOS <- (C+D) MUL TOS <- (C+D) * (A+B) POP X M[X] <-TOP


Download ppt "CPU performs the bulk of data processing operations CPU performs the bulk of data processing operations The CPU is made up of three parts. They are Control."

Similar presentations


Ads by Google