You are on page 1of 4

1. Convert the decimal number 321.145 to octal andhexadecimal. Ans.

125 / 8^2 = 1 125 ((8^2)*1) = 6161 / 8^1 = 7 61 ((8^1)*7) = 5 Therefore, 125 10 = 175 8 . 321.145 = 321/8 ^ 2. Write an assembly language program to find the smallestamong two numbers.Ans. Program MVI B, 30H MVI C, 40H MOV A, B CMP C JZ EQU JC SML OUT PORT1 HLT EQU: MVI A, 01H OUT PORT1 HLT SML: MOV A, C OUT PORT1

HLT OR .model small .stack 64 .data n1 db 08h,02h res db ? .code mov ax,@data. mov ds,ax mov cx,02

lea si,n1 mov bl,0ffh mine:mov al,[si] cmp al,bl jne 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

8085 System Bus Typical system uses a number of busses, collection of wires, whichtransmit binary numbers, one bit per wire. A typical microprocessorcommunicates with memory and other devices (input and output)using three busses: Address Bus, Data Bus and Control Bus. Address Bus One wire for each bit, therefore 16 bits = 16 wires. Binary numbercarried alerts memory to open the designated box. Data (binary) canthen be put in or taken out. The Address Bus consists of 16 wires,therefore 16 bits. Its width is 16 bits. A 16 bit binary number allows216 different numbers, or 32000 different numbers, ie0000000000000000 up to 1111111111111111. Because memoryconsists of boxes, each with a unique address, the size of the addressbus determines the size of memory, which can be used. Tocommunicate with memory the microprocessor sends an address onthe address bus, eg 0000000000000011 (3 in decimal), to thememory. The memory selects box number 3 for reading or writing Assignment by: Paramjeet Singh Virdi, Roll number: 521022919 Address bus is unidirectional, i.e numbers only sent frommicroprocessor to memory, not other way.

Data Bus Data Bus: carries data, in binary form, between microprocessor andother external units, such as memory. Typical size is 8 or 16 bits. TheData Bus typically consists of 8 wires. Therefore, 28 combinations of binary digits. Data bus used to transmit data, ie information, resultsof arithmetic, etc, between memory and the microprocessor. Bus is bi-directional. Size of the data 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 of 255. This slows microprocessor. Data Bus also carriesinstructions from memory to the microprocessor. Size of the bustherefore limits the number of possible instructions to 256, eachspecified by a separate number. Control Bus Control Bus are various lines which have specific functions forcoordinating and controlling microprocessor operations. Eg:Read/NotWrite line, single binary digit. controls whether memory isbeing 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. Typically microprocessorhas 10 control lines. Cannot function correctly without these vitalcontrol signals. CPU ArchitectureControl Unit Generates signals within microprocessor to carry out the instruction,which has been decoded. In reality 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 Unit The ALU performs the actual numerical and logic operation such asadd, subtract, AND, OR, etc. Uses data from memory and fromAccumulator to perform arithmetic. Always stores result of operation inAccumulator. Registers The 8085/8080A-programming model includes six registers, oneaccumulator, and one flag register, as shown in Fig. 2.1 In addition, ithas two 16-bit registers: the stack pointer and the program counter. They are described briefly as follows. The 8085/8080A has six generalpurpose registers to store 8-bit data;these are identified as B,C,D,E,H and L as shown in the figure.