Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Experiment 4: 1’s and 2’s complement of 8-bit number.

Student Name: Yash Gautam UID: 20BCS7550


Branch: CSE Section/Group: 718 B
Semester: 4th Date of Performance:01/04/2022
Subject Name: MPI Lab Subject Code:20CSP-153

1. Aim/Overview of the practical: Write two programs to show 1’s and 2’s complement of
an 8-bit number.

2. Task to be done: We have to write two programs to show 1’s and 2’s complement of an
8-bit number.

3. Apparatus/Simulator used (For applied/experimental sciences/materials based labs):


 Jubin 8085 Simulator
 Java Language
 JDK
4. Algorithm/Flowchart (For programming based labs):
A. For 8-bit numbers:

 Begin.
 Move value in A Register.
 Perform 1’s complement using CMA command.
 Store the value of accumulator using STA command.
 Halt the program

B. For 16-bit numbers:


 Begin.
 Move value in A Register.
 Perform 1’s complement using CMA command.
 Store the value of accumulator using STA command.
 Increment the value of accumulator by 1.
 Store the value of accumulator in other location using STA command.
 Halt the program
5. Description/ Code:
 1’s complement of 8-bit number:

#BEGIN 0000H
MVI A, 40
CMA
STA 1001H
HLT

 2’s complement of 8-bit number:

#BEGIN 0000H
MVI A, 40
CMA
STA 1001H
INR A
STA 1002H
HLT
6. Result/Output/Writing Summary:

 1’s complement:
 2’s complement:
Learning outcomes (What I have learnt):

1. Learnt CMS command.

2. Learnt STA command.

3. Learnt how to do 1’s complement of 8-bit number.


4. Learnt how to do 2’s complement of 8-bit number.

5. Learnt basic programming in Jubin Simulator.

Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):

Sr. No. Parameters Marks Obtained Maximum Marks


1.
2.
3.

You might also like