Experiment-5: 8085 ALP to find 2‘s complement of an 8 bit number 8085 MPI Lab by Ravinder Nath Rajotiya - March 23, 2021June 3, 20210 AIM: Write a program to find 2‘s complement of an 8 bit number. Objective: To understand the complement process To write algorithm for 1’s complement To develop the assembly language program to find 2’s complement To analyse the result and interpret errors if any Requirement: Operating System- Windos, Linux 8085 simulator Theory 2’s complement of a number is found in following ways: Do the 1’s complement of the given number Add ‘1’ to this 1’s complement Example: Find the 2’s complement of 59h Number 59h = 01011001 1’s complement = 10100110 Adding ‘1’ = 10100110 + 1 = 10100111 So, 2’s complement of 59h = A7h Algorithm: Get a number in the accumulator Complement using CMA Add ‘1’ to this to get 2’s complement Save the result Assembly language
Experiment-4: 8085 ALP program to find 1‘s complement of an 8 bit number 8085 MPI Lab by Ravinder Nath Rajotiya - March 13, 2021June 3, 20210 Experiment-4: Write a program to find 1‘s complement of an 8 bit number. Objective: To understand the complement process To write the algorithm for 1’s complement To develop the assembly program To analyze the program and interpret errors and result Requirement: Operating System – Windows, Linux 8085 Simulator Theory: 1’s complement of a number is found in the following ways: By complementing each bit of the number OR By subtracting the number from all 1’s Eg. 1’s complement of binary number 10101100 is 01010011 OR 1’s complement of binary number 10101100 1 11 11 111 -10101100 ------------------ 01010011 Algorithm: Input the number into the accumulator Complement using instruction CMA, Result in accumulator Save the result Program: Address OP-CODE Label Mnemonic Comments C9 05 042 JMP start 4203 45H X: 4204 00 Y 4205 start: NOP 4206 21,03,42 LXI H, X 4209 7E MOV A,M 421A 2F CMA 421B 76 HLT Viva Questions
Signed Number Systems STLD/Digital Electronics by Ravinder Nath Rajotiya - July 31, 2019May 10, 20210 Signed Number System In signed number systems, a number is represented with two parts; one the sign bit, and the rest bits denote the magnitude of the number. Signed number are represented using the following representation: Sign and Magnitude number system: 1's complement Number System 2's Complement Number System Sign and Magnitude number system In this system, the MSB is set to 0(zero) to indicate +ve number and is set to 1(one) to indicate the -ve number. Signed numbers are represented as: Complete the following Table +7 Sign Magnitude +7 0 1 1 1 -6 1 1 1 0 +25 -24 +14 -15 -10 +0 -0 Complement method: Complement of a number: Complement of a number is done to represent its -ve / or positive representation. Thus the complement of a +ve number is the -ve number, and complement of -ve number is +ve number. There are different types of