0% found this document useful (0 votes)
10 views31 pages

Document From Pratheesh

This report details the multiplication of two 16-bit numbers using the 8085 microprocessor as part of a laboratory course at PSG College of Technology. It includes sections on the definition, features, architecture, and instruction set of the 8085 microprocessor, as well as a practical implementation of the multiplication algorithm. The document serves as a comprehensive guide for students in the Instrumentation and Control Engineering program, highlighting both theoretical and practical aspects of microprocessor operations.

Uploaded by

pgeethalakshmi73
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views31 pages

Document From Pratheesh

This report details the multiplication of two 16-bit numbers using the 8085 microprocessor as part of a laboratory course at PSG College of Technology. It includes sections on the definition, features, architecture, and instruction set of the 8085 microprocessor, as well as a practical implementation of the multiplication algorithm. The document serves as a comprehensive guide for students in the Instrumentation and Control Engineering program, highlighting both theoretical and practical aspects of microprocessor operations.

Uploaded by

pgeethalakshmi73
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

PSG COLLEGE OF TECHNOLOGY

(Autonomous Institution)
COIMBATORE – 641 004
A report submitted in partial fulfilment of the requirements for the course

23U410 MICROPROCESSORS AND MICROCONTROLLERS


LABORATORY

RAGUL S (23U235)
II YEAR (IV SEMESTER)

PROGRAMME: B.E. INSTRUMENTATION AND CONTROL


ENGINEERING
BRANCH: DEPARTMENT OF INSTRUMENTATION AND CONTROL
SYSTEMS ENGINEERING

1
PSG COLLEGE OF TECHNOLOGY
COIMBATORE – 641 004
(Government aided autonomous college affiliated to Anna university, Chennai)

23U410 MICROPROCESSORS AND MICROCONTROLLERS


LABORATORY
MULTIPLICATION OF TWO 16-BIT NUMBERS USING 8085
MICROPROCESSOR

A REPORT
SUBMITTED BY
RAGUL S (23U235)
II YEAR B.E. ICE

DEPARTMENT OF INSTRUMENTATION AND CONTROL SYSTEMS


ENGINEERING
………………….
Faculty in charge

2
Table of Contents
SECTION PAGE NO

List of Figures 5

List of Tables 5

1. Introduction 6

1.1 Definition of microprocessor 6

1.2 Introduction of 8085 microprocessor 6

1.3 Features of 8085 microprocessor 6

1.4 Architecture 8085 microprocessor 8

1.5 PIN Diagram of 8085 10


microprocessor
1.6 Signal Diagram of 8085 13
microprocessor

1.7 Programmers Model of 8085 13


microprocessor

1.8 Addressing modes of 8085 14


microprocessor

1.9 Instruction set of 8085 15


microprocessor

1.10 OP Code sheet of 8085 19


microprocessor

1.11 List of IC’s in 8085 trainer kit and 20


its functions

1.12 Operating procedure of trainer kit 21

2 . Multiplication of two 16-Bit numbers 23


BCD to Binary

2.1 Objective 23

2.2 Hardware and Software used 23

2.3 Theory 23

3
2.4 Algorithm 24

2.5 Flowchart 25

2.6 Assembly language program 26

2.7 Calculation 28

2.8 Output table 28

2.9 Inference 29

2.10 Conclusion 30

References 31

4
LIST OF FIGURES

FIGURE NO NAME OF FIGURE PAGE NO

1.1 Architecture of 8085 8


microprocessor

1.2 Flag Registers 9

1.3 PIN diagram of 8085 10


microprocessor

1.4 Signal diagram of 8085 13


microprocessor

1.5 Hardware and Software 13


Model

1.6 Programmers Model 14

1.7 OP Code sheet of 8085 19

2.1 Flowchart 25

2.2 Assembly language program 26

LIST OF TABLES

TABLE NO TABLE NAME PAGE NO

2.1 Output Table 28

