MIC Microproject 22415 Final
MIC Microproject 22415 Final
MIC Microproject 22415 Final
ANJANERI, NASHIK
MICRO PROJECT
ON
“CONVERSION OF NUMBER SYSTEM”
SUBMITTED BY
SR.NO GROUP MEMBER’S NAME SEAT NO ENROLLNMENT
NO
1 Gayatri Pramod Mahajan 437221 2207780027
2 Rohini Chandrakant Jadhav 437240 2207780047
3 Madhuri Kashinath Barve 437213 2207780019
4 Payal Bhausaheb Chavan 437197 2207780001
CERTIFICATE
THIS IS TO CERTIFY THAT
Guide External
TABLES OF CONTENTS
SR. NO CONTENTS PAGE.NO
1. INTROUDCTION 1
FLOWCHART
3 NUMBER OF BASE CONVERSION 3
1.BINARY TO OTHER
2.DECIMAL TO OTHER
3.OCTAL TO OTHER
4.HEADECIMAL TO OTHER
4 CONVERSION 4-11
5 PROGRAM 12-14
6 OUTPUT 15
7 CONCLUSION 16
1.INTRODUCTION :
In this project we use assembly language to create a program.In our project
we use tasm software for run our program.In that we convert a number from
BCD to hexadecicimal number.for that project we create a program for 16 bit
means we create a program for 8086 microprocessor.In that we use Assembly
directives like ASSUME.
Means In that we understand the concept of assembly Directives.In that we
understand about how to step follow for run the program.We understand
about Program Development tools and their use while running our program.
In this article, you will learn the conversion of one base number to another
base number considering all the base numbers such as decimal, binary, octal
and hexadecimal with the help of examples. Here, the following number system
conversion methods are explained.
0000 0 0 0
0001 1 1 1
0010 2 2 2
0011 3 3 3
0100 4 4 4
0101 5 5 5
0110 6 6 6
0111 7 7 7
1000 10 8 8
1001 11 9 9
1010 12 10 A
1011 13 11 B
1100 14 12 C
1101 15 13 D
1110 16 14 E
1111 17 15 F
1
2. ALOGORITHM :
Step 1 : Start
Step 2 :Display Menu
BCD to HEX
Step 3 :Read The Option
It option is 3 exit
Do BCD To HEX conversion
Step 4 :Stop
2.1 FLOWCHART :
2
3. NUMBER OF BASE CONVERSION :
3
4. CONVERSION :
1.DECIMAL TO OTHER :
DECIMAL TO BINARY
Decimal Number System to Other Base
4
DECIMAL TO OCTAL :
DECIMAL TO HEXADECIMAL :
5
2. BINARY TO OTHER :
Multiply the digit with 2(with place value exponent). Eventually add all the
multiplication becomes the Decimal number.
BINARY TO DECIMAL :
BINARY TO OCTAL :
An easy way to convert from binary to octal is to group binary digits into
sets of three, starting with the least significant (rightmost) digits.
6
BINARY TO HEXADECIMAL :
7
3.OCTAL TO OTHER :
OCTAL TO DECIMAL :
OR
2. Remove the most significant octal digit (leftmost) and add it to the result.
(345)8 =(229)10
OCTAL TO BINARY :
OCTAL TO HEXADECIMAL :
8
When converting from octal to hexadecimal, it is often easier to first
convert the octal number into binary and then from binary into
hexadecimal. For example, to convert 345 octal into hex:
Drop any leading zeros or pad with leading zeros to get groups of four
binary digits (bits): Binary 011100101 = 1110 0101 Then, look up the
groups in a table to convert to hexadecimal digits.
4.HEXADECIMAL TO OTHER :
9
HEXADECIMAL TO BINARY :
HEXADECIMAL TO OCTAL :
performs
In the first step, we will find the binary equivalent of the hexadecimal
number.
Next, we have to make the pairs of three bits on both sides of the binary
point. If there will be one or two bits left in a pair of three bits pair, we add
the required number of zeros on extreme sides and write the octal digits
corresponding to each pair.
HEXADECIMAL TO DECIMAL :
10
The process of converting hexadecimal to decimal is the same as binary to
decimal. The process starts from multiplying the digits of hexadecimal
numbers with its corresponding positional weights. And lastly, we add
all those products.
5. PROGRAM :
11
1.In our project first we created code for converting BCD number to Hexadecimal
number. This code as follows:
DATA SEGMENT
BCD_NO DB 1 DUP(?) ;BCD(2 DIGIT Packed BCD)
HEX_NO DB 1 DUP(0) ;Store Hex Equivalent Here
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MOV DX,DATA ; initialization of Data
MOV DS,DX ;Segment resister
MOV AL,BCD_NO ;Load the BCD_NO in AL
MOV BL,AL ;Store it in BL
AND BL,0FH ;mask the lower BCD Digit
AND AL,0F0H ;mask the upper BCD Digit
MOV CL,04H ;Swap the nibbles
ROR AL,CL
MOV DL,0AH ;multiplay the upper BCD Digit with
0AH
MUL DL
ADD AL,BL
MOV HEX_NO,AL ;Store the hex Equivalent Result
MOV AH,4CH ;program Termination with
INT 21H ;return code
CODE ENDS ;End of the code segment
END
2.Open the TASM and type edit MICROPRO.asm.Then We type this code in TASM
software are as follow:
12
3. Then we save this file and exit .then we type tasm MICROPROJ.asm
6. Then next step is the type following for linking our program by linkertlink
MICROPROJ.exe
13
ENDS Directive:The Directive used with the Name of the segment to
indicate the end of that logical Segment
For ex CODE SEGNENT
Declares Start of the logical segment named CODE,containing code
i.e.Instruction in the program
.............
............
CODE ENDS
Declares Ends of the Segment named CODE
END Directive-The END Directive is put after the last Statement of the
Program to tell that this is the END of the Program ModuleThe
Assembler Will ignore Any Statements After and END Directive,so One
Muist Take Sure To use Only One END Directive At the very end of our
Program Module.
Ex.
END Start
It declares that the Assembler Program has Come to end .Further it also
specified Exeucution Entry point from label Start
ASSUME Directive The ASSUME Directive is Used to tell the assembler the
Name of the logical Segment it Shoutld use for the specific Segment
For Ex.ASSUME CS:CODE
Tells the Assembler that the instructions for a program are in a logical
named CODE.
DB (DEFINE BYTE) Directive-To DB Directive Is Used to Declare a Byte
Type Vaiable or to allowcate or more Storage memery location of type
byte in Memory.
Ex.ITEMS DB 49H,98H,25H.
6 .OUTPUT :
14
7. CONCLUSION :
15
There are many different number systems that can be used, including binary
numbers, decimal numbers, hexadecimal numbers, and octal numbers, all of
which can be tested.
Number system conversions are concerned with the operations that are
performed in order to change the base of the numbers. Changing a decimal
number with base 10 to a binary number with base 2 is an example of this
transformation. On the number system, we can also perform arithmetic
operations such as addition, subtraction, and multiplication, among others.
8. BIBLOGRAPHY :
www.google.com
www.wikipedia.com
www.java.net.com
***
16