1's and 0's

Other scientific, philosophical, mathematical etc. topics go here.

1's and 0's

Postby papernuke » Fri Nov 23, 2007 5:48 am

when a computer receives information, it receives it in 1's and 0's in a specific formation. what are the 1's and 0's changed into letters? like is there a chart or something for it? and why does it take info in 1's and 0's?

[edit] whoops, this might have supposed to been in programming..
"Civilization is a race between education and catastrophe."
-H.G. Wells
papernuke
Tetronian
 
Posts: 612
Joined: Sat Jul 08, 2006 6:33 pm
Location: California, US of A

Postby wendy » Fri Nov 23, 2007 7:20 am

Computers use binary states. It's just us that calls them 1 and 0. You can use any two symbols. On the other hand, a trinary computer uses three states.
The dream you dream alone is only a dream
the dream we dream together is reality.

\ ( \(\LaTeX\ \) \ ) [no spaces] at https://greasyfork.org/en/users/188714-wendy-krieger
User avatar
wendy
Pentonian
 
Posts: 2031
Joined: Tue Jan 18, 2005 12:42 pm
Location: Brisbane, Australia

Postby papernuke » Fri Nov 23, 2007 8:51 pm

whats a trinary computer? a computer in the 4D?and why does it use binary states then? (or trinary)
"Civilization is a race between education and catastrophe."
-H.G. Wells
papernuke
Tetronian
 
Posts: 612
Joined: Sat Jul 08, 2006 6:33 pm
Location: California, US of A

Postby wendy » Sat Nov 24, 2007 8:09 am

A trinary computer uses three states, eg 0,1,2 or -1,0,1. In stead of using base 2 to express numbers, it uses base 3. Using digits M,0,1 for -1, 0, 1, one has closed multiplication (in that 1 digit * 1 digit = 1 digit), and unsigned negative numbers: ie M01 = -9+1 = -8.

For example, M = -5V, 0 = 0V, 1 = +5V.

Unlike binary computers, the trinary one does not have unavoidable digit flicker (ie when one goes from 9999 to 10000, all the digits flicker). The neighbourhood near 10000 is 1000m, (80), 10000 (81) 10001 (82).

The ones-complement and twos-complement are identical, that is, replacing M01 by 10M (ones complement) gives also the negative.

Comparison can be done by place comparison (rather than subtraction), and then calculate the sign of the result. This can be done very fast. For example, the sign of a number is found by comparing pairs of digits, eg

For compare, you create a new number out of m,0,1 as the individual digits of one number are less than, equal or greater than the corresponding digit of the other. eg cmp(43, 18) = 1m, since 4>1, 8<1. You then find the sigm of this number.

sign( 1MM0M100M) = sign 1MM0M = sign 1MM = sign 1M = 1 You do this by replacing pairs of digits by a sign of these. This is purely digital.
The dream you dream alone is only a dream
the dream we dream together is reality.

\ ( \(\LaTeX\ \) \ ) [no spaces] at https://greasyfork.org/en/users/188714-wendy-krieger
User avatar
wendy
Pentonian
 
Posts: 2031
Joined: Tue Jan 18, 2005 12:42 pm
Location: Brisbane, Australia

Postby Keiji » Sun Nov 25, 2007 8:23 pm

Unlike binary computers, the trinary one does not have unavoidable digit flicker (ie when one goes from 9999 to 10000, all the digits flicker). The neighbourhood near 10000 is 1000m, (80), 10000 (81) 10001 (82).


What?

0 = 000
1 = 001
2 = 01M
3 = 010
4 = 011
5 = 1MM
6 = 1M0

etc...

Isn't there digit flicker between 4 and 5?
User avatar
Keiji
Administrator
 
Posts: 1985
Joined: Mon Nov 10, 2003 6:33 pm
Location: Torquay, England

Postby zero » Tue Nov 27, 2007 7:23 am

Yes, there's that flicker.

Gray codes avoid it,but what's a little flicker going to hurt? Sometimes it can be interesting. You should see what happens when you count off the positive integers using a radix of, oh, how about 2+i -- using five digits (0 and the four fourth roots of 1).
zero
Trionian
 
Posts: 139
Joined: Wed Nov 07, 2007 5:45 am
Location: Florida

Re: 1's and 0's

Postby zero » Tue Nov 27, 2007 7:25 am