5
CHAPTER 1
INTRODUCTION
1.1 DEFINITION OF MICROPROCESSSOR
Microprocessor is a multipurpose or general-purpose, register-based, clock-based, even-based,
semiconducting electronic IC, which accepts digital data as input, processes the data according
to the instructions stored in the memory, and provides result as output. 8085 is an 8-bit
microprocessor as it operates on 8 bits at a time and is created with N-MOS technology. The
size of the data bus of 8085 is 8 bits while that of the address bus is 16. Therefore, can
address 64 KB (i.e.216) memory. Also, as it can perform 8-bit operation thus the size of ALU is
also 8-bit. and operates at 3.2 MHz single segment CLK. The applications of 8085
microprocessor are involved in microwave ovens, washing machines, gadgets, etc
1.2 INTRODUCTION TO 8085 MICROPROCESSSOR
Developed by Intel Corporation in the late 1970s, the 8085 microprocessor revolutionized the
field, paving the way for countless advancements in technology. In this article, we delve into
the architecture, features, and impact of the 8085 microprocessor, showcasing important points
such as 8085 microprocessor architecture, 8085 microprocessor pin diagram, 8085
microprocessor instruction set, functional unit and more. The 8085 microprocessor is an 8-bit
microprocessor that was introduced by Intel in 1976. It is part of the 8085 family of
microprocessors, which includes the 8080, 8085A, and other variants. The 8085
microprocessor became very popular and widely used in various applications, including
personal computers, embedded systems, industrial control systems, and more. It has the
following configuration:
• 8-bit data bus
• 16-bit address bus, which can address upto 64KB
• A 16-bit program counter
• A 16-bit stack pointer
• Six 8-bit registers arranged in pairs: BC, DE, HL
• Requires +5V supply to operate at 3.2 MHZ single phase clock.

1.3 FEATURES OF 8085 MICROPROCESSSOR


Features of 8085 microprocessor are given below:
8-bit Data Bus: The 8085 has an 8-bit data bus, which means it can transfer 8 bits of
data between the microprocessor and memory or I/O devices at a time.
16-bit Address Bus: The 8085 uses a 16-bit address bus, allowing it to access up to 64
KB (216) of memory. This limitation makes it suitable for small-scale computing
applications.

6
Address & Data Bus Multiplexed: In the 8085, the data bus (D0 – D7) and lower 8-
bit address bus (A0 – A7) are multiplexed in order to reduce the number of external
pins. However, as a result, address lines and data lines must be separated by additional
hardware (Latch).
Single +5V Power Supply: The 8085 microprocessor operates on a single +5V power
supply, making it suitable for low-power applications. Power supply is connected to
Vdd and Ground is connected to Vss.
Clock Frequency: The 8085 typically operates at a clock frequency of 3 MHz. 8085A-
2 version can operate at a maximum frequency of 5 MHz. It functions on a 50% duty
cycle clock cycle.
Clock Generator: It has on chip clock generator. This internal clock generator requires
a calibrated LC, RC, or crystal circuit. The internal clock generator generates clock
signal by dividing oscillator frequency by two.
Registers: It has six general-purpose registers, these are register B, C, D, E, H, and L,
which can be used individually (as 8-bit) or in pairs (as 16-bit) to perform various
arithmetic and logical operations.
Accumulator: The accumulator (A register) is a special 8-bit register used for
arithmetic and logic operations. Most arithmetic operations involve the accumulator.
Flag Register: The flag register consists of various flags that are set or reset based on
the result of the previous operation. The flags include Carry (CY), Auxiliary Carry
(AC), Sign (S), Zero (Z), Parity (P), and Overflow (V).
Stack Pointer (SP): The 8085 has a 16-bit stack pointer, which points to the memory
location where the stack is currently located. The stack is used for storing return
addresses and local data during subroutine calls.
Program Counter (PC): The program counter is a 16-bit register that holds the
memory address of the next instruction to be executed.
Instruction Set: The 8085 microprocessor supports 246 instructions, including
arithmetic operations (addition, subtraction, etc.), logical operations (AND, OR, XOR),
data transfer operations, branching instructions, and more.
Interrupts: The 8085 supports five hardware interrupts, these are TRAP, RST 7.5, RST
6.5, RST 5.5, and INTR. These interrupt lines allow external devices to request attention
from the microprocessor.
Serial Input/Output Ports: The 8085 has two serial I/O ports (SID and SOD) for serial
communication with peripherals like keyboards, displays, and other devices.
Control Signal: It provides control signals (IO/M(low), RD(low), WR(low)) to control
the bus cycle, and hence external bus controller is not required.
DMA Controller: The 8085 is capable of sharing the system interface with Direct
Memory Access controller. This feature permits the transmission of large amounts of
data at high velocities from I/O devices to memory or from I/O devices.

