View previous topic :: View next topic
|
Author |
Message |
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
dick scherrer wrote: |
In fact, business arithmetic on the mainframe is not binary most of the time. |
thats wrong no electronic macheine in the world which can directly process data which is not converted into machiene language ie binary |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You need to learn much more before you post such as this.
Quote: |
no electronic macheine in the world which can directly process data which is not converted into machiene language ie binary
|
Packed-decimal is part of the machine language on the mainframe.
If you took the time to look at the generated assembler, and the machine code generated from that, you would learn that there are different machine instructions for packed-decimal arithmetic and binary aritmetic.
It really is time the moderator closes this topic. |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
a computer machiene understands only binary or machiene language. if we need number 2 to be identified by computer it will be converted into binary ie 0010 the packed decimal for 2 is also 0010.
the difference bt binary and packed decimal is that
eg 12 binary is 1100 and bcd is 0001 0010 in both case actually we are converting a decimal into binary so packed decimal is a binary format inwhich each digit is represented in binary |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
cobolunni wrote: |
a computer machiene understands only binary or machiene language. if we need number 2 to be identified by computer it will be converted into binary ie 0010 the packed decimal for 2 is also 0010. |
Oh good, the magic word, "machine language"......On a machine language level (though the packed data is "represented" in binary - because that is how memory works), the machine language processing does not do binary math, it does packed decimal math. When it adds 2 + 2, it adds X'2C' to X'2C' and the result is X'4C'. It sees the digits a byte a a time.
Do you grasp this yet? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Bill,
No, he doesn't. Earlier in the thread i tried to explain that but he is completely focused - incorrectly.
I believe his background is not mainframe and cannot relate to the fact that there really are machine instructions that are not binary on the mainframe.
Oh, well. Like i suggested earlier, probably a good time to close this thread. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sometimes some people just do not see the difference betwee "A and "B", all they see is that "they're letters, so what"..... |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
Quote: |
COBOL Computational Fields:
This is a discussion of COBOL Computational fields. Several numeric data types are discussed, including the common "packed" and "comp-3" fields.
By default, numeric values in COBOL files are stored in display, or character, format. That is, the value is stored as a base-ten number, with each digit represented by the corresponding EBCDIC (or ASCII) character. For example, the value 1234 is stored in four bytes which contain "1", "2", "3", and "4" (F1, F2, F3, F4 Hex).
But because computers perform computations with binary numbers, it is more efficient to store values in their native binary form than to store them in human readable base ten. If the number is stored in its native binary format it can be input from the file and used directly. If it's stored in a base ten format it needs to be converted to binary before performing calculations on it, then converted back to base ten for storage. Binary is faster -- typically about 8 times -- and usually requires less storage space.
|
this is from http://www.discinterchange.com/TechTalk_COBOL_comp_.html
see the line because computers perform computations with binary numbers, it is more efficient to store values in their native binary form than to store them in human readable base ten
as far as i know This is what main aim of COMP and
Quote: |
When it adds 2 + 2, it adds X'2C' to X'2C' and the result is X'4C' |
as a student from electronics i am not understand that because GATES and BUFFERS are the main building blocks of computer as far as i know electrical pulses does the arithmatic .I dont know how computer will know what is that X2C that is a higher version
william you are seeing things only from ouside i think you had to read more to get inside |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Bill,
Once again, he is posting information that is not mainframe-based.
If we could only get him to realize that windows/unix are very different than the IBM mainframe.
Probably won't happen. For some, what they learn first, overrides any additional learning.
Maybe with time he'll learn that while a lot of the syntax is the same, much of the underlying infrastructure is not between the platforms. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
We can alway hope....
Never the less, 'nuff said.... |
|
Back to top |
|
|
|