Translate

Search This Blog

Showing posts with label Microprocessor. Show all posts
Showing posts with label Microprocessor. Show all posts

Tuesday, 8 April 2014

What is flag in 8085 microprocessor ?

The 8085 microprocessor includes five flip-flops,also called FLAGS,which are set of reset after an operation according to data conditions of the result in the accumulator and other registers. They are called Zero(Z);Carry(CY);Sign(S);Parity(P) and Auxiliary carry (AC) flags, and the most commonly used flags are ZERO,CARRY and SIGN. The 8085 microprocessor  used this flags to test the data conditions.
This flags have critical importance in the decision making process in 8085 simulator. The conditions (Set or rest) of the flags are tested through software instruction. For example: the instruction JC ( Jump to Carry) is implemented to change the sequence of a program when the CY flag is set. A good understanding about this five flag is essential in writing assembly language programs. The overall description about this flags are : 

S-Sign flag :
        After the execution of Arithmetic and logical operations, if the bit D7 of the result ( usually in the accumulator ) is 1, the sign flag is set. This flag is used with signed numbers in a given byte, if D7 is 1 , the number will be viewed as a negative number , if it is 0 then the number will be considered as positive. In arithmetic operations signed numbers, bit D7 is reserved for indicating the sign , and the remaining seven bits are used to represented the magnitude of a number. However, unsigned numbers , even if bit D7 of a result is 1 and the flag is set , it does not mean the result is negative.

AC-Auxiliary Carry flag:
         In arithmetic operation when a carry is generated by digit D3 and passed it to digit D4, the AC flag is set. This flag is used internally for BCD(Binary-Coded-Decimal) operations and is not available for the programmer to change the sequence of the program with a jump instruction. 

P-Parity Flag:
        After an arithmetic or logical operation, if the result has an even number of 1s, the flag is set. If it has an odd number of 1s the flag is reset.

CY-Carry flag: 
       If an arithmetic operation result in a carry, the carry flag is set ; otherwise it is rest. The carry flag also serves a borrow flag for subtraction.  

What is stack in 8085 microprocessor ?

Stack is a group of memory location in the read/write memory . It is used for storage of binary information during the execution of a program. The beginning of the stack is define in the program by using the instruction .
               LXI SP 
This instruction loads a 16 bit memory address in stack pointer register (SP) of the microprocessor. Once the SP is defined , storing of the data bites begins at the memory address that is one less than the address in the SP. The information is stored in reversed numeric order . 
Data bytes in the register pair of the microprocessor can be stored in the stack in reversed order by using the instruction , RSH. Data bytes can be transferred form the stack to representative register by using the instruction, POP.
Since two data bytes are being stored at a time, the 16 bit memory address in the SP is decremented by 2. When data bytes are retrieved, the address is incremented by 2.
The stack is initialized at the highest available memory location to prevent the program from being removed by the stack information.


Stack instruction : 
  • To create the stack , initialize the SP register. This can be done by using the following instruction.
                      LXI SP, 16 bit address
          This instruction loads SP register with the 16bit address
  • The following instruction insert element into the stack.
           PUSH Rp
       Where Rp stands for register pair. The instruction copies the contents specified by the register pair into the stack.

Example :
   PUSH    B
   PUSH    D
   PUSH    H
When PUSH Rp is encounter the SP is decremented and the content of higher order register, B,D or H are copied in the location shown by SP. The SP is again decremented and the lower order register content will be copied into the stack.
  • To delete an element from the stack using the following instruction 
    POP    Rp
It copies the content of the top two memory location of the stack into the specified register pair, Rp first content of the memory location indicated by the SP is copied into the lower order register and the SP is incremented by 1. Now this Content is copied into the higher order register. Stack instruction belong to data transfer group, Thus content of source are not effected and no flags are effected.
 Example:
    POP   B
    POP   D
    POP   H

Tuesday, 1 April 2014

Arithmetic Micro-operations of 8085 microprocessor

A micro-operation is an elementary operation performed with the data stored in register. The micro-operation most often encountered in digital computers are classified into four categories.

  • Register transfer micro-operations transfer binary information from one register to another register .
  • Arithmetic micro-operation perform arithmetic operations on numeric data stored in registers.
  • Logical micro-operation perform bit manipulation operation on non-numeric data stored in register
  • shift micro-operations perform shift operations on data stored in register.
The register transfer micro-operation was introduced in our previous post. This type micro-operation does not change the information content when the binary information moves from the source register to destination register. The other three type of micro-operations change the information content during the transfer. In this post we introduce a set of arithmetic micro-operations.
the basic arithmetic micro-operations are addition,subtraction,increment,decrements,and shift. Arithmetic shifts are explaining later in the conjunction with the shift micro-operation. The arithmetic micro-operation define by the following statement :

                                           R3 <- R1 + R2