7
1.4 ARCHITECTURE OF 8085 MICROPROCESSSOR

Figure 1.1Architecture of 8085 Microprocessor

Operations of the 8085 Microprocessor:


The main operation of ALU is arithmetic as well as logical which includes addition, increment,
subtraction, decrement, logical operations like AND, OR, Ex-OR, complement, evaluation, left
shift or right shift. Both the temporary registers as well as accumulators are utilized for holding
the information throughout the operations then the outcome will be stored within the
accumulator. The different flags are arranged or rearrange based on the outcome of the
operation.
Flag Registers
The flag registers of microprocessor 8085 are classified into five types namely sign, zero,
auxiliary carry, parity and carry. The positions of bit set aside for these types of flags. After the
operation of an ALU, when the result of the most significant bit (D7) is one, then the sign flag
will be arranged. When the operation of the ALU outcome is zero then the zero flags will be
set. When the outcome is not zero then the zero flags will be reset.

8
Figure 1.2 Flag Registers

In an arithmetic process, whenever a carry is produced with the lesser nibble, then an auxiliary
type carry flag will be set. After an ALU operation, when the outcome has an even number then
the parity flag will be set, or else it is reset. When an arithmetic process outcome in a carry,
then carry flag will be set or else it will be reset. Between the five types of flags, the AC type
flag is employed on the inside intended for BCD arithmetic as well as remaining four flags are
used with the developer to make sure the conditions of the outcome of a process.
Control and Timing Unit:
The control and timing unit coordinates with all the actions of the microprocessor by the clock
and gives the control signals which are required for communication among the microprocessor
as well as peripherals.
Register Array:
The general purpose programmable registers are classified into several types apart from the
accumulator such as B, C, D, E, H, & L. These are utilized as 8-bit registers otherwise coupled
to stock up the l6 bit of data. The permitted couples are BC, DE & HL registers are used in the
processor & it cannot be utilized with the developer.
Decoder and Instruction Register:
As an order is obtained from memory after that it is located in the instruction register, and
encoded & decoded into different device cycles.
Special Purpose Registers:
These registers are classified into four types namely program counter, stack pointer, increment
or decrement register, address buffer, or data buffer.
Program Counter:
This is the first type of special-purpose register and considers that the instruction is being
performed by the microprocessor. When the ALU completed performing the instruction, then
the microprocessor searches for other instructions to be performed. Thus, there will be a
requirement of holding the next instruction address to be performed in order to conserve time.
Microprocessor increases the program when an instruction is being performed, therefore that
the program counter-position to the next instruction memory address is going to be performed.
Stack Pointer in 8085:
The SP or stack pointer is a 16-bit register and functions similar to a stack, which is constantly
increased or decreased with two throughout the push and pop processes.

9
Increment or Decrement Register:
The 8-bit register contents or else a memory position can be increased or decreased with one.
The 16-bit register is useful for incrementing or decrementing program counters as well as
stack pointer register content with one. This operation can be performed on any memory
position or any kind of register.
Address-Buffer & Address-Data-Buffer:
Address buffer stores the copied information from the memory for the execution. The memory
& I/O chips are associated with these buses; then the CPU can replace the preferred data by
I/O chips and the memory.
Address Bus and Data Bus:
The data bus is useful in carrying the related information that is to be stock up. It is bi-
directional, but the address bus indicates the position as to where it must be stored & it is uni-
directional, useful for transmitting the information as well as address input/output devices.
Timing & Control Unit:
The timing & control unit can be used to supply the signal to the 8085 microprocessor
architecture for achieving the particular processes. The timing and control units are used to
control the internal as well as external circuits. These are classified into four types namely
control units like RD ALE, READY, WR, status units like S0, S1, and IO/M , DM like HLDA,
and HOLD unit, RESET units like RST-IN and RST-OUT.

