Microprocessor 123

Embed Size (px)

Citation preview

  • 7/29/2019 Microprocessor 123

    1/4

    1. Convert the decimal number 321.145 to octal andhexadecimal. Ans.125 / 8^2 =1125 ((8^2)*1) = 6161 / 8^1 =7

    61 ((8^1)*7) =5Therefore, 12510= 1758.321.145 = 321/8^

    2. Write an assembly language program to find the smallestamong twonumbers.Ans.

    ProgramMVI B, 30HMVI C, 40HMOV A, BCMP CJZ EQUJC SMLOUT PORT1HLTEQU: MVI A, 01HOUT PORT1HLT

    SML: MOV A, COUT PORT1

    HLT

    OR

    .model small

    .stack 64

    .data

    n1 db 08h,02h

    res db ?

    .code

    mov ax,@data.

    mov ds,ax

    mov cx,02

  • 7/29/2019 Microprocessor 123

    2/4

    lea si,n1

    mov bl,0ffh

    mine:mov al,[si]

    cmp al,bljne loop1

    jmp loop2

    loop1:jnc loop2

    mov bl,al

    inc si

    loop mine

    jmp exit

    loop2:inc si

    loop mine

    exit:mov res,bl

    hlt

    end

    3. Draw and explain the internal architecture of 8085.

    Ans.Figure 3: Internal Architecture of 8085

  • 7/29/2019 Microprocessor 123

    3/4

  • 7/29/2019 Microprocessor 123

    4/4

    Data BusData Bus: carries data, in binary form, between microprocessor andotherexternal units, suchas memory. Typical size is 8 or 16 bits. TheData Bus typically consists of 8 wires. Therefore, 28combinations ofbinary digits. Data bus used to transmit data, ie information, resultsofarithmetic, etc, between memory and the microprocessor. Bus is bi-directional. Size of thedata bus determines what arithmetic can bedone. If only 8 bits wide then largest number is

    11111111 (255 indecimal). Therefore, larger number have to be broken down intochunks of255. This slows microprocessor. Data Bus also carriesinstructions from memory to themicroprocessor. Size of the bustherefore limits the number of possible instructions to 256,eachspecified by a separate number.

    Control BusControl Bus are various lines which have specific functions forcoordinating and controllingmicroprocessor operations. Eg:Read/NotWrite line, single binary digit. controls whether memoryisbeing written to (data stored in mem) or read from (data taken outof mem) 1 = Read, 0 =Write. May also include clock line(s) fortiming/synchronising, interrupts, reset etc. Typicallymicroprocessorhas 10 control lines. Cannot function correctly without these vitalcontrol signals.

    CPU ArchitectureControl UnitGenerates signals within microprocessor to carry out the instruction,which has been decoded. Inreality causes certain connectionsbetween blocks of the microprocessor to be opened or closed,so thatdata goes where it is required, and so that ALU operations occur.

    Arithmetic Logic UnitThe ALU performs the actual numerical and logic operation such asadd, subtract, AND,OR, etc. Uses data from memory and fromAccumulator to perform arithmetic. Always storesresult of operation inAccumulator.

    RegistersThe 8085/8080A-programming model includes six registers, oneaccumulator, and one flagregister, as shown in Fig. 2.1 In addition, ithas two 16-bit registers: the stack pointer and theprogram counter. They are described briefly as follows. The 8085/8080A has six general-purpose registers to store 8-bit data;these are identified as B,C,D,E,H and L as shown in thefigure.