You are on page 1of 16

MAHARASHTRA STATE BOARD

OF TECHNICAL EDUCATION

A MICRO PROJECT

ON
BCD To Hexadecimal
Conversion
Submitted by
Derren Tuscano (22)
Aaryan Tuscano (31)
Laveen Dcunha (34)
Ron Correia (36)

Under the Guidance of


Prof. Sachin Sase
In partial fulfilment of Fourth Semester of
Diploma in Computer Engineering

Department of Computer Engineering.


St. John Polytechnic, Palghar
A.Y. 2023-2024

1
Subject and code: MIC (22415) Academic Year: 2023-24
Course Name and Code: CO- Semester:Fourth
4I

MICRO PROJECT REPORT ON

BCD To Hexadecimal
Conversion

Submitted in 2024 By the Group Of Students

Sr Roll No Full Name of Student Enrollment Seat No


No. Sem-IV No (Sem-IV)
1. 22 DERREN PIUS TUSCANO 2216020049
2. 31 AARYAN RICHARD TUSCANO 2216020045
3. 34 LAVEEN VIJAY DCUNHA 2216020042
4. 36 RON WILLAM CORREIA 2216020059

Under The Guidance Of


Prof. Sachin Sase

MAHARASHTRA STATE BOARD OF


TECHNICAL EDUCATION,
MUMBAI

2
Department of Computer Engineering.
St. John Polytechnic, Palghar

3
Certificate

This is to certify that Mr./Ms. DERREN PIUS TUSCANO Roll No: 22 of Fourth
Semester of Computer Engineering Diploma Programme at St. John college of
Engineering and Management has completed the Micro Project satisfactorily in subject
MICROPROCESSOR (22415) in the academic year 2023-2024 asPrescribed in the MSBTE
prescribed curriculum of I Scheme.

Place: Palghar Enrollment No: 2216020049


Date: / / 2024 Exam. Seat No:

Project Guide Head of the Department Principal

4
Certificate
This is to certify that Mr./Ms. AARYAN RICHARD TUSCANO Roll No: 31 of Fourth
Semester of Computer Engineering Diploma Programme at St. John college of
Engineering and Management has completed the Micro Project satisfactorily in subject
MICROPROCESSOR (22415) in the academic year 2023-2024 asPrescribed in the MSBTE
prescribed curriculum of I Scheme.

Place: Palghar Enrollment No: 2216020045


Date: / / 2024 Exam. Seat No:

Project Guide Head of the Department Principal

5
Certificate
This is to certify that Mr./Ms. LAVEEN VIJAY DCUNHA Roll No: 34 of Fourt Semester
of Computer Engineering Diploma Programme at St. John college of Engineering and
Management has completed the Micro Project satisfactorily in subject
MICROPROCESSOR (22415) in the academic year 2023-2024 asPrescribed in the
MSBTE prescribed curriculum of I Scheme.

Place: Palghar Enrollment No: 2216020042


Date: / / 2024 Exam. Seat No:

Project Guide Head of the Department Principal

6
Certificate
This is to certify that Mr./Ms. RON WILLIAM CORREIA Roll No: 36 of Fourth Semester
of Computer Engineering Diploma Programme at St. John college of Engineering and
Management has completed the Micro Project satisfactorily in subject MICROPROCESSOR
(22415) in the academic year 2023-2024 as Prescribed in theMSBTE prescribed curriculum
of I Scheme.

Place: Palghar Enrollment No: 2216020059


Date: / / 2024 Exam. Seat No:

Project Guide Head of the Department Principal

7
INDEX
Sr Topic Page
No. No.

1 Abstract 8

2 Introduction 9

3 Code 10

4 Code Output 11

5 Dump Window 12

6 Conclusion 13

7 Reference 14

8
Abstract:

In the realm of computer systems, binary-coded decimal (BCD) encoding


is a common method for representing decimal numbers using binary
digits. BCD numbers are often converted into hexadecimal (base-16)
representations for various computational tasks. These abstract outlines
the process of converting BCD numbers into equivalent hexadecimal
numbers using assembly language.

The conversion from BCD to hexadecimal involves grouping BCD digits


and then converting each group into its hexadecimal equivalent. This
process typically requires logical operations and bitwise manipulations to
extract and recombine the digits.