1.5 PIN DIAGRAM OF 8085 MICROPROCESSSOR:

Figure 1.3 PIN Diagram of 8085

10
The 8085 microprocessor pin diagram provides a visual representation of the connections and
functionalities of the different pins on the 8085 microprocessor.
Data Bus
The pins from 12 to 17 are the data bus pins which are AD0 – AD7, this carries the minimal
considerable 8-bit data and address bus.
Address Bus
The pins from 21 to 28 are the data bus pins which are A8 – A15, this carries the most
considerable 8-bit data and address bus.
Status and the Control Signals
In order to find out the behaviour of the operation, these signals are mainly considered. In the
8085 devices, there are 3 each the control and status signals.
RD :
This is the signal used for the regulation of READ operation. When the pin moves into low, it
signifies that the chosen memory is read.
WR:
This is the signal used for the regulation of WRITE operation. When the pin moves into low, it
signifies that the data bus information is written to the chosen memory location.
ALE :
ALE corresponds to Address Latch Enable signal. The ALE signal is high at the time of the
machine’s initial clock cycle and this enables the last 8 bits of the address to get latched with
the memory or external latch.
IO/M :
This is the status signal that recognizes whether the address to be allotted for I/O or for memory
devices.
READY :
This pin is used to specify whether the peripheral is able to transfer information or not. When
this pin is high, it transfers data and if this is low, the microprocessor device needs to wait until
the pin goes to a high state.
CLOCK SIGNALS:
CLK – This is the output signal which is pin 37. This is utilized even in other digital integrated
circuits. The frequency of the clock signal is similar to the processor frequency.
X1 and X2 – These are the input signals at pins 1 and 2. These pins have connections with the
external oscillator that operates the device’s internal circuitry system. These pins are used for
the generation of the clock that is required for the microprocessor functionality.

11
RESET SIGNALS:
There are two reset pins which are Reset In and Reset Out at pins 3 and 36.
RESET IN:
This pin signifies resetting the program counter to zero. Also, this pin resets the HLDA flip-
flops and IE pins. The control processing unit will be in a reset state till RESET is not triggered.
RESET OUT:
This pin signifies that the CPU is in reset condition.
SERIAL INPUTS /OUTPUT SIGNALS:
SID :
This is the serial input data line signal. The information that is on this dateline is taken into the
7th bit of the ACC when the RIM functionality is performed.
SOD :
This is the serial output data line signal. The ACC’s 7th bit is the output on the SOD data line
when the SIIM functionality is performed.
EXTERNALLY INITIATED AND INTERRUPT SIGNALS:
HLDA :
This is the signal for HOLD acknowledgment that signifies the received signal of HOLD
request. When the request is removed, the pin goes to a low state. This is the output pin.
HOLD :
This pin indicates that the other device is in the need to utilize data and address buses. This is
the input pin.
INTA:
This pin is the interrupt acknowledgment that is directed by the microprocessor device after
the receival of the INTR pin. This is the output pin.
INTR:
This is the interrupt request signal. It has minimal priority when compared with other interrupt
signals.
The priority list of these interrupt signals is,
• TRAP – Highest
• RST 7.5 – High
• RST 6.5 – Medium
• RST 5.5 – Low
• INTR – Lowest

12
1.6 SIGNAL DIAGRAM OF 8085 MICROPROCESSSOR

Figure 1.4 Signal diagram of 8085

1.7 HARDWARE MODEL AND PROGRAMMERS MODEL OF 8085


MICROPROCESSSOR

Figure 1.5 Hardware and Software Model

13
Figure 1.6 Programmers Model of 8085

1.8 ADDRESSING MODES OF 8085 MICROPROCESSSOR


The addressing modes of the 8085 microprocessors can be defined as the commands offered
by these modes which are utilized for denoting the information in different forms without
altering the content. These classified into five groups namely immediate, register, direct,
indirect, and implied addressing modes.
Immediate Addressing Mode:
Here, the source operand is the information. When the information is of 8-bit, then the
instruction is of 2 bytes. Or else when the information is of 16-bits, then the instruction is of 3
bytes.
• MVI B 60 – It implies moving the 60H date quickly to the B register.
• JMP address – It implies to quick jumping of the operand address.
Register Addressing Mode:

Here, the information which has to be operated is present in the registers and the operands are
the registers. So, the operation takes place inside multiple registers of the microprocessor.

• INR B – It implies to increment of the register B content by one bit.

• MOV A, B – It implies moving of contents from register B to A.

Direct Addressing Mode:

Here, the information which has to be operated is present in the memory location, and the
operand is directly considered as the memory location.

• LDA 2100 – It implies to loading of memory location content to accumulator A.

14
• IN 35 – It implies reading of the information from the port that has address 35.

Indirect Addressing Mode:

Here, the information which has to be operated is present in the memory location, and the
operand is indirectly considered as the register pair.

LDAX B – It implies moving contents of the B-C register to the accumulator.

Implicit Addressing Mode:

Here, the operand is concealed and the information that has to be operated is present in the
data itself.
• RRC – Implies of rotating accumulator A to the right position by one bit.
• RLC – Implies of rotating accumulator A to left position by one bit.

1.9 INSTRUCTION SET OF 8085 MICROPROCESSSOR


The 8085 Microprocessor, introduced by Intel, has a set of instructions that allows it to perform
a variety of tasks such as arithmetic operations, data transfer, control, and logic operations.
The instructions in 8085 are divided into several groups based on their function. Here’s a
summary of the different types of instructions in the 8085 Microprocessor

1. Data Transfer Instructions


These instructions are used to transfer data between registers, memory, and I/O ports.
• MOV: Move data from one register to another.
• MVI: Move immediate data to a register or memory.
• LDA: Load the accumulator with data from memory.
• STA: Store the accumulator's data into memory.
• LDAX: Load the accumulator from memory (based on the BC or DE pair).
• STAX: Store the accumulator's data into memory (based on the BC or DE pair).

2. Arithmetic Instructions
These instructions are used for performing arithmetic operations like addition, subtraction,
and
incrementing values.
• ADD: Add contents of a register or memory to the accumulator.
• ADI: Add immediate data to the accumulator.
• SUB: Subtract contents of a register or memory from the accumulator.
• SUI: Subtract immediate data from the accumulator.
• INR: Increment the contents of a register or memory by 1.
• DCR: Decrement the contents of a register or memory by 1.
.
15
3. Logical Instructions
These instructions are used for logical operations such as AND, OR, XOR, etc.
• ANA: AND the contents of a register or memory with the accumulator.
• ANI: AND immediate data with the accumulator.
• XRA: XOR the contents of a register or memory with the accumulator.
• XRI: XOR immediate data with the accumulator.
• ORA: OR the contents of a register or memory with the accumulator.
• ORI: OR immediate data with the accumulator.
• CPI: Compare the accumulator with immediate data.
• RLC: Rotate the accumulator left through the carry.
• RRC: Rotate the accumulator right through the carry.

4. Branch Control Instructions


These instructions control the flow of program execution by altering the program counter.
• JMP: Jump to a specified memory location.
• JC: Jump if the carry flag is set.
• JNC: Jump if the carry flag is not set.
• JZ: Jump if the zero flag is set.
• JNZ: Jump if the zero flag is not set.
• CALL: Call a subroutine at the specified address.
• RET: Return from a subroutine.

5. Control Instructions
These are instructions used to control the internal state of the microprocessor.
• NOP: No operation
• HLT: Halt the execution of the program.

16
17
• JPO addr (label) (Jump if odd parity)

1. IN port-address. (Input to accumulator from I/O port)


2. OUT port-address (Output from accumulator to I/O port)
3. PUSH rp (Push the content of register pair to stack)
4. PUSH PSW (PUSH Processor Status Word)
5. POP rp (Pop the content of register pair, which was saved, from the stack)
6. POP PSW (Pop Processor Status Word)
7. HLT (Halt)
8. XTHL (Exchange stack-top with H-L)
9. SPHL (Move the contents of H-L pair to stack pointer)
10. EI (Enable Interrupts)
11. DI (Disable Interrupts)
12. SIM (Set Interrupt Masks)

