0% found this document useful (0 votes)
62 views13 pages

Mic Micro Project

Uploaded by

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

Mic Micro Project

Uploaded by

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

SANJIVANI K.B.P.

POLYTECHNIC
KOPERGAON-423603,DIST: AHMEDNAGAR

A
PROJECT REPORT
ON

”CONVERTING HEXADECIMAL INTO BCD”

SUBMITTED BY
Mst.Abhijit Tribhuvan [216]
Mst.Shridhar Wakte [230]

Under the Guidance of

Mrs R.R.BORNARE

Department of Computer Technology

DEPARTMENT OF COMPUTER TECHNOLOGY


Sanjivani Rural Educational Society’s
SANJIJVANI K.P.B POLYTECHNIC
KOPARGAON-423601, DIST:AHMEDNAGAR

2022-23
Sanjivani Rural Education Sociecity’s

SANJIVANI K.B.P POYTECHNIC


DEPARTMENT OF COMPUTER TECHNOLOGY
2022-2023

CERTIFICATE
This is to certify that the Project report entitled

”CONVERTING HEXADECIMAL INTO BCD”

SUBMITTED BY

216-Abhijit Tribhuvan
230-Shridhar Wakte
Under our supervision and Guidance for partial fulfillment

of the requirement for


Diploma in Computer Technology affiliated to
Mahrashtra State Board of Technical
Education,Mumbai for academic year
2022-2023

Mrs.R.R.BORNARE Prof.G.N.JORVEKAR
Guide H.O.D

2
ACKNOWLEDGMENT

First and the foremost we,express my deep sense of gratitude,sincere and deep
sense of appreciation to project Guide Mrs R.R.Bornare,Department of Computer
Technology,Sanjivani K.B.P.Polytechnic Kopargaon.Your availability at any time
throughout the year,valuable
guidance,option,view,comments,critics,encouragement,and support tremendously
boosted this project work.

Lots of thanks to Mr.G.N.Jorvekar,head of Department Computer Technology


Department,for providing us the best support we ever had.We like to express my
sincere gratitude to Mr.A.R.Mirikar,principal,Sanjivani
K.B.P.Polytechnic,Koparagaon for providing a great platform to complete the
project within the schedule time.

we are also thankful to all the faculty members,computer Technology


Department,Sanjivani K.B.P.polytechnic,Kopargaon for giving comments
for
improvement of work,encouragement and help during completion of the project.

Last but not the least,we should say thanks from our bottom of heart to my
Family and Friends for their never ending love,help,and support in so many ways
through all this time.

Thank you so much.

3
INDEX

SR.NO TOPIC PAGE NO.


1) Introduction 5
2) Algorithm 6
3) Flowchart 8
4) Code 9
5) Output 11
6) Conslusion 12
7) Reference 13

4
INTRODUCTION

In this microproject we written an example of hex to BCD conversion and we try


to compute all our knowledge,In this project we give the flowchart and Algorithm to
understand it easily
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

5
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 V : Subtract 10,000 decimal from AX and add 1 decimal to

DH Step VI : Jump to step IV.

Step VII : Compare number 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

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

7
FLOWCHART

8
CODE
.model small
.stack 100
.code
mov ax, 0ffh ; 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
12: 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
9
mov cx, 0204h ; Count to display
; 2 digits
go: rol dh, cl

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

10
11
CONSLUSION
In this project we are written the whole code of the converting hexadecimal into
BCD,Here we are try to put our knowledge of converting hexadecimal into
BCD.This Project gives us conversion of hexadecimal into BCD. In this microproject
we written an example of hex to BCD conversion and we try to compute all our
knowledge,In this project we give the flowchart and Algorithm to understand it
easily.We have writ- ten algorithm for converting hexadecimal into BCD as well as
we have also drawn a flowchart of hexadecimal to BCD conversion. we have also
tried to make simple code for conversion of hexadecimal into BCD. We have also
generate the right out- put of the converting hexadecimal into BCD. This code will
convert any hexadecimal number into BCD number so that it would be very easy to
convert hexadecimal into BCD. This code will save the time of converting
hexadecimal number to BCD. In this project writing the code of converting
hexadecimal into BCD.So that it would be easy to understand.

REFERENCE

https://www.studocu.com

12

You might also like