In assembly language, the conversion is implemented using low-level


instructions that directly manipulate binary representations of numbers.
The program iterates through the BCD number, processes each digit, and
constructs the corresponding hexadecimal number.

This abstract serves as a guide for programmers aiming to perform BCD


to hexadecimal conversion in assembly language, providing insights into
the algorithmic steps and the low-level operations involved. It emphasizes
the importance of understanding binary representations and bitwise
operations in achieving efficient and accurate conversions.

9
Introduction

In assembly language, converting a Binary Coded Decimal (BCD)


number into its equivalent hexadecimal representation involves a series of
logical operations and manipulations of the binary digits. BCD encoding
represents each decimal digit with a 4-bit binary number. To convert
BCD to hexadecimal, we need to group the BCD digits into pairs and
then convert each pair into its hexadecimal equivalent.

Here's a brief outline of the process:


1. Extract BCD Digits: Separate the BCD number into individual
BCD digits by masking and shifting operations.

2. Convert BCD to Hexadecimal: Convert each BCD digit to its


hexadecimal equivalent. This typically involves a lookup table or
logical operations to perform the conversion.

3. Combine Hexadecimal Digits: Concatenate the


hexadecimal equivalents of each BCD digit to obtain the final
hexadecimal representation.
Assembly language provides instructions for bitwise operations, shifting,
masking, and table lookups, which are essential for performing these
conversions efficiently. Each instruction is executed at the hardware
level, making assembly language suitable for tasks that require precise
control over the processor's operations.

By carefully designing algorithms and utilizing assembly language


instructions effectively, one can achieve optimized BCD to hexadecimal
conversion routines suitable for various embedded systems, low-level
programming tasks, and performance-critical applications.

10
Code

DATA SEGMENT
DEC_NUM DB
56
HEX_NUM DW 0
MULT_FAC DW
3e8H DIGIT_COUNT
DW 2 DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,
DS:DATA START:
MOV AX,
DATA MOV DS,
AX MOV BX,
0AH
MOV CX, DIGIT_COUNT
MOV SI, OFFSET
DEC_NUM
XOR DX, DX ; Clear DX register before first MUL operation
UP:
MOV AL, [SI]
AND AL, 0FH
MUL
MULT_FAC
ADD HEX_NUM, AX
ADC DX, 0 ; Add carry from multiplication to
DX MOV AX, MULT_FAC
DIV BX
MOV MULT_FAC,
AX INC SI
LOOP UP
CODE
11
ENDS END
START

12
Code Output

Before Execution

After Execution

13
DUMP Window

14
Conclusion:

In conclusion, the BCD to Hex Converter project has successfully achieved


its objective of developing a reliable software solution for converting Binary
Coded Decimal (BCD) numbers to hexadecimal representation. Through the
implementation of an assembly language program, the project has
demonstrated the effectiveness of a conversion algorithm that efficiently
processes each BCD digit to produce accurate hexadecimal output. The
utilization of multiplication and division operations within the algorithm,
coupled with proper memory management techniques, ensures optimal
performance and reliability throughout the conversion process.

Furthermore, the inclusion of error handling mechanisms enhances the


robustness of the program, enabling it to detect and handle invalid input
conditions effectively. This project not only deepens understanding of low-
level programming concepts and arithmetic operations in assembly language
but also serves as a valuable tool for educational purposes and practical
applications in computer systems. By providing a seamless conversion
between BCD and hexadecimal representations, the project contributes to
advancing knowledge and facilitating the integration of BCD data into
various computing environments. Overall, the BCD to Hex Converter project
underscores the significance of efficient data representation and conversion
methods in computer science and technology.

15
Reference
Microprocessor and interfacing (programming and hard ware) - Hall
Douglas V

https://www.geeksforgeeks.org/8086-program-convert-8-bit-bcd-
number-hexadecimal-number/

https://www.tutorialspoint.com/8086-program-to-convert-an-8-bit-bcd-
number-into-hexadecimal-number

https://codingatharva.blogspot.com/2019/05/program-to-convert-bcd-
number-to-hexadecimal-in-8086.html

https://forum.allaboutcircuits.com/threads/bcd-to-hex-in-
assembly.37947/

16

You might also like