18
13. RIM (Read Interrupt Masks)
14. NOP (No Operation)

1.10 OPCODE SHEET 8085 MICROPROCESSSOR

Figure 1.7 OP Code Sheet of 8085

19
1.11 LIST OF IC’S IN 8085 TRAINER KIT AND ITS FUNCTIONS

1. Microprocessor IC

• IC 8085 – 8-bit microprocessor (central processing unit).

2. Memory ICs

• IC 2764 / 27128 (EPROM) – Stores firmware/monitor program.

• IC 6116 / 6264 (RAM) – Volatile memory for temporary data storage.

3. Peripheral ICs

• IC 8255 (Programmable Peripheral Interface - PPI) – Controls input/output devices.

• IC 8253 / 8254 (Programmable Interval Timer - PIT) – Provides precise timing/delays.

• IC 8251 (USART - Universal Synchronous/Asynchronous Receiver-Transmitter) –


Serial communication (RS-232).

• IC 8279 (Keyboard and Display Controller) – Handles keyboard scanning and display
output.

• IC 8237 (DMA Controller - Optional) – Manages direct memory access for faster data
transfer.

4. Buffer, Latch, and Bus Control ICs

• IC 74373 (Octal Latch) – Holds address information and separates address/data bus.

• IC 74244 (Octal Bus Buffer) – Buffers data/address lines.

• IC 74245 (Bus Transceiver) – Bi-directional data bus buffer for input/output.

• IC 74138 (3-to-8 Decoder) – Used for memory and I/O selection.

• IC 74154 (4-to-16 Decoder) – Often used for address decoding.

5. Clock and Reset Circuit ICs

• IC 555 (Timer IC) – Generates clock pulses for timing control.

20
• IC 7404 (Hex Inverter) – Used in clock and reset signal circuits.

• IC 7486 (Quad XOR Gate) – Used for generating control signals.

• IC 7408 (Quad AND Gate) – Used in logic control operations.

6. Power and Driver ICs

• IC 7805 (Voltage Regulator) – Provides a stable +5V power supply.

• IC ULN2003 (Relay Driver IC) – Drives relays, motors, or LEDs.

7. Display and Indicator ICs

• IC 7447 (BCD to 7-Segment Decoder) – Drives 7-segment displays.

• IC 7476 (JK Flip-Flop) – Used for counters and control circuits.

1.12 OPERATING PROCEDURE OF 8085 MICROPROCESSOR TRAINER KIT


Step 1: Powering ON the Kit
• Ensure proper connections :
o Connect the trainer kit’s power supply (typically +5V and +12V for different
sections).
o Ensure the monitor/display unit (if external) is properly connected.
o If required, connect an external keyboard.
• Power ON the Kit:
o Switch ON the trainer kit.
o Observe the display (if available) or status LEDs to confirm power.
Step 2: Resetting the System :
• Press the RESET button to initialize the 8085 microprocessor.
• The monitor program (preloaded firmware in ROM) should start and display a prompt
on the screen.
Step 3: Entering a Program :
• Select the Memory Address Mode :
o Enter the starting address (e.g., 2000H).
o Enter the program instructions (in hex code) using the keypad or terminal.

21
• After entering the program, verify the instructions.
Step 4: Executing the Program :
• Set the Program Counter (PC) to the starting address (e.g., 2000H).
• Press RUN/EXECUTE to start execution.
• Observe the results on:
o Display/LEDs (if output is mapped to a display).
o Memory locations (using the memory inspect feature).
Step 5: Debugging & Modifying the Program :
• Use the Single Step Mode to execute one instruction at a time.
• Inspect the registers and memory contents for debugging.
• Modify instructions if necessary using the keypad.
Step 6: Storing and Reloading a Program :
• If the trainer kit supports EEPROM or External Storage, you can save and reload your
program.
• Some kits allow communication via serial ports (RS-232) to upload programs from a
PC.
Step 7: Powering OFF the Kit :
• Ensure no program is running.
• Power OFF the trainer kit properly.
• Disconnect external components if required.

