Description
Semester: V
Experiment No 4: Code Conversion
4 a) BCD to Hexadecimal
Input: A packed BCD number in one byte (Eg: 12)
Output: Its hexadecimal equivalent. (Eg: 0C)
Hints:
Step 1: Separate each value (Eg. 01, 02)
Step 2: Perform (first number x 0A + second number) = 01 x 0A + 02 = 0C
4 b) Hexadecimal to BCD
Input: A hexadecimal value (One byte – Eg: FF)
Output: Its BCD output in packed form (in 2 bytes; location1 = 02, location2 = 55 )
Hints:
Store BCD2 in location1
Pack BCD1 and BCD0 to one byte (Eg: as 55) and store to location2




Reviews
There are no reviews yet.