papernuke wrote:when a computer receives information, it receives it in 1's and 0's in a specific formation. what are the 1's and 0's changed into letters? like is there a chart or something for it?

Sure, there are several charts. A popular standard for this conversion is called ASCII.

Ultimately, the correspondence is arbitrary. Rather like which side of the road people drive on, it doesn't matter which you pick so long as everyone agrees to abide by the choice.
zero
Trionian
 
Posts: 139
Joined: Wed Nov 07, 2007 5:45 am
Location: Florida

Postby Keiji » Tue Nov 27, 2007 7:47 am

zero wrote:Yes, there's that flicker.

Gray codes avoid it,but what's a little flicker going to hurt? Sometimes it can be interesting. You should see what happens when you count off the positive integers using a radix of, oh, how about 2+i -- using five digits (0 and the four fourth roots of 1).


I can't even see how that works..

M= -1, m = -i

000
001
01m
What's 3..?
User avatar
Keiji
Administrator
 
Posts: 1985
Joined: Mon Nov 10, 2003 6:33 pm
Location: Torquay, England

Postby zero » Tue Nov 27, 2007 8:03 am

0
1
1m
mii
miMM
miM0
miM1
mi0m
mimi
m0iM


It makes more sense when you map out all the gaussian integers this way.
zero
Trionian
 
Posts: 139
Joined: Wed Nov 07, 2007 5:45 am
Location: Florida

Postby Keiji » Tue Nov 27, 2007 7:41 pm

Nice, so this system can store any complex "integer" in a single value. I like it.

The problem is that in order to store a real or imaginary number (with the other part zero), you need as many characters as your number is.
User avatar
Keiji
Administrator
 
Posts: 1985
Joined: Mon Nov 10, 2003 6:33 pm
Location: Torquay, England

Postby zero » Wed Nov 28, 2007 6:14 am

Well, let's see, I don't think the number of digits grows quite that fast. What's interesting to me is the unexpected fact that we can express any number in the lattice of gaussian integers with a radix notation -- just a linear sequence of digits. And it's not hard to learn the relevant addition and multiplication tables. Multiplication becomes rather familiar if you use the following substitutions:

0 for 0
1 for 1
2 for i
3 for -i (m, above)
4 for -1 (M, above)

The products are just what you would expect by multiplying modulo 5.


Addition is a little more involved, but can be put into tabular form:
    +
    0 | 00 01 02 03 04
    1 | 01 13 14 32 00
    2 | 02 14 21 00 23
    3 | 03 32 00 34 41
    4 | 04 00 23 41 42
zero
Trionian
 
Posts: 139
Joined: Wed Nov 07, 2007 5:45 am
Location: Florida

Postby wendy » Wed Nov 28, 2007 7:50 am

In practice, you only need three digits to store complex numbers, M, 0, 1 for -1, 0, 1. It's all done in the 'carry rule'.

Basically, 10 = sqrt(-3). 100 = -3, 1000 = -sqrt(-3), 10000 = 9.

So to write 1+sqrt(-3), one uses 11.

We see then that the cary is 1+1 = m0m (ie -1 * -3 + -1)

11 * 11 = 121 = m1m1

11 * 11 * 11 = 1331 = m0001 = -8 (!)

If you use 1+1+1 = 100, on the other hand, you can have x+y.sqrt(3), and show for example, that tha 1mmm1 (7-4r3) * 11m11 (7+4sqrt(3)) = 1. It is ordinary multiplication, with carry carried two places to the left.
The dream you dream alone is only a dream
the dream we dream together is reality.

\ ( \(\LaTeX\ \) \ ) [no spaces] at https://greasyfork.org/en/users/188714-wendy-krieger
User avatar
wendy
Pentonian
 
Posts: 2031
Joined: Tue Jan 18, 2005 12:42 pm
Location: Brisbane, Australia

Postby Keiji » Wed Nov 28, 2007 8:01 am

zero wrote:Well, let's see, I don't think the number of digits grows quite that fast.


xD

You're right. I generated a list of seven-digit strings, and for some reason couldn't find anything more than 7, but after I posted that I found up to 40, though some numbers aren't there, which makes it a little unconventional.
User avatar
Keiji
Administrator
 
Posts: 1985
Joined: Mon Nov 10, 2003 6:33 pm
Location: Torquay, England

Re: 1's and 0's