22
CHAPTER 2
COMULTIPLICATION OF TWO 16-BIT NUMBER
USING 8085 MICRO PROCESSOR

2.1 OBJECTIVE
To write an assembly language multiplication of two 16-bit numbers using
8085 Simulator.

2.2 HARDWARE AND SOFTWARE USED


Hardware Used:(Laboratory)
1. 8085 Microprocessor Kit – For executing the assembly code.
2. Power Supply Unit – To provide required voltage levels.
3. Hex Keypad – For inputting the BCD number.
4. LED Display or Monitor – For displaying the converted binary output.
5. Memory (ROM/RAM) – For storing the program and data.
6. Clock Circuit – To generate timing signals for synchronization.
Software Used:

1. Jubin Mitra 8085 Simulator – Used for writing, assembling, and debugging the
8085 assembly code.
2. Assembler – Converts assembly language into machine code.
3. Debugger/Emulator – For verifying and troubleshooting program execution.

2.3 THEORY
Introduction
The 8085 microprocessor, being an 8-bit processor, performs 16-bit multiplication using
multiple steps. Since it lacks a direct multiplication instruction, the process is done using
repeated addition or the shift-and-add method. The 16-bit numbers are divided into 8-bit parts,
and partial products are generated and summed to obtain a 32-bit result. The final product is
stored in memory as lower and upper 16-bit parts.

Concept of Multiplication of two 16-bit numbers


1. The 8085 microprocessor is an 8-bit processor, so it cannot directly multiply 16-bit
numbers.

2. Multiplication is performed using successive 8-bit multiplications and addition.

23
3. The 16-bit numbers are divided into lower and upper 8-bit parts for processing.

4. Partial products are generated by multiplying these 8-bit parts separately.

5. These partial products are properly shifted and added to form the final 32-bit result.

6. Since 8085 lacks a direct multiplication instruction, repeated addition or the shift-and-add method
is used.

7. The final 32-bit product is stored in memory, with the lower and upper 16-bit parts kept separately.

8. This approach allows the 8085 to handle large-number multiplications efficiently.

8085 Microprocessor and Its Role in Conversion


The 8085 microprocessor, an 8-bit microprocessor, processes data through registers and
arithmetic instructions. The conversion from BCD to binary is performed using simple
assembly language instructions such as logical operations, multiplication, and addition. The
key operations include:

• Logical AND & Masking: To separate MSD and LSD.


• Multiplication by 10: To convert MSD to decimal.

• Addition: To obtain the final binary equivalent.

Implementation Using Jubin Mitra Simulator


Jubin Mitra’s 8085 simulator provides a user-friendly environment for coding, debugging, and
executing 8085 assembly language programs. The simulator allows:
• Writing assembly language programs.
• Step-by-step execution with debugging.
• Memory and register monitoring for result verification.
2.4 ALGORITHM
1. Load the first data in the HL pair.
2. Move content of HL pair to the stack pointer.
3. Load the second data in the HL pair and move it to DE.
4. Make H register as 00H and L register as 00H.
5. ADD HL pair and stack pointer.
6.Check for carrying if carry increment it by 1 else moves to
the next step.
7. Then move E to A and perform OR operation with
accumulator and register D.
8. If the value of the operation is zero, then store the value
else go to step 3.
24
2.5 FLOWCHART

Figure 2.1 Flowchart

25
2.6 ASSEMBLY LANGUAGE PROGRAM

Figure 2.2 Assembly Language Program

26
This algorithm multiplies two 16-bit numbers stored in memory locations
8000H and 8002H, using repeated addition.

Step 1: Initialize the Stack Pointer


Set the stack pointer to 2000H.

Step 2: Load the First Number (Multiplicand) into DE


Load the 16-bit number from 8000H into HL.
Exchange HL and DE so that DE holds the first number.

Step 3: Load the Second Number (Multiplier) into BC


Load the 16-bit number from 8002H into HL.
Store it temporarily in the stack.
Retrieve the value from the stack and move it into the BC register.

Step 4: Initialize Product Storage


Clear HL (HL will store the product).
Store 0000H at memory location 8052H (least significant part of the result).

