View previous topic :: View next topic
|
Author |
Message |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Hi
Kindly let me know the equivalent decimal value for Comp-4 Binary value 158.
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Same as in COMP. |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Is decimal value 344 equivalent to COMP-4 binary value 158. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
No, decimal 158 is equivalent to COMP-4 binary value 158 -- the form of the number will not change the value. Hexadecimal value x'0158' has the value of 344 in decimal -- the representation of the number will determine the hexadecimal characters used to identify the value, but the value won't change. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
These days there are even PCs with calculators. Either "scientifc" or "programming".
The way we did it was just to learn base 16 maths. As an aid there was the old green/yellow card.
You have one 256, five 16s and eight. Add 'em all up. If you practice it, it'll work when you don't have ready access to a calculator and won't interrupt the "flow" of dump-reading/disk/tape viewing etc.
Or you can ask on a forum and take the knocks. |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
I have a binary value (pic 9(4) comp-4 type), with hex on gives 0135 .
I tried to convert this binary value to zoned decimal for display purpose using the below build function
BUILD=(1:51,2,BI,ZDF,LENGTH=4)
After the execution i got the zoned decimal value as 0309.
Please let me know if this is correct. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That would be one 256, three 16s and five.
Have you not even found the calculator?
At least you found DFSORT.
EDIT: There has to be something deeper here, doesn't there?
Code: |
01 a-group.
05 a-comp-4 comp-4 pic 9(4) value 309.
DISPLAY ">" a-group "<>" a-comp-4 "<" |
Put it in a program. Compile, run. SET HEX ON for the output. You gave it 309, it gave you back 135 (from the hex display) and 309. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
is it so difficult to find out Yourself...
if it is so a career change is strongly suggested
don' t You have an hex/dec calculator ?
all the windoze systems have one
or just try to remember Your basic maths and ...
Code: |
1 * 256 ==> 256 +
3 * 16 ==> 48 +
5 * 1 ==> 5 =
--------------------
==> 309
|
|
|
Back to top |
|
|
|