[Tutor] Fw: BCD Ascii to a binary hex value

Deirdre Hackett Deirdre Hackett" <deirdrehac@lycos.co.uk
Tue Feb 18 10:15:02 2003


This is a multi-part message in MIME format.

------=_NextPart_000_004C_01C2D760.FA3E14C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


----- Original Message -----=20
From: Deirdre Hackett=20
To: jtodora@fast.net=20
Sent: Tuesday, February 18, 2003 3:17 PM
Subject: BCD Ascii to a binary hex value


Table

BCD ASCII                            Binary value(Hex)
value                            High byte            Low Byte
30,000                                75                    30
22,500                                57                    E4
15,000                                3A                    98
7,500                                  1D                    4C
00                                       00                    00
- 7,500                                E2                    B4=20
- 15,000                              C3                    74
- 22,500                              A8                    1C
- 30,000                              8A                    D0

I can convert from the BCD ascii for the positive normally using binary =
and for the negative numbers using twos complement but I do not know how =
to convert from the binary value to the BCD ASCII just using just a pen =
and paper as I want to write a program to convert them.
Just thought you might give me some guidance if you can.
Thanks,
Deirdre Hackett

------=_NextPart_000_004C_01C2D760.FA3E14C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>&nbsp;</DIV>
<DIV style=3D"FONT: 10pt arial">----- Original Message -----=20
<DIV style=3D"BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A=20
href=3D"mailto:deirdrehac@lycos.co.uk" =
title=3Ddeirdrehac@lycos.co.uk>Deirdre=20
Hackett</A> </DIV>
<DIV><B>To:</B> <A href=3D"mailto:jtodora@fast.net"=20
title=3Djtodora@fast.net>jtodora@fast.net</A> </DIV>
<DIV><B>Sent:</B> Tuesday, February 18, 2003 3:17 PM</DIV>
<DIV><B>Subject:</B> BCD Ascii to a binary hex value</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>Table</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BCD ASCII&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; Binary value(Hex)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>value&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; High byte&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; Low Byte</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>30,000&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 75&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 30</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>22,500&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 57&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp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;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
1C</FONT></FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2>-=20
30,000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8A&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
D0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I can convert from the BCD ascii for =
the positive=20
normally using binary and for the negative numbers using twos complement =
but I=20
do not know how to convert from the binary value to the BCD ASCII just =
using=20
just a pen and paper as I want to write a program to convert =
them.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Just thought you might give me some =
guidance if you=20
can.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Deirdre =
Hackett</FONT></DIV></BODY></HTML>

------=_NextPart_000_004C_01C2D760.FA3E14C0--