Re: Number System

From: Will Twentyman (wtwentyman_at_read.my.sig)
Date: 01/13/05


Date: Thu, 13 Jan 2005 12:54:28 -0500

rehhman wrote:
> I read about Number system from but there are some points where my
> concepts are not clear .I will be very great full to you if you rely
> following questions to clarify my concepts:
>
> 1-What is the application of ASCII and EBCDIC (where these two code
> systems are used)?

Storing symbols.

> 2-Which coding scheme (number system) is used by computer [of course it
> is binary but what type of binary ASCII or EBCDIC]?

A coding scheme is not necessarily a number system. In particular,
ASCII and EBCDIC are coding schemes but not number systems, nor are they
types of binary. Binary is just another name for base-2.

> 3-Since ASCII and EBCDIC are 8 bit coding schemes what about a number
> 255 or greater than 255 how can we store/write these numbers in ASCII
> and EBCDIC?

This question doesn't make much sense, other than to indicate you don't
understand what they represent.

> 4-What is the application of base-8, base-16 in computer [how these
> number systems are used by computer as binary (as base-2 numbers are
> used by digital circuits)]?

Base-8 and base-16 require fewer digits to represent the same number.

> 5-In simple binary 1111=15 of decimal but 1111 of binary=11110001
> 11110101 in
> EBCDIC and 00110001 00110101 in ASCII why three different
> representation of 15 of decimal in simple binary ,ASCII and EBCDIC?

You are confusing the ASCII and EBCDIC encodings of the symbol 5 with
the mathematical base encodings of the value 5.

> 6-Why in addition of two positive numbers we preserve all bits but in
> addition of one positive and one negative number we discard bit/s if
> exceed by the max no of bits as compare to the largest digit.
> For e.g.(1) 101+110=1011 [in binary] we preserve all four bits even in
> the question the largest number consist of three bits or 5+6=11[in
> decimal]

Storage limitations. Usually, integers are stored in an one or more
bytes of storage, which corresponds to a particular number of binary
digits. Overflows are lost to avoid corrupting other areas of memory.

> e.g. (2) But 110+011=001( actual answer is 1001 but we discard right
> most bit) [in binary] [since the 2 complement of +5(101) is -5(011)]or
> 6+(-5)=1{in decimal}]
> Why in e.g.(1) we preserve all bits but in e.g. (2) we discard right
> most bit ?
>
> 7- if we just have number [not mention that its +ve or -ve ] 101 in
> base-2 how we treat this a positive number or negative number?
> Regards

It depends on your interpretation. Usually you have a fixed number of
bits/digits to work with, and you will use an appropriate encoding
scheme (1's or 2's complement) to represent negative numbers.

Googling for the various terms should help you a lot, as you seem to be
confused on a number of issues.

-- 
Will Twentyman
email: wtwentyman at copper dot net


Relevant Pages

  • Re: Invariant with DIGIT-CHAR-P and the reader.
    ... The current situation in CLISP allows users to parse Unicode text ... either ASCII, some sort of ISO-Latin, or Unicode and this will work ... because the digits are probably located identically. ... But, strictly, there is no requirement at all that the ASCII character ...
    (comp.lang.lisp)
  • Re: Fast Linear Hex Search
    ... > 8 million hex digits. ... > functions that turn hex into ascii. ... on sysread you can specify how many bytes to read. ...
    (comp.lang.perl.moderated)
  • Re: How to detect text file encoding in Perl
    ... it is fundamentally impossible given an ASCII file ... Well, every ASCII file is also UTF-8, but not vice versa. ... Windows-1252 code - quite different from the DOS encodings. ... Well, every ASCII file is also valid utf-8, as ...
    (comp.lang.perl.misc)
  • Re: Wonder Woman et al.
    ... "The term extended ASCII describes eight-bit or larger character encodings that include the standard seven-bit ASCII characters as well as others." ... this "definition" encompasses multiple encodings. ...
    (alt.usage.english)
  • Re: FAQ 9.16 How do I decode a CGI form?
    ... ASCII, CGI.pm will make your life miserable. ... When did JavaScript or CSS become "encodings"? ...
    (comp.lang.perl.misc)