You are on page 1of 17

MAHARASHTRA STATE BOARD OF TECHNICAL

EDUCATION – MUMBAI
Program: Information Technology Course code:(22323)

Micro Project Report On

BCD To HEX Conversion in


Assembly Language Code
Submitted by,

Pratik Girkar (22) Sahil Rajole (25)

Paritosh Sandhan (45)

Guided by
Prof. C.S Mogare
Lecturer
Department of Information Technology,
MET’S Institute of Technology , Polytechnic , Nasik
Academic Year -2022-2023
ACKNOWLEDGEMENT

We take this opportunity to express our deepest sense of gratitude and


sincere thanks to those who have helped us in completing this task

We express our sincere Thanks to our guide PROF. C.S. Mogare .lecturer
in IT department. Who has given us valuable suggestion excellent guidance,
continues encouragement and taken keen interest in the completion of this work.
Her kind assistance and constant inspiration will always help us in our future
also.

We thank PROF. S.B.Patil HOD of Information Technology


Department, for the co-operation and encouragement for collecting information
and preparation of data

We are thankful to principal DR.R.S.Narkhede, for encouraging us to


undertake this project and she has taken interest in making the project and report
absolutely flawless

Credit goes to our friends’ staff member of information technology


Department and the institute’s library for their helps and timely assistance.
Annexure I

“BCD To HEX Conversion in


Assembly Language Code”

1.0 Aim of the Micro-project:


To understand the concepts of Assembly Language.
To understand Assembly Language concepts and Application.

2.0 Course Outcome Addressed:


Understand the the concepts of Assembly Language.
Understand of Assembly Language concepts and Application.

3.0 Proposed Methodology:

We have a 4 digit Hex number whose equivalent binary number is to be found i.e.
FFFF H. Initially we compare FFFF H with decimal 10000 ( 2710 H in Hex ). If number
is greater than 10,000 we add it to DH register. Also, we subtract decimal 10,000 from
FFFF H, each time comparison is made. Then we compare the number obtained in AX by
1000 decimal. Each time we subtract 1000 decimal from AX and add 1000 decimal to
BX. Then we compare number obtained in AX by 100 decimals. Each time we subtract
100 decimal from AX and add 100 decimal to BX to obtain BCD equivalent. Then we
compare number obtained in AX with 10 decimal. Each time we subtract 10 decimal
from AX and we add 10 decimal to BX. Finally we add the result in BX with remainder
in AX. The final result is present in register DH with contains the 5th bit if present and
register AX.
4.0 Action Plan:

S. No. Details of activity Planned Planned Name of Responsible


Start date Finish date Team Members

1 Searching & allocation of Pratik Girkar


Topic 5/9/2022 5/9/2022 Sahil Rajole
Paritosh Sandhan

2 Collection of data of Pratik Girkar


Selected topic 21/9/2022 21/9/2022 Sahil Rajole
Paritosh Sandhan

3 Planned to prepared the Pratik Girkar


project 1/10/2022 1/10/2022 Sahil Rajole
Paritosh Sandhan

4 Development of Project Pratik Girkar


followup 15/10/2022 15/10/2022 Sahil Rajole
Paritosh Sandhan

5 Pratik Girkar
31/11/2022 31/11/2022 Sahil Rajole
Completion of project
Paritosh Sandhan

6 Pratik Girkar
16/11/2022 16/11/2022 Sahil Rajole
Project Report Preparation
Paritosh Sandhan

7 Pratik Girkar
6/12/2022 6/12/2022 Sahil Rajole
Project Report submission
Paritosh Sandhan

8 Presentation of Project Pratik Girkar


14/12/2022 14/12/2022 Sahil Rajole
Paritosh Sandhan
4.0 Resources Required:
S. No. Name of Specifications Qty Remarks
Resource/material

1 Computer system Windows 10 1

2 Website -------------- 1

3 Software 1
TASM

5.0 Name of Team Members with Roll No:

1. Sahil Nandkishor Rajole (25)


2. Pratik Deep Girkar (22)
3. Paritosh Ranjeet Sandhan (45 )
Annexure II

“BCD To HEX Conversion in


Assembly Language Code”

1.0 Aim of the Micro-project:


To understand the concepts of Assembly Language.
To understand Assembly Language concepts and Application.

2.0 Course Outcome Addressed:


Understand the the concepts of Assembly Language.
Understand of Assembly Language concepts and Application.

3.0 Actual Methodology Followed:

We have a 4 digit Hex number whose equivalent binary number is to be found i.e.
FFFF H. Initially we compare FFFF H with decimal 10000 ( 2710 H in Hex ). If number
is greater than 10,000 we add it to DH register. Also, we subtract decimal 10,000 from
FFFF H, each time comparison is made. Then we compare the number obtained in AX by
1000 decimal. Each time we subtract 1000 decimal from AX and add 1000 decimal to
BX. Then we compare number obtained in AX by 100 decimals. Each time we subtract
100 decimal from AX and add 100 decimal to BX to obtain BCD equivalent. Then we
compare number obtained in AX with 10 decimal. Each time we subtract 10 decimal
from AX and we add 10 decimal to BX. Finally we add the result in BX with remainder
in AX. The final result is present in register DH with contains the 5th bit if present and
register AX.
4.0 Literature review:

BCD To HEX Conversion in Assembly Language Code

Write a Program For Hex to BCD Conversion in Assembly language .

We have a 4 digit Hex number whose equivalent binary number is to be found i.e.
FFFF H. Initially we compare FFFF H with decimal 10000 ( 2710 H in Hex ). If number is
greater than 10,000 we add it to DH register. Also, we subtract decimal 10,000 from FFFF H,
each time comparison is made. Then we compare the number obtained in AX by 1000 decimal.
Each time we subtract 1000 decimal from AX and add 1000 decimal to BX. Then we compare
number obtained in AX by 100 decimals. Each time we subtract 100 decimal from AX and add
100 decimal to BX to obtain BCD equivalent. Then we compare number obtained in AX with 10
decimal. Each time we subtract 10 decimal from AX and we add 10 decimal to BX. Finally we
add the result in BX with remainder in AX. The final result is present in register DH with contains
the 5th bit if present and register AX.

Algorithm For Hex to BCD Conversion

Step I : Initialize the data segment.


Step II : Initialize BX = 0000 H and DH = 00H.
Step III : Load the number in AX.
Step IV : Compare number with 10000 decimal. If below goto step
VII else goto step V.
Step V : Subtract 10,000 decimal from AX and add 1 decimal to DH
Step VI : Jump to step IV.
Step VII : Compare number in AX with 1000, if below goto step X else
goto step VIII.
Step VIII : Subtract 1000 decimal from AX and add 1000 decimal to
BX.
Step IX : Jump to step VII.
Step X : Compare the number in AX with 100 decimal if below goto
step XIII
Step XI : Subtract 100 decimal from AX and add 100 decimal to BX.
Step XII : Jump to step X
Step XIII : Compare number in AX with 10. If below goto step XVI
Step XIV : Subtract 10 decimal from AX and add 10 decimal to BX..
Step XV : Jump to step XIII.
Step XVI : Add remainder in AX with result in BX.
Step XVII : Display the result in DH and BX.
Step XVIII : Stop.
Program For Hex to BCD Conversion Code

.model small
.stack 100
.code
mov ax, 0ffffh ; hex number to find it's bcd
mov bx, 0000
mov dh, 0
l9 : cmp ax, 10000 ; if ax>10000
jb l2
sub ax, 10000 ; subtract 10000
inc dh ; add 1 to dh
jmp l9
l2 : cmp ax, 1000 ; if ax>1000
jb l4

sub ax, 1000


add bx, 1000h ; add 1000h to result
jmp l2
l4 : cmp ax, 100 ; if ax>100
jb l6
sub ax, 100
add bx, 100h ; add 100h to result
jmp l4
l6 : cmp ax, 10 ; if ax>10
jb l8
sub ax, 10
add bx, 10h ; add 10h to result
jmp l6
l8 : add bx, ax ; add remainder
; to result
mov ah, 02
mov cx, 0204h ; Count to display
; 2 digits
go: rol dh, cl
mov dl, dh
and dl, 0fh
add dl, 30h ; display 2 msb digits
int 21h
dec ch
jnz go
mov ch, 04h ; Count of digits to be
; displayed
mov cl, 04h ; Count to roll by 4 bits
l12: rol bx, cl ; roll bl so that msb
; comes to lsb
mov dl, bl ; load dl with data to be
; displayed
and dl, 0fH ; get only lsb
cmp dl, 09 ; check if digit is 0-9 or letter A-F
jbe l14
add dl, 07 ; if letter add 37H else only add 30H
l14: add dl, 30H
mov ah, 02 ; Function 2 under INT 21H (Display character)
int 21H
dec ch ; Decrement Count
jnz l12
mov ah, 4cH ; Terminate Program
int 21H
end
Program:-
5.0 Actual Methodology Followed:

We have a 4 digit Hex number whose equivalent binary number is to be found i.e.
FFFF H. Initially we compare FFFF H with decimal 10000 ( 2710 H in Hex ). If number is
greater than 10,000 we add it to DH register. Also, we subtract decimal 10,000 from FFFF H,
each time comparison is made. Then we compare the number obtained in AX by 1000 decimal.
Each time we subtract 1000 decimal from AX and add 1000 decimal to BX. Then we compare
number obtained in AX by 100 decimals. Each time we subtract 100 decimal from AX and add
100 decimal to BX to obtain BCD equivalent. Then we compare number obtained in AX with
10 decimal. Each time we subtract 10 decimal from AX and we add 10 decimal to BX. Finally
we add the result in BX with remainder in AX. The final result is present in register DH with
contains the 5th bit if present and register AX.

6.0 Actual Resources Used:

S. No. Name of Specifications Qty Remar


Resource/material ks

1 Computer system Windows 10 1

2 Website ------------- 1

3 Software TASM 1
6.0 Outcome of micro project :-

• Understood the concept of Assembly


Language.

7.0 Skill develop of micro project :-

• Aware about the facts of Assembly


Language
Micro Project Evaluation Sheet
Name of Student:- Pratik Girkar Enrolment No:-2107760281

Name of Program: INFORMATION TECHNOLOGY Semester: - 3rd

Seat No.: 348011

Course Title:- Digital Techniques and Microprocessor Code:-22323

Title of Micro-Project:- BCD To Hex Conversion in Assembly Language Code .

Course Outcomes Achieved:- Understood the concept of BCD To Hex Conversion in


Assembly Language Code .

(A) (B) Total


Marks
Individual Presentation/Viva
Process and Product Assesment
(4 marks) 10

Comments/Suggestions about team work/leadership/inter-personal communication(if any)


………………………………………………………………………………………………………

……………………………………………………………………………………………………….

……………………………………………………………………………………………………….

Name of the teacher:- C.S.Mogare ………………………………………………………

Dated Signature………………………………………………………………………
Micro Project Evaluation Sheet

Name of Student:- Sahil Rajole Enrolment No:- 2107760284

Name of Program: INFORMATION TECHNOLOGY Semester: - 3rd

Seat No.: 348014

Course Title:- Digital Techniques and Microprocessor Code:-22323

Title of Micro-Project:- BCD To Hex Conversion in Assembly Language Code .

Course Outcomes Achieved:-

Understood the concept of BCD To Hex Conversion in Assembly Language


Code .

(A) (B) Total


Marks
Process and Product Assesment Individual Presentation/Viva
(4 marks) 10

Comments/Suggestions about team work/leadership/inter-personal communication (if any)


....................................................................................................................................... ………………
....................................................................................................................................... ..........
……………………………………………………………………………………………………….

Name of the teacher:- C.S.Mogare …………………………………………………………………


..................................................................................

Dated Signature:- ………………………………………………………………………..


…………………………………………………………………………………………..
Micro Project Evaluation Sheet

Name of Student:- Paritosh Sandhan Enrolment No:- 2107760312

Name of Program: INFORMATION TECHNOLOGY Semester: - 3rd

Seat No.:-348034

Course Title :- Digital Techniques and Microprocessor Code:-22323

Title of Micro-Project:- BCD To Hex Conversion in Assembly Language Code


Course Outcomes Achieved:- Understood the concept of BCD To Hex Conversion in
Assembly Language Code.

(A) (B) Total


Marks
Process and Product Assesment Individual Presentation/Viva
(4 marks) 10

Comments/Suggestion about team work/leadership/inter-personal communication (if any):-


.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
...............

Name of the teacher:- C.S.Mogare ………………………………………………………


..................................................................................

Dated Signature:-…………………………………………………………………………….
……………………………………………………………………………………………………

You might also like