computer architectures

22
Computer Architecture : Lecture 2

Upload: ahmad-bilal

Post on 04-Dec-2015

11 views

Category:

Documents


1 download

DESCRIPTION

Informs all about computer architecture and flags

TRANSCRIPT

Page 1: Computer Architectures

Computer Architecture :Lecture 2

Page 2: Computer Architectures

Understanding Basics of Addresses

• Ask your friend who cannot read Urdu, to pick a book for you (marked red) from an Urdu book shelf, and give it to you. After you have read it, ask it to place in the shelf marked with black arrow

Page 3: Computer Architectures

Understanding Basics of Addresses

• Hence we will need to tell him two number. The shelf number (vertical) and number of book (horizontal)

Page 4: Computer Architectures

Understanding Basics of Addresses

1. The addresses also work in same manner. We need to inform about the addresses to memory (in a stack) in vertical and horizontal (size of address, normally 8 bit)

2. The memory can be said to divide into cell.3. The address bus generate a binary number,

which gives us information of memory cell, and its size.

• Early processors used a wire for each bit of the address width. For example, a 16-bit address bus had 16 physical wires making up the bus.

Page 5: Computer Architectures

The big problem

• Let’s say processor want to add. • Here we need to understand what operand is.• Operand is that data element on which

operation is carried out. So if we are adding two numbers we need two operands

Page 6: Computer Architectures

The big problem

• As per previous discussion, processor can only read from one memory cell and if we want to add two numbers. We need two operands.

• But we know that our processor can only read from one memory cell.

• So the question is, how can it carry put operations on two operands

Page 7: Computer Architectures

What an Idea Sir jee

• We all know that at one time we can access data only from one memory cell.

• But in carrying most operations we need two memory locations (like addition, subtractions).

• In this case, the processor store data of first memory cell in its own memory, called “Register (scratch pad ram)” and then carries out the operation using data stored in register and the data stored second memory cell.

Page 8: Computer Architectures

Understanding basic of Registers

Page 9: Computer Architectures

• Although different manufactures name their registers independently. We here have a look at general architecture regarding the registers Accumulator Register Pointer/Index/Base Register Flags / Program Status Word Register

Page 10: Computer Architectures

Accumulator Register

Function 1. Mathematical and logical operations are carried

out in this register 2. Example add, subtract, or gate 3. The 8 bit processor means the accumulator is

also 8 bit

Page 11: Computer Architectures

Pointer/Index/Base Register

• . Stores addresses not data• An index register in a computer's CPU is a

processor register used for modifying operand addresses during the run of a program,

Page 12: Computer Architectures

Why we need to store addresses

Page 13: Computer Architectures

Flags / Program Status Word Register

• Flag register can be of 8 bit 16 bit or 32 bit. Each bit in this flag represents or show some separate information.

Page 14: Computer Architectures

Instruction Groups

• We all know that computer works with the help of instructions. We have divided the different instructions in different groups, for better understanding. Their name are as follow:- Data Movement instructions  Arithmetic / Logic Instructions\ Program Control Instruction Special instructions

Page 15: Computer Architectures

• 1Data Movement instructions a. Deals with data movement from memory to processor or

processor to memory b. Deal with movement from register to register or from

register to memory / processor• 2. Arithmetic / Logic Instructions

a. Deals with mathematical function ( + , – multiply ) or logical functions (and, Xor)

• 3. Program Control Instruction a. We know normally the instructions are carried out one by

one (consecutively) . However some times we do not need to run consecutive instruction. For these purposes , such commands are use (You man like to think about command “if”)

• 4. Special instructions a. They are used to force processor to change its behavior

as per our will

Page 16: Computer Architectures

DATA MOVEMENT Instructions

• a. Deals with data movement from memory to processor or processor to memory

• b. Deal with data movement from register to register or from register to memory / process

Page 17: Computer Architectures

Arithmetic / Logic Instructions

• a. Deals with mathematical function ( + , – multiply ) or logical functions (and, Xor)

Add ax,1234                             Add 1234 with ax

Add bx,ax                                  add ax to bx

Add bx,[1212]                           add data from address and add it to bx

Page 18: Computer Architectures

Program Control

• a. We know normally the instructions are carried out one by one (consecutively) . However some times we do not need to run consecutive instruction. For these purposes , such commands are use (You man like to think about command “if”)

Cmp ax,0                                compare ax with 0

Jne 1234                                 jump if not equal to the instruction

and mov at address 1234

Page 19: Computer Architectures

Special Instruction

Cli                                      disable interrupts

Page 20: Computer Architectures

 Special instructions

• . They are used to force processor to change its behavior as per our will

Cli         disable interrupts

Page 21: Computer Architectures

The First Commercial Success : Study Case

• Model :      IBM PC• Reason :    Easily available platform , and free

software available to program• Processor:  IAPX88 (Intel Advance Processor 88)• This was the first processor that was implanted on a

IBM system. It was the first commercial success. Later on intel released IAPX 38086

• IAPX88 was a 16 bit microprocessor.• Intel created 4 bit processors , however the first 8 bit

processor by intel was 8080. Later on a advance version 8085 was introduced, which was 8 bit processor but had more computational power as compared to its ancestors

• The 8088 had a 1 MB memory , which was a big achievement. The first IBM Machine had 4.1 Mhz , which was considered a high speed.

Page 22: Computer Architectures

Register Architecture