Postby Nick » Thu Nov 29, 2007 12:02 am

papernuke wrote:when a computer receives information, it receives it in 1's and 0's in a specific formation. what are the 1's and 0's changed into letters? like is there a chart or something for it? and why does it take info in 1's and 0's?

[edit] whoops, this might have supposed to been in programming..


Yes, there is an ASCII chart, which I will link you to:
http://www.cdrummond.qc.ca/cegep/inform ... ASCII1.GIF

In the chart you see a DEC column, a HEX column, and a CHAR column.
Ignore HEX, nobody loves him. He has no real friends and I hate him with a growing intensity.
You can probably figure out what DEC and CHAR are. However, DEC is pretty useless to computers, that's only for your convenience. So ignore him, too.
The only thing that's important are the 0's and 1's. So:
0 is 0
1 is 1
2 is 10
3 is 11
4 is 100
5 is 101
...

Computers use the 0's and 1's to create the CHARs on your screen.
I am the Nick formerly known as irockyou.
postcount++;
"All evidence of truth comes only from the senses" - Friedrich Nietzsche

Image
Nick
Tetronian
 
Posts: 841
Joined: Sun Feb 19, 2006 8:47 pm
Location: New Jersey, USA

Re: 1's and 0's

Postby Keiji » Thu Nov 29, 2007 5:59 am

Nick wrote:Ignore HEX, nobody loves him. He has no real friends and I hate him with a growing intensity.


Then I hate you with a growing intensity. Decimal is stupid when you're talking about computers. Binary is completely unreadable and the octal base isn't a tetration of 2. Thus hexadecimal is the correct base to use.
User avatar
Keiji
Administrator
 
Posts: 1985
Joined: Mon Nov 10, 2003 6:33 pm
Location: Torquay, England

Re: 1's and 0's

Postby Nick » Tue Dec 04, 2007 9:05 pm

Hayate wrote:
Nick wrote:Ignore HEX, nobody loves him. He has no real friends and I hate him with a growing intensity.


Then I hate you with a growing intensity. Decimal is stupid when you're talking about computers. Binary is completely unreadable and the octal base isn't a tetration of 2. Thus hexadecimal is the correct base to use.


Base 10 is certainly stupid when talking with computers, but how is base 16 any better? Just learn to read binary, it's not hard.
I am the Nick formerly known as irockyou.
postcount++;
"All evidence of truth comes only from the senses" - Friedrich Nietzsche

Image
Nick
Tetronian
 
Posts: 841
Joined: Sun Feb 19, 2006 8:47 pm
Location: New Jersey, USA

Re: 1's and 0's

Postby Keiji » Tue Dec 04, 2007 9:56 pm

Nick wrote:
Hayate wrote:
Nick wrote:Ignore HEX, nobody loves him. He has no real friends and I hate him with a growing intensity.


Then I hate you with a growing intensity. Decimal is stupid when you're talking about computers. Binary is completely unreadable and the octal base isn't a tetration of 2. Thus hexadecimal is the correct base to use.


Base 10 is certainly stupid when talking with computers, but how is base 16 any better? Just learn to read binary, it's not hard.


Has it not occured to you that 16 is a power of 2?

A byte is exactly 2 hex digits, i.e. a byte can be anywhere from 0x00 to 0xFF. Thus all possible hex combinations are representable as bytes.

With decimal, not only must you separate each byte (otherwise, what is "1235346"? Is it 123|53|46, or 12|35|34|6, or what?), but you can have illegal strings of bytes (what is 257|0? Or how about 1|23456|7?). These are all avoided with hexadecimal. Some people like to use octal because it doesn't have any letters in it, but here you again get the invalid combinations problem.
User avatar
Keiji
Administrator
 
Posts: 1985
Joined: Mon Nov 10, 2003 6:33 pm
Location: Torquay, England

Postby zero » Wed Dec 05, 2007 3:00 am

Another way to look at it is that hexadecimal notation is just a more compactly represented form of binary. You can take any number represented in binary notation, break it down appropriately into four-bit segments, then replace each of these segments with the corresponding hexadecimal digit. Any hexadecimal representation of a number may likewise (only in reverse) be expanded into a binary representation.

Hex is thus "condensed" binary.
zero
Trionian
 
Posts: 139
Joined: Wed Nov 07, 2007 5:45 am
Location: Florida


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests