Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Binary formats

23 views
Skip to first unread message

DonH

unread,
Mar 27, 2012, 4:18:16 PM3/27/12
to
"The results are displayed in the format 12:1100 or 241:11110001 or
18:10010."
(Page 51 of "Practical PC-2/PC-1500 Pocket Computer Programs" by Jim Cole)

The above quote is part of text explaining program called "Binary/Decimal
Decimal/Binary Converter".

But what does "format" mean? I assume the display varies according to
capacity of your computer, back then (1983).


R.Wieser

unread,
Mar 27, 2012, 5:42:08 PM3/27/12
to
> But what does "format" mean?

In your context its just a fancy word for a phrase like "the way its
displayed".

Example: time. You can "format" it using a 24-hour clock, but also using a
12-hour clock (using AM or PM). The data is the same, its just written-down
differently.

In the case you described the three examples (12: ... , 241:... and 18:...)
are actually in the same format (and not three different ones, as the text
seems to suggest) : A decimal value, a colon, and than the binary
representation of the decimal value.

Hope that clarifies it.

Rudy Wieser

P.s.
It sure looks like you are posting homework-related stuff here ...


-- Origional message:
DonH <donlhu...@bigpond.com> schreef in berichtnieuws
egpcr.5086$%E2....@viwinnwfe01.internal.bigpond.com...

Helmut_Meukel

unread,
Mar 27, 2012, 5:34:06 PM3/27/12
to
DonH machte das folgende Beispiel:
No.

12 dec = 1100 bin.
241 dec = 11110001 bin.
18 dec = 10010 bin.

With "format" he means the formating in the printing of the book:
the decimal value and its binary representation separated by a ":".

HTH,

Helmut.


DonH

unread,
Mar 28, 2012, 3:15:12 PM3/28/12
to
"R.Wieser" <add...@not.available> wrote in message
news:4f723247$0$6844$e4fe...@news2.news.xs4all.nl...
# Thanks for responses.
The text was badly worded, especially use of "or", so I thought it was
something esoteric, instead of the bleeding obvious.
What I was really after was an explanation as to why binary is presented
in different manner, seemingly dependent on circumstances.
For example, in back of book "Computer Programming in Basic" (Carter and
Huzan), there is an ASCII 64-character set, in which binary is a 7-digit
code; yet elsewhere can be 8-digit, etc.
I assume the (0s,1s) prefixes used has to be adequate to cover the range
of characters, as the 64-set does not include the lower-case alphabet, but
only caps.
Has standardisation now been reached?


R.Wieser

unread,
Mar 28, 2012, 7:17:06 PM3/28/12
to
Hello Don,

What I was really after was an explanation as to why
> binary is presented in different manner, seemingly
> dependent on circumstances

"in a different manner" ? Which other (than using "0" and "1") ones do you
see ?

If you mean those example-outputs (12, 241 and 18) than that is not (simply)
binary. The part(s) right of the colon are binary. The part(s) left of it
are simply decimal.

They probably used that particular output-format so that whomever looks at
it can check if the conversion (from decimal to binary) went correct (which
was part of why I assumed it might have been homework :-) )

> For example, in back of book "Computer Programming
> in Basic" (Carter and Huzan), there is an ASCII 64-character
> set, in which binary is a 7-digit code; yet elsewhere can be
> 8-digit, etc.

I'm afraid you misunderstood that. ASCII is the standard in which the
characters beteen codes 32 and 126 are defined (human readable), as well as
most of the characters below code 32 and ofcourse 127 (for special purposes,
like Carriage-return=13 and Linefeed=10. 127 *was* used as DEL) . AFAIK
there is *no* 64-character ASCII standarized definition.

However, someone could define that his code only works with a *subset* of
the ASCII character-set. If-and-when he does he better put that in the
documentation.

As for ASCII in 7- or in 8-bit ? That is a bit of cheating (pun not
intended): The smallest unit in which current PCs store information is a
"byte" (or more correctly: an octet) consisting outof 8 bits. When an ASCII
character is stored into such a byte the highest/leftmost bit is simply
always Zero.

If-and-when you see a character which has the highest bit set (meaning: its
code is in the range 128 ... 255) its is *not* ASCII.

Although, IBM (the company) did create a set of special characters, some of
which not even letters but graphics (among others to draw boxes with), and
did give it the name "extended ASCII". That name somehow stuck. But its
just not standarized. Not even by Microsoft. It used a different "extended
ASCII" set when DOS was its main product. :-)

Hope that clarifies it
Rudy Wieser


-- Origional message:
DonH <donlhu...@bigpond.com> schreef in berichtnieuws
krJcr.4970$v14...@viwinnwfe02.internal.bigpond.com...

ne...@rtrussell.co.uk

unread,
Mar 29, 2012, 4:32:33 AM3/29/12
to
On Mar 29, 12:17 am, "R.Wieser" <addr...@not.available> wrote:
> If-and-when you see a character which has the highest bit set (meaning: its
> code is in the range 128 ... 255) its is *not* ASCII.

You may sometimes find the MSB used as a parity bit.

Richard.
http://www.rtrussell.co.uk/

Helmut_Meukel

unread,
Mar 29, 2012, 7:53:53 AM3/29/12
to
Am 29.03.2012 erklärte R.Wieser:
> DonH wrote:
>> For example, in back of book "Computer Programming
>> in Basic" (Carter and Huzan), there is an ASCII 64-character
>> set, in which binary is a 7-digit code; yet elsewhere can be
>> 8-digit, etc.
>
> I'm afraid you misunderstood that. ASCII is the standard in which the
> characters beteen codes 32 and 126 are defined (human readable), as well as
> most of the characters below code 32 and ofcourse 127 (for special purposes,
> like Carriage-return=13 and Linefeed=10. 127 *was* used as DEL) . AFAIK
> there is *no* 64-character ASCII standarized definition.

Not ASCII, but the originally 5-bit Baudot code:
<http://en.wikipedia.org/wiki/Baudot_code>
used for teleprinters.

BTW, the 7-bit ASCII was designed that it /could/ be used as a 6-bit
(=64 chars) code (without lowercase characters), but I've never
encountered such an use.

>
> As for ASCII in 7- or in 8-bit ? That is a bit of cheating (pun not
> intended): The smallest unit in which current PCs store information is a
> "byte" (or more correctly: an octet) consisting outof 8 bits. When an ASCII
> character is stored into such a byte the highest/leftmost bit is simply
> always Zero.

But that's only true for the internal representation of the code.
If transferred to external devices like printers via a RS232 line
the eighth bit could be used as a parity bit.
You had to select the parity on both devices either off or on.
If no parity was selected, then usually the parity bit was set to "0",
but I used devices which allowed to set it to "1".
If parity was used you had to select "odd" or "even" parity and the
parity bit was then set according to match the other 7 bits.
e.g. "A" is Hex 41 = Dec 65 = Oct 101 = Bin 01000001
With parity set to "odd", the binary value 11000001 was sent to the
printer.

> If-and-when you see a character which has the highest bit set (meaning: its
> code is in the range 128 ... 255) its is *not* ASCII.
>
> Although, IBM (the company) did create a set of special characters, some of
> which not even letters but graphics (among others to draw boxes with), and
> did give it the name "extended ASCII". That name somehow stuck. But its
> just not standarized.

Even IBM superseded it later on with "Code Pages", the originally
"extended ASCII" became Code Page 437.

Helmut.


R.Wieser

unread,
Mar 29, 2012, 8:30:14 AM3/29/12
to
Hello Helmut,

> Not ASCII, but the originally 5-bit Baudot code:
> <http://en.wikipedia.org/wiki/Baudot_code>
> used for teleprinters.

Yes, I know. I just checked, and I've *still* got a punch-tape lying here,
containing pin-up ASCII-art . :-)

I've never seen it used on computers though.

Regards
Rudy Wieser


Helmut_Meukel

unread,
Mar 29, 2012, 3:01:31 PM3/29/12
to
About 1976 we purchased a computerized weighting system for our dyehouse,
it was a HP 9815S with 3 scales connected by RS232.
The protocols were printed using a teleprinter. There was a tiny
microcomputer connected to the HP 9815S for translating the ASCII output
of the 9815S into the code the teleprinter could understand.
IIRC, this tiny microcomputer was a KIM-1 (or something alike), it didn't
look really professional.

My first programming experience was with this HP 9815S, but I never
looked into the hardware and software used to get the output to the
teleprinter. I don't even know what code was used with this teleprinter,
I only know it wasn't ASCII.

Helmut.


Hector Alfaro

unread,
Apr 1, 2012, 3:55:54 PM4/1/12
to
Many old teleprinters use badout code, this is smaller than ascii, uses
5 bits per character.

DonH

unread,
Apr 3, 2012, 4:09:27 PM4/3/12
to
"Helmut_Meukel" <Helmut...@bn-hof.invalid> wrote in message
news:jl1igf$f7n$1...@dont-email.me...
# I assume that a "parity bit" is a "check sum" at binary level.
However, there seems no such digit in the 7-bit code of the "64 character
set", as the first 32 binary codes start with 0, while the second start with
1, giving a code range of 0100000 (space), to 1011111 (leftwards arrow).


Helmut_Meukel

unread,
Apr 5, 2012, 4:41:44 AM4/5/12
to
DonH stellte die Frage:
I wrote about the 7 bit *ASCII* code, which is stored within 8 bits.
Even to external devices like printers, usually 8 data bits were
transmitted. So you had an eighth bit to use as parity bit.

I don't quite understand what you are talking about when you refer to a
"64 character set", because you would always need the first 32
- unprintable - characters of the ASCII code. ´Some of those control
codes are essential for structuring the data and to tell the external
device how to react to the transferred data.
e.g. "Backspace", CR, LF, FF (Form Feed), Bell, STX (Start of TeXt),
ETX (End of TeXt), EOT (End of Transmission), RS (Record Separator),
FS (Field Separator), GS (Group Separator), ...

BTW, ASCII stands for American Standard Code for Information Interchange.

Helmut.


DonH

unread,
Apr 5, 2012, 3:54:43 PM4/5/12
to
"Helmut_Meukel" <Helmut...@bn-hof.invalid> wrote in message
news:jljls2$q5e$1...@dont-email.me...
# My reference to a "64 Character Set" is as displayed as Appendix C in book
quoted above which was, incidentally, first published in 1981.
This book, "Computer Programming in Basic" is an excellent book in many
ways, and is in the Teach Yourself Books series, published by Hodder and
Stoughton. (163 pgs)
Authors: L.R.Carter, and E.Huzan. (ISBN: 0-340-32434-1)
There have been many books on Basic and computers since, but this is one
I often return to.


ralph

unread,
Apr 5, 2012, 10:21:05 PM4/5/12
to
On Fri, 6 Apr 2012 05:54:43 +1000, "DonH" <donlhu...@bigpond.com>
wrote:
>
># My reference to a "64 Character Set" is as displayed as Appendix C in book
>quoted above which was, incidentally, first published in 1981.
> This book, "Computer Programming in Basic" is an excellent book in many
>ways, and is in the Teach Yourself Books series, published by Hodder and
>Stoughton. (163 pgs)
> Authors: L.R.Carter, and E.Huzan. (ISBN: 0-340-32434-1)
> There have been many books on Basic and computers since, but this is one
>I often return to.
>

An unnecessary amplification ... <g>

The term "64 character set" applies less to any one specific encoding
scheme and more to the traditional, common, or basic collection of
printable characters made up of special characters ($, %, ?, ...),
numbers (1, 5, ...), and upper-case letters (A, B, C, ...) facilitated
by the various devices of the day. Including automated and mechanical
devices such as typewriters. It specifically excluded any control
characters.

Of course in order to facilitate these characters the device had to
employ an encoding scheme - some 'standardized', others 'one-off'
device specific. So you do occasionally see specific "64 character
set" encodings, but usually as a cross-reference comparing for example
the encoding of 'A' in Baudot, EBCIDIC, ASCII, and Morse.

In actual use most of the "64 character sets" contained more than 64
characters and more often less, and occasionally control characters
too. The character sets were also occasionally referred to as the
exact number of characters include, so you had "67 character sets",
"58 character sets", etc. It was actually the ASCII standard which
more or less 'finalized' the term to "64 character set". The ASCII
designers deliberately took all these common/basic characters and
placed them into the 3rd to the 6th sticks of their standard. (Sticks
are the 16 character groups, and 4 x 16 is 64.) Thus referring to a
"64 character set" when in fact the character set might contain more
or fewer than 64 characters is a retrograded definition.

Another place you may run across the term is in language
specifications. If you look at old documentation for FORTRAN and
BASIC, somewhere in fine print in the documentation it will say they
use the "64 character set" for its language specification. That is why
once upon a time LET, PRINT, and FILE was 'legal' - let, Print, and
file was not. For early C's you will see the documentation refer to a
"96 character set" (lower case and squiggly characters included <g>).

Such distinctions served a purpose back in the day, but now pretty
much just a distant memory for us geezers.

-ralph
0 new messages