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
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