The Mudcat Café TM
Thread #115539   Message #2479891
Posted By: pavane
30-Oct-08 - 10:24 AM
Thread Name: Tech: converting binary data to ASCII
Subject: RE: Tech: converting binary data to ASCII
ICL 1900 had four 6-bit characters packed into a 24 bit word.
That didn't allow enough different characters, so there were a few "shift" characters which changed the meaning of the following one.

George - it is clear that we are NOT dealing with ASCII in any shape or form. We are dealing with BINARY NUMBERS.

Example:
ASCII is just a way of assigning numeric values to a list of characters, for the purpose of displaying or printing TEXT.

Computers cannot (usually) compute in decimal notation, though there are exceptions. Therefore they cannot directly understand numbers that we type at the keyboard. These have to be converted to BINARY before any arithmetic is done.

The numeric ASCII code for the number 4 is 52

In binary, this would be represented by 00110100, or in Hexadecimal, 34. This should NOT BE REGARDED as a number, it is just a code to tell the computer to input or output the character "4". The character "a" is hex 61, and "A" is hex 41.

Hexadecimal is just a shorthand way of writing binary, using the numbers 0 to 9, and the letters A to F, to represent the 16 possible values which can be held in 4 bits (Called a 'nibble').

A byte contains two nibbles, therefore the hexadecimal code for the value in a byte has two digits or letters.

The BINARY number 4 in an 8-bit number is 00000100, or HEX 04

The BINARY number 4 in a 16-bit number is 0000000000000100
(In HEXADECIMAL, this is 00 04)

This would be interpreted as the character for 00, followed by the character 04, neither of which is printable. I think 00 might show as
a smiley face in a text editor..

The ASCII (Printed) number 69 would be represented as the character 6, followed by the character 9. Therefore (as hex, two bytes 36 39) it would be

0011 0110 0011 1001

As a single binary number, this would be 13881. Nothing like 69 at all!