Add micro-operation :  Specifies an Add micro-operation. it state the content of register 1 (R1) are added to the content of register R2 and the sum transfer to the register R3 .To implement this statement with hardware we need three register and the digital components that performs the addition operation. The other basic micro-operation are listed in Table - 1.

Subtract micro-operation : Subtraction is most often implemented through complementation and addition. Instead of using the minus operator , we can specify the subtraction by the following statement :
                                                               
                                        R3 <- R1 + R2 + 1  
    
R2 is the symbol for 1's complement of R2. Adding 1 to the 1's complemnt produce the 2's complement. Adding the content of R1 to the 2's complement of R2 is equivalent to R1 - R2 .


                                   TABEL - 1 Arithmetic Micro-operation .


             

Monday, 31 March 2014

In 8085 Microprocessor how register transfer is made ?

Information transfer from one register to another is designated in symbolic form by mean of a replacement  operator . The statement
                                               
                                                   R2 <- R1

denotes a transfaer of content of register R1 into R2 . It designates a replacement of the content of R2 by the content of R1 . By definition, the content of the source register R1 does not change after the transfer .


A statement that specify the register transfer implies that circuit are available form the output of the source register to to the inputs of the destination register and that the destination register has a parallel load capacity . Normally, we want the transfer occur only under a predetermined controll condition. This can be shown by means of an if-then statement. 
                                                        
                                                    if(p=1) then (R2 <- R1)

where P is the control signal generated in the control section. It is something convenient to separate the control variable from the register transfer operation by specifying a control function. A control function is a Boolean variable that is equal to 0 or 1. The control function included the statement as follows :

                                                    P : R2 <- R1

The control condition is terminated with a colon. Its symbolized the requirement. That the transfer operation be executed by the hardware only if P = 1.
Every statement written in a register transfer notation implies a hardware construction for implementing the transfer. fig-1 shows the blog diagram that indicates the transfer from R1 to R2 . Then n output of the register R1 are connected to the n input of register R2. the letter n used to indicate any number of bits for the register. It will be replaced by an actual number when the length of the register is known. Register R2 has a load input that is activated by control variable p. It is assumed that the control variable is synchronize with the same clock as the one applied to the register. As shown in the timing diagram.

Fig-1 Transfer from R1 to R2 when p=1.




                                                         timing diagram


   

Sunday, 23 March 2014

What is Op-code and Operands ? ( 8085 microprocessor)

An Op-code is short for " Operational code ".
An Op-code is a single instruction that can be executed by the CPU . In machine language it is a binary or Hexadecimal value such as " B6 " loaded into the instruction register .
In assembly language mnemonic form of an OP-Code is a command such as MOV or ADD or JMP .

for example : MOV , AL , 34h

The OP-Code is the MOV instruction . The Other parts are called Operands .
Operands are manipulated by the OP-Code . In the example , The Operand are the register name " AL " and the value " 34 Hex . "

Friday, 21 March 2014

Feature of 8085 microprocessor (For engineering students )


  • It is a 8 bit Microprocessor ( each bit is represented in bits or bytes)
  • It is manufactured with N-MOS ( N type Metal Oxide Semiconductor ) technology implemented with 6200 transistor 
  • It has 16 bit address line A0-A15 and it can point up to 64 KB memory location.
  • It has a 16 bit Program counter
  • It has a 16 bit stack pointer 
  • It can perform arithmetical and logical operations .
  • First 8 bit address bus and 8 bit data bus are multiplexed AD0-AD7 . Data bus is a group of 8 lines  D0-D7.
  • It consist 74 instruction sets .
  • It provides 1 accumulator , 2 flag register , 6 general purpose register arranged in pairs : BC , DE , HL and 2 special purpose register .
  • It provide 5 level interrupts and support external interrupt request .

Disadvantage and Limitation of 8085 Microprocessor  

  • The 8085 microprocessor is a 8 bit microprocessor , hence it can perform operation only on two 8 bit numbers 
  • The 8085 microprocessor has 16 bit address line and 8 bit data line 
  • The 8085 can address maximum memory of 64 KB 
  • The 8085 microprocessor cannot perform any operation on ASCII number 
  • The 8085 microprocessor cannot perform multiplication and division of numbers.
  • The 8085 microprocessor cannot perform multiplication , division , subtraction of BCD numbers.
  •  The 8085 microprocessor cannot transfer a data directly one memory to another memory .
  • The 8085 microprocessor can only address 256 I/O ports .
  • The 8085 microprocessor cannot perform the pipeline instructions .
  • The 8085 microprocessor there is no provision to determine whether the result obtained is within the limit of 8/16 bit number.