Step 5: Perform Multiplication Using Repeated Addition


Add DE (multiplicand) to HL.
If carry is generated, store it in an extra location.
Decrement BC (multiplier) until it reaches zero.
Repeat addition while BC 0.

Step 6: Store the Final Result


Store the final product in memory at 8050H and 8052H.

Step 7: Terminate the Program


Execute HLT to stop execution.

27
2.7 CALCULATION

Let's assume the following input values:

8000H-8001H = 0005H (Multiplicand, 5 in decimal)

8002H-8003H = 0003H (Multiplier, 3 in decimal)

The program performs multiplication using repeated addition.

1. Initialize HL to 0000H (to store the result).

2. Add 0005H (DE) to HL → HL = 0005H (1st addition).

3. Add 0005H (DE) to HL → HL = 000AH (2nd addition).

4. Add 0005H (DE) to HL → HL = 000FH (3rd addition).

5. BC (Multiplier) reaches 0, so store the result.

6. Final result stored at 8050H = 000FH (15 in decimal).

Since there is no carry, the upper result (stored at 8052H) remains 0000H.

2.8 OUTPUT TABLE


ADDRESS(H) DATA(H)

INPUT 1 8000 24

INPUT 2 8001 1C

INPUT 3 8002 52

OUTPUT 1 88
8050
OUTPUT 2 8051 FF
OUTPUT 3 8052 CD

Table 2.1 Output Table

28
2.9 INFERENCE
tMultiplication of two 16-bit numbers using the 8085 microprocessor requires breaking the
operation into smaller steps since the 8085 does not have a built-in multiplication instruction.
Instead, the multiplication is performed using a combination of successive addition, shift-and-
add techniques, or repeated calls to an 8-bit multiplication routine.

To begin with, the two 16-bit numbers are stored in memory or registers. Each number is then
divided into two 8-bit parts: the lower byte and the higher byte. This allows the multiplication
to be carried out in multiple steps. The process starts with multiplying the lower bytes of both
numbers, which gives the least significant part of the result. Next, crosswise multiplication is
performed between the higher byte of the first number and the lower byte of the second
number, and vice versa. These partial products are shifted left by 8 bits before being added to
the previous result. Finally, the higher bytes of both numbers are multiplied, and this result is
shifted left by 16 bits before being added to obtain the final 32-bit product.

Since the 8085 microprocessor can only handle 8-bit operations, an 8-bit multiplication
subroutine is used repeatedly to perform these steps. This subroutine typically employs
successive addition, where one operand is added repeatedly to itself as many times as
specified by the other operand, or it may use a look-up table for optimization. The
intermediate results are carefully managed to avoid overflow and ensure correct alignment
within the 32-bit product.

Once all partial products are computed and summed, the final result is stored in consecutive
memory locations. This ensures that it can be used for further processing or displayed as
needed. Despite the lack of direct multiplication support, this method allows the 8085 to
effectively multiply two 16-bit numbers with accuracy.

29
2.10 CONCLUSION

In conclusion, although the 8085 microprocessor lacks a direct multiplication instruction,


multiplying two 16-bit numbers can be achieved through systematic breakdown into 8-bit
operations. By dividing the numbers into high and low bytes and using successive addition or
shift-and-add techniques, a 32-bit product can be accurately obtained. The use of an 8-bit
multiplication subroutine ensures efficient computation, while proper alignment of partial
products maintains correctness. This method demonstrates how fundamental arithmetic
operations can be implemented in microprocessors with limited instruction sets, highlighting
the importance of logical structuring and optimization in low-level programming.

30
REFRENCES

RAMESH SGOANKAR,"MICROPROCESSOR ARCHITECTURE,


PROGRAMMING,AND APPLICATIONS WITH THE 8085",SIXTH EDITION,PENRAM
INTERNATIONAL 2013.
KRISHNA KANT,"MICROPROCESSORS AND
MICROCONTROLLERS:ARCHITECTURE,PROGRAMMING AND SYSTEM DESIGN
8085,8086,8051,8096",SECOND EDITION,PHI LEARNING PVT.LTD.,2016

31

You might also like