In this computer architecture post we discuss various basic concepts and operation of computer architecture, we se operation of computer at very low level.

Computer architecture is consider as very hard to understand but it is so simple and it concepts are very easy that anyone who want to learn it is not considering its simplicity abd get confused.









In this we learned concepts of computer architecture in most generalized way independent of any processor architecture of any company like intel or IBM, so that by learning concepts make easy to understand any old or modern architecture of computer.

Why computer architecture ?

If any one write any computer program in any high level computer programming language the compiler translateit, if itadds any instruction which are not required , it will increase processing time and utilize more resoruces to overcome this we require to write some part of program in assembly language and to write it we must know the low level operation of computer architecture and its concepts and writing program in assembly language insreases optimization.

Basics pf computer architecture

In a typical computer we have a processor, memory and i/o (input output) , consider following diagram, processor deals with outside world with i/o and memory is its inside world, when operation is given to processor its done it on some data element which is in memory.

From the above diagram we currently only consider only processor and memory and its communication.

There are many signals which flows to and fro between processor and memory also called lines ,these lines does different task from sending and receiving of data,controlling, etc, these signals are categorized and grouped into group called as bus or buses.

Whenever processor done some operation first its locates specific data element in memory by sending address of particular address of cell,then data is either flow from memory to processor or from processor to memoryafter operation is done its either reads or writes to memory by sending control signal.

There are three types of busese as as shown ing diagram

Address bus

Address bus is undirectional bus and always address is sent from processor to memeory only and adress bus pass address to memory and memory activate particular memory cell.

Data bus

Data bus is bisirectional , it flow data between processor and memory,it t\tnly tasks is to provide data from memory ro peocessor or fromprocessor to memory.

Control bus

Control bus is bidirectional responsible for flow of control funtion function betwween peocessor and memory like interupt,read and write status information of processor whether it want to read or it want to write memor y etc.

Bus interfacing

Consider you are in ofice you said to peon go to store room and bring book no 5 from first row from the shelf.









From aboive example processor give precise and particular address to address bus to instruct mwmory to active specific cell of memory as memory is array of cells.

Address given to adress bus is a binary number consists of 8 bits, this address may beof 8 bits12 bits,16 bits or more but ir does not exits to size of data bus of processor so interfacing is synchronized.

When cell is activated contol bus convey information from processor to memoy is processor is interested inreading or writing memory, when memory is ready processor perform its read or write by either receovomg daa through data bis or sending daya through data bus.

In normal case as in previous paragraph but in some cases memory is busy or not available due to some condition,peocessor should be infromed, this is called acknowledgement and it also handled by control bus.

Operation

When processor performs an operation data element is used specifically called as operand.

Ooeration perform by processor are logical AND,OR,NOT,add,subtract,multiplication and other operation.

If processor want to add two numbers

2+3

Here 2 and 3 are two operandds,When two operands are involved in a operation processor’s address bus lpcates and reference one operand at a time from the memory and second operand is hold in processor’s register.

To perform 2+3 ome operand is from memory andsecond operand is from peocessor’s register then peocesoor performs add and result is stored is in memory as result is one operand and processor refer or active one memeory cell using address bus.

Whenever any operation involves with two operands or more operands one operand is accessible from memory and other operands are stored in processor registers.

Register

Register are precious resources of processor built in processor and they functioned like memory to store data elements (operand).Registers are also called as scratch pad ram.

Reguster are limited in numbers and there are other regiters which functions are different from storage of operand.

Register are limited in numver so some manufacturers give name like R1,R2 or give specific name like addr (address register),ac (accmulator) etc.Register in any processor are more or less as per manufactures needs,Registers in any processor architecture are same but there nomenclaturee is different

Acccumulator

Accumulator is the central register of the processor, it is present traditionally in all processor architecture.All the mathematical and logical operation are performed on this register.

Index registers

Index registers is group of registers are also known as base registers or pointer registers.Tgey holds address of data when oconsecutive multiple operations needs to acessed jin a operationm for example in an array when one iteration is complete address of next data is need to refer which is other memory location,index registers holds addresses of these different variant memory location consectively during an operatio

Flag register

Flag register is also known as program status word register, it is a special register in which each bit has special meaning and each bit is used iindividually for special purpose , it has letters like c,s,p mwaning lke carrymoarity etc.

Flag rister bits work individually, combined them makes flag meaningless but ither registers like accumulatir bit bits works with each other as single init in an operation,

If we add two 16 bit vinary numbersu one is in accumtlator and other is in memoy,, the result of this operation may be 16 bit binary or 17 bit binary number, in 17 bit binary number case if accmutir is of 16 bit then the additional bitii is stored in carry bit of flag register.

Opcode

Processor is only understands only binary number (0 and 1), if we want to give an instruction to processor like add or any other operation we give an number to processor, this number is called opcode or operation code,processor only understand this opcode to perform an or understand an instruction.For example if we want processor to tell to do add operation we give an number like 151,processor understand that instruction is add .

Program counter

Program counter is a special register als known as instruction pointer and it stores the aaddress of next instrution to be executed , actially it store the opcode of next instruction to be executed.

Mnemonic

Processor understands only numbers, but for humans it is difficult to understand and remembernumbers like151 for add,122 for subtract,325 for multiplication, to solve this, these numbers gives a symbols which is understand by humans and these symbols are called mnemonics.

To cinvert mnemonics into numbers and converting numbers in mnemonics, a program is used which is called assemble.

Types of instructions

Data movement instructons

These types of instructions performs movement of data from memory to procressor,processor to memory,from register to register in processor.For example:

lda 23

Here this instruction loads the accumulator with2354,mnoving constant 2354 in accumulator.

Arithmetic and logic instructions

These instructions performs aarithmetic and logical operations like add,subtraxt,AND,OR and NOT.For example:

add ax ,123

ere this instruction add the integer 123 to register ax.

Program control instructions

These instructions changes the control of the program execution if we want to exwxute anorher instructions.For example if we use IF statatement in a program it will change the program control if condition is not true.

comp ax, 0

jne 1234

Here inese instructions first , value of ax register is compared with the 0,if it is not equal to 0 then jump to location 1234 (jne).

Special instructions

These instructions are used to change the behaviour of the processor or to change some states of the processor in some situations,these instruction are rarely or less used.For example:

cli

sti

The cli (clear the interupt) will clear the interupt field of the flag register ot he processor and sti (set the interupt)will set the interupt field of the flag register of the processor.

Conclusion

In this post we discuss about basics of computer architecture,why computer architecture is important,buses,types uf busese,bus interfacing,registers,types of registers,operation,opcode,instructions and types of instructions.In the next post we discusscomputer architecture example i.e. “IAPX 8088 